From 7cf58bbf802a4810972066980b4972c82a658451 Mon Sep 17 00:00:00 2001 From: Georgi Tsonev Date: Tue, 30 Jul 2024 16:14:26 +0300 Subject: [PATCH] Update docs --- packages/core/docs/api/state.md | 19 ------------------- packages/core/docs/api/wallet.md | 2 +- packages/modal-ui-js/README.md | 4 +--- packages/modal-ui/README.md | 4 +--- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/packages/core/docs/api/state.md b/packages/core/docs/api/state.md index 57277ac35..9a5a393cd 100644 --- a/packages/core/docs/api/state.md +++ b/packages/core/docs/api/state.md @@ -1,23 +1,4 @@ ## API Reference (State) - -### `.contract` - -**Returns** - -- `ContractState | null` - - `contractId` (`string`): Account ID of the Smart Contract. - - `methodNames` (`Array`): List of methods that can only be invoked on the Smart Contract. Empty list means no restriction. - -**Description** - -Returns the signed in contract. - -**Example** - -```ts -const { contract } = selector.store.getState(); -console.log(contract); // { contractId: "test.testnet", methodNames: [] } -``` ### `.contracts` **Returns** diff --git a/packages/core/docs/api/wallet.md b/packages/core/docs/api/wallet.md index 652fde001..4e57933f6 100644 --- a/packages/core/docs/api/wallet.md +++ b/packages/core/docs/api/wallet.md @@ -309,7 +309,7 @@ Signs the message and verifies the owner. Message is not sent to blockchain. - `params` (`object`) - `signerId` (`string?`): Account ID used to sign the transaction. Defaults to the first account. - - `receiverId` (`string?`): Account ID to receive the transaction. Defaults to `contractId` defined in `.init`. + - `receiverId` (`string`): Account ID to receive the transaction. Defaults to `contractId` defined in `.init`. - `actions` (`Array`): NEAR Action(s) to sign and send to the network (e.g. `FunctionCall`). You can find more information on `Action` [here](./transactions.md). - `callbackUrl` (`string?`): Applicable to browser wallets (e.g. MyNearWallet). This the callback url once the transaction is approved. diff --git a/packages/modal-ui-js/README.md b/packages/modal-ui-js/README.md index 930202988..f5123d4f0 100644 --- a/packages/modal-ui-js/README.md +++ b/packages/modal-ui-js/README.md @@ -27,7 +27,7 @@ const selector = await setupWalletSelector({ }); const modal = setupModal(selector, { - contractId: "test.testnet", + contracts: [{ receiverId: "test.testnet", methodNames: [] }] }); modal.show(); @@ -35,8 +35,6 @@ modal.show(); ## Options -- `contractId` (`string`): Account ID of the Smart Contract used for sign in and signing transactions. -- `methodNames` (`Array?`): Specify limited access to particular methods on the Smart Contract. - `theme` (`Theme?`): Specify light/dark theme for UI. Defaults to the browser configuration when omitted or set to 'auto'. This can be either `light`, `dark` or `auto`. - `description` (`string?`): Define a custom description in the UI. - `contracts` (`Array<{allowance?: BN, receiverId: string, methodNames: Array}>?`): List of the Smart Contracts and the limited access to particular methods on the Smart Contract for signing in with multiple contracts. When the list of contracts is provided the `signInMulti` method of the wallets is used by default to sign-in. diff --git a/packages/modal-ui/README.md b/packages/modal-ui/README.md index c3a78314c..85de77194 100644 --- a/packages/modal-ui/README.md +++ b/packages/modal-ui/README.md @@ -27,7 +27,7 @@ const selector = await setupWalletSelector({ }); const modal = setupModal(selector, { - contractId: "test.testnet", + contracts: [{ receiverId: "test.testnet", methodNames: [] }] }); modal.show(); @@ -35,8 +35,6 @@ modal.show(); ## Options -- `contractId` (`string`): Account ID of the Smart Contract used for sign in and signing transactions. -- `methodNames` (`Array?`): Specify limited access to particular methods on the Smart Contract. - `theme` (`Theme?`): Specify light/dark theme for UI. Defaults to the browser configuration when omitted or set to 'auto'. This can be either `light`, `dark` or `auto`. - `description` (`string?`): Define a custom description in the UI. - `contracts` (`Array<{allowance?: BN, receiverId: string, methodNames: Array}>?`): List of the Smart Contracts and the limited access to particular methods on the Smart Contract for signing in with multiple contracts. When the list of contracts is provided the `signInMulti` method of the wallets is used by default to sign-in.