Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsonevv committed Jul 30, 2024
1 parent f39d4b3 commit 7cf58bb
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 26 deletions.
19 changes: 0 additions & 19 deletions packages/core/docs/api/state.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
## API Reference (State)

### `.contract`

**Returns**

- `ContractState | null`
- `contractId` (`string`): Account ID of the Smart Contract.
- `methodNames` (`Array<string>`): 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**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/api/wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Action>`): 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.

Expand Down
4 changes: 1 addition & 3 deletions packages/modal-ui-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ const selector = await setupWalletSelector({
});

const modal = setupModal(selector, {
contractId: "test.testnet",
contracts: [{ receiverId: "test.testnet", methodNames: [] }]
});

modal.show();
```

## Options

- `contractId` (`string`): Account ID of the Smart Contract used for sign in and signing transactions.
- `methodNames` (`Array<string>?`): 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<string>}>?`): 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.
Expand Down
4 changes: 1 addition & 3 deletions packages/modal-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ const selector = await setupWalletSelector({
});

const modal = setupModal(selector, {
contractId: "test.testnet",
contracts: [{ receiverId: "test.testnet", methodNames: [] }]
});

modal.show();
```

## Options

- `contractId` (`string`): Account ID of the Smart Contract used for sign in and signing transactions.
- `methodNames` (`Array<string>?`): 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<string>}>?`): 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.
Expand Down

0 comments on commit 7cf58bb

Please sign in to comment.