diff --git a/.vitepress/config.ts b/.vitepress/config.ts index d096959..18d87d6 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -7,7 +7,6 @@ const apiSidebar = JSON.parse( "utf-8", ), ); -apiSidebar[0].text = "@loktin/sdk"; export default defineConfig({ title: "Loktin Docs", diff --git a/package-lock.json b/package-lock.json index 3a17983..97ca9b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,8 +8,8 @@ "name": "loktin-docs", "version": "0.1.0", "devDependencies": { - "@loktin/sdk": "0.5.0", - "@stellar/stellar-sdk": "17.2.1", + "@loktin/sdk": "1.0.0", + "@stellar/stellar-sdk": "17.4.0", "typedoc": "0.28.20", "typedoc-plugin-markdown": "4.14.1", "typedoc-vitepress-theme": "1.1.4", @@ -867,16 +867,16 @@ "license": "MIT" }, "node_modules/@loktin/sdk": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@loktin/sdk/-/sdk-0.5.0.tgz", - "integrity": "sha512-taQ/tCagH3AJJKqjbtbKvXzuMJGNcBSYX7lev1c1EjTF0M8hdh3wAE9+zH8nwaXhIsFcMdjt110aS4GaPvyCSQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@loktin/sdk/-/sdk-1.0.0.tgz", + "integrity": "sha512-70RPoYcVqFl2O+vEdKZBpki3gB5DltILVQxlU6AEXHTeYbjIdNyzgEJcxd0jd/vNxAtC8k72ZH/NMxl9sHDF9Q==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=22.12.0" }, "peerDependencies": { - "@stellar/stellar-sdk": "^17.2.1" + "@stellar/stellar-sdk": "^17.4.0" } }, "node_modules/@noble/ed25519": { @@ -1351,9 +1351,9 @@ } }, "node_modules/@stellar/stellar-sdk": { - "version": "17.2.1", - "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-17.2.1.tgz", - "integrity": "sha512-kIyfnZ2zCOqV8SUJcsk9buBOvhH1wsLU7KAzqAJyY7AgmD+KdvLTMpI1gcYdhGSakuDG5s6xSO4EN9HZTxpm8g==", + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-17.4.0.tgz", + "integrity": "sha512-IX6gi62yWQ+6Oz56LsVEEeSViSOWJL3BkttftwVmVsu+62nLTWNVsCmTWEzwgNLT/q5HGP25OnlU+hhy2E4wwA==", "dev": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 13acbfd..2361879 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "check:snippets": "tsc -p tsconfig.snippets.json" }, "devDependencies": { - "@loktin/sdk": "0.5.0", - "@stellar/stellar-sdk": "17.2.1", + "@loktin/sdk": "1.0.0", + "@stellar/stellar-sdk": "17.4.0", "typedoc": "0.28.20", "typedoc-plugin-markdown": "4.14.1", "typedoc-vitepress-theme": "1.1.4", diff --git a/sdk/index.md b/sdk/index.md index daabdb9..9c2f08d 100644 --- a/sdk/index.md +++ b/sdk/index.md @@ -15,12 +15,12 @@ The SDK has its own contracts, separate from the Loktin app's for now. ## Status -This is the preview release, `0.5.0`. Its API may change before `1.0.0`. It works on Stellar testnet only. +This is `1.0.0`, the first stable release, so the API changes only in a new major version. It works on Stellar testnet only. ## Install ```sh -npm install @loktin/sdk@next @stellar/stellar-sdk +npm install @loktin/sdk @stellar/stellar-sdk ``` The package is on [npm](https://www.npmjs.com/package/@loktin/sdk). The code is in the [loktin-sdk repo](https://github.com/Lokt-In/loktin-sdk). diff --git a/sdk/quickstart.md b/sdk/quickstart.md index c87c90a..8663120 100644 --- a/sdk/quickstart.md +++ b/sdk/quickstart.md @@ -9,10 +9,10 @@ This page takes you from install to a first goal and a first pay-and-save. The S ## Install ```sh -npm install @loktin/sdk@next @stellar/stellar-sdk +npm install @loktin/sdk @stellar/stellar-sdk ``` -`@stellar/stellar-sdk` is a peer dependency. The SDK needs version 17.2.1 or a later 17.x. +`@stellar/stellar-sdk` is a peer dependency. The SDK needs version 17.4.0 or a later 17.x. ## Create the instance @@ -20,7 +20,7 @@ Create one SDK instance for testnet with the user's address and a signer. The si <<< @/snippets/quickstart.ts#create -Here `userAddress` and `wallet` come from your app. Every write acts for `publicKey`. See [`createLoktin`](/sdk/api/index/functions/createLoktin). +Here `userAddress` and `wallet` come from your app. Every write acts for `publicKey`. See [`createLoktin`](/sdk/api/core/functions/createLoktin). ## Create the modules @@ -32,7 +32,7 @@ Here `integratorAddress` comes from your app. ## Create a first goal -[`createGoal`](/sdk/api/target-savings/classes/TargetSavings#creategoal) creates a goal and gives you its id. Amounts are `bigint` base units. USDC has 7 decimals, and [`toBaseUnits`](/sdk/api/index/functions/toBaseUnits) converts from a decimal string. +[`createGoal`](/sdk/api/target-savings/classes/TargetSavings#creategoal) creates a goal and gives you its id. Amounts are `bigint` base units. USDC has 7 decimals, and [`toBaseUnits`](/sdk/api/core/functions/toBaseUnits) converts from a decimal string. <<< @/snippets/quickstart.ts#first-goal diff --git a/sdk/spend-save.md b/sdk/spend-save.md index a657891..42d8cb0 100644 --- a/sdk/spend-save.md +++ b/sdk/spend-save.md @@ -36,7 +36,7 @@ For a spend made by other means, [`saveForSpend`](/sdk/api/spend-save/classes/Sp The withdrawal window is the whole UTC day of the user's withdrawal day, every month. It can open up to 60 seconds early in real time. -[`nextWindow`](/sdk/api/spend-save/classes/SpendSave#nextwindow) gives the current window if one is open, otherwise the next one, in UTC. Its `end` is the first second after the window. [`windowInTimeZone`](/sdk/api/index/functions/windowInTimeZone) formats it in the device's time zone, or one you name. +[`nextWindow`](/sdk/api/spend-save/classes/SpendSave#nextwindow) gives the current window if one is open, otherwise the next one, in UTC. Its `end` is the first second after the window. [`windowInTimeZone`](/sdk/api/core/functions/windowInTimeZone) formats it in the device's time zone, or one you name. <<< @/snippets/spend-save.ts#window diff --git a/sdk/target-savings.md b/sdk/target-savings.md index 868e884..539c518 100644 --- a/sdk/target-savings.md +++ b/sdk/target-savings.md @@ -23,7 +23,7 @@ Once the target is reached, or from the deadline second onwards, a withdrawal ca ## Amounts -Amounts are `bigint` base units. USDC has 7 decimals. [`toBaseUnits`](/sdk/api/index/functions/toBaseUnits) and [`fromBaseUnits`](/sdk/api/index/functions/fromBaseUnits) convert to and from decimal strings. +Amounts are `bigint` base units. USDC has 7 decimals. [`toBaseUnits`](/sdk/api/core/functions/toBaseUnits) and [`fromBaseUnits`](/sdk/api/core/functions/fromBaseUnits) convert to and from decimal strings. ## The allowance @@ -78,7 +78,7 @@ Under a lock rule, a withdrawal before the target or deadline is refused while t ## Errors -Every error the SDK throws is a [`LoktinError`](/sdk/api/index/classes/LoktinError) with a stable `code`: +Every error the SDK throws is a [`LoktinError`](/sdk/api/core/classes/LoktinError) with a stable `code`: | Code | Meaning | | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |