Skip to content

Commit 34804e3

Browse files
authored
Merge pull request #60 from polkadot-api/cs-1.13
2 parents 6c4d122 + fe07f76 commit 34804e3

File tree

8 files changed

+2238
-1133
lines changed

8 files changed

+2238
-1133
lines changed

docs/pages/ink.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ if (response.result.success) {
157157

158158
Every message or contract deployment generates `SystemEvent`s that are available through the regular RuntimeApi's `response.events` or through `transactionResult.events`. These can be filtered using the [Events Filter API](/typed/events#filter).
159159

160-
Ink! has its own SystemEvent, `Contracts.ContractEmitted` which can contain events emitted within the contract, but the payload is SCALE encoded, with a type definition declared in the metadata.
160+
Ink! has its own SystemEvent, `Contracts.ContractEmitted` (or `Revive.ContractEmitted`) which can contain events emitted within the contract, but the payload is SCALE encoded, with a type definition declared in the metadata.
161161

162162
Polkadot-API's inkClient offers an API to decode a specific ink! event, and also to filter all the `Contracts.ContractEmitted` events from a list and return them already decoded:
163163

docs/pages/recipes/connect-to-multiple-chains.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const identityDataToString = (data: IdentityData | undefined) => {
6868
return Binary.fromBytes(new Uint8Array(data.value)).asText()
6969
return data.value.asText()
7070
}
71-
const name = identityDataToString(identity?.[0].info.display) ?? ADDRESS
71+
const name = identityDataToString(identity?.info.display) ?? ADDRESS
7272
const freeBalance = Number(account.data.free) / Math.pow(10, DECIMALS)
7373

7474
console.log(`${name}'s balance is ${freeBalance.toLocaleString()} DOT`)

docs/pages/typed/queries.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ type StorageEntryWithoutKeys<Payload> = {
1717
getCompatibilityLevel: GetCompatibilityLevel
1818
getValue: (options?: CallOptions) => Promise<Payload>
1919
watchValue: (bestOrFinalized?: "best" | "finalized") => Observable<Payload>
20+
21+
getKey: () => Promise<HexString>
22+
getKey: (token: CompatibilityToken) => HexString
2023
}
2124
```
2225
26+
`getKey` builds the storage key for a specific query. It optionally takes a [`CompatibilityToken`](/typed), making it synchronous if passed.
27+
2328
As you might expect, `getValue` returns you the `Payload` for that particular query, allowing you to choose which block to query (`at` can be a blockHash, `"finalized"` (the default), or `"best"`).
2429
2530
On the other hand, `watchValue` function returns an Observable allows you to check the changes of a particular storage entry in `"best"` or `"finalized"` (the default) block.
@@ -58,9 +63,14 @@ type StorageEntryWithKeys<Args, Payload, ArgsOut> = {
5863
}
5964
entries: Array<{ args: ArgsOut; value: NonNullable<Payload> }>
6065
}>
66+
67+
getKey: (...args: PossibleArgs) => Promise<HexString>
68+
getKey: (...args: PossibleArgs, token: CompatibilityToken) => HexString
6169
}
6270
```
6371
72+
`getKey` builds the storage key for a specific query and set of arguments. You can pass all args just a subset of them. It optionally takes a [`CompatibilityToken`](/typed), making it synchronous if passed.
73+
6474
Both `getValue` and `watchValue` have the same behaviour as in the previous case, but they require you to pass all keys required for that storage query (in our example, an address). The same function arguments that are found in the no-keys situation can be passed at the end of the call to modify which block to query, etc. For example, a query with 3 args:
6575
6676
```ts

docs/pages/typed/tx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ type TxOptions<Asset> = Partial<{
148148
```
149149
150150
- `at`: gives the option to choose which block to target when creating the transaction. Default: `finalized`
151-
- `mortality`: gives the option to choose the mortality for the transaction. Default: `{ mortal: true, period: 64 }`
151+
- `mortality`: gives the option to choose the mortality for the transaction. Default: `{ mortal: true, period: 64 }`. The `period` will be rounded to the first power of two greater or equal to it.
152152
- `nonce`: this is meant for advanced users that submit several transactions in a row, it allows to modify the default `nonce`. Default: highest nonce found in any known block.
153153
- `tip`: add tip to transaction. Default: `0`
154154
- `asset`: there're several chains that allow you to choose which asset to use to pay for the fees and tip. This field will be strongly typed as well and will adapt to every chain used in the `dApp`. Default: `undefined`. This means to use the native token from the chain.

docs/pages/typed/view.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# View Functions
2+
3+
View functions are particular [Runtime APIs](/typed/apis) linked to pallets. Therefore, their API is exactly the same as any runtime API. They are found under `typedApi.view`. See [APIS](/typed/apis) documentation for usage notes.
4+
5+
:::warning
6+
Remember that View Functions are only available if the chain exposes version 16 (or ahead) of the metadata.
7+
:::

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
"prepare": "husky"
1111
},
1212
"dependencies": {
13-
"@radix-ui/react-tabs": "^1.1.11",
14-
"@types/react": "^19.1.3",
13+
"@radix-ui/react-tabs": "^1.1.12",
14+
"@types/react": "^19.1.6",
1515
"react": "^19.1.0",
1616
"react-dom": "^19.1.0",
1717
"typescript": "^5.8.3",
18-
"vocs": "1.0.11"
18+
"vocs": "1.0.12"
1919
},
2020
"devDependencies": {
2121
"@homer0/prettier-plugin-jsdoc": "^10.0.0",
2222
"husky": "^9.1.7",
23-
"lint-staged": "^15.5.2",
23+
"lint-staged": "^16.1.0",
2424
"prettier": "^3.5.3",
25-
"tailwindcss": "^4.1.5"
25+
"tailwindcss": "^4.1.8"
2626
},
2727
"prettier": {
2828
"printWidth": 80,
@@ -35,5 +35,5 @@
3535
"lint-staged": {
3636
"*.{js,jsx,ts,tsx,json,md,mdx,css,cjs}": "prettier --write"
3737
},
38-
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
38+
"packageManager": "pnpm@10.11.1+sha512.e519b9f7639869dc8d5c3c5dfef73b3f091094b0a006d7317353c72b124e80e1afd429732e28705ad6bfa1ee879c1fce46c128ccebd3192101f43dd67c667912"
3939
}

0 commit comments

Comments
 (0)