@arkiv-network/sdk 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/dist/chains/index.d.cts +33 -33
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ npm install @arkiv-network/sdk
|
|
|
83
83
|
This command will update your `package.json` with a section like:
|
|
84
84
|
```json
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@arkiv-network/sdk": "^0.4.
|
|
86
|
+
"@arkiv-network/sdk": "^0.4.4"
|
|
87
87
|
}
|
|
88
88
|
```
|
|
89
89
|
It will also create a `node_modules` directory with all dependencies installed.
|
|
@@ -170,10 +170,16 @@ Now let's add storage (write) functionality.
|
|
|
170
170
|
Create a file named `write_example.ts` with the following content:
|
|
171
171
|
|
|
172
172
|
```typescript
|
|
173
|
-
import { createWalletClient } from
|
|
174
|
-
import {
|
|
175
|
-
import {
|
|
173
|
+
import { createPublicClient, createWalletClient, http } from "@arkiv-network/sdk"
|
|
174
|
+
import { privateKeyToAccount } from "@arkiv-network/sdk/accounts"
|
|
175
|
+
import { mendoza } from "@arkiv-network/sdk/chains"
|
|
176
|
+
import { ExpirationTime, jsonToPayload } from "@arkiv-network/sdk/utils"
|
|
176
177
|
|
|
178
|
+
// Create a public client
|
|
179
|
+
const publicClient = createPublicClient({
|
|
180
|
+
chain: mendoza, // mendoza is the Arkiv testnet for the purposes of hackathons organized in Buenos Aires during devconnect 2025
|
|
181
|
+
transport: http(),
|
|
182
|
+
})
|
|
177
183
|
// Create a wallet client with an account
|
|
178
184
|
const client = createWalletClient({
|
|
179
185
|
chain: mendoza,
|
|
@@ -219,7 +225,7 @@ Now you can run it in the same way as in the previous example:
|
|
|
219
225
|
- **Classic Node.js (using transpilation to JavaScript):**
|
|
220
226
|
```bash
|
|
221
227
|
npx tsc --outDir dist
|
|
222
|
-
node dist/
|
|
228
|
+
node dist/write_example.js
|
|
223
229
|
```
|
|
224
230
|
|
|
225
231
|
**Note:**
|
package/dist/chains/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as viem0 from "viem";
|
|
2
2
|
|
|
3
3
|
//#region src/chains/kaolin.d.ts
|
|
4
4
|
declare const kaolin: {
|
|
@@ -11,13 +11,13 @@ declare const kaolin: {
|
|
|
11
11
|
};
|
|
12
12
|
blockTime?: number | undefined | undefined;
|
|
13
13
|
contracts?: {
|
|
14
|
-
[x: string]:
|
|
15
|
-
[sourceId: number]:
|
|
14
|
+
[x: string]: viem0.ChainContract | {
|
|
15
|
+
[sourceId: number]: viem0.ChainContract | undefined;
|
|
16
16
|
} | undefined;
|
|
17
|
-
ensRegistry?:
|
|
18
|
-
ensUniversalResolver?:
|
|
19
|
-
multicall3?:
|
|
20
|
-
erc6492Verifier?:
|
|
17
|
+
ensRegistry?: viem0.ChainContract | undefined;
|
|
18
|
+
ensUniversalResolver?: viem0.ChainContract | undefined;
|
|
19
|
+
multicall3?: viem0.ChainContract | undefined;
|
|
20
|
+
erc6492Verifier?: viem0.ChainContract | undefined;
|
|
21
21
|
} | undefined;
|
|
22
22
|
ensTlds?: readonly string[] | undefined;
|
|
23
23
|
id: 60138453025;
|
|
@@ -37,9 +37,9 @@ declare const kaolin: {
|
|
|
37
37
|
sourceId?: number | undefined | undefined;
|
|
38
38
|
testnet: true;
|
|
39
39
|
custom?: Record<string, unknown> | undefined;
|
|
40
|
-
fees?:
|
|
40
|
+
fees?: viem0.ChainFees<undefined> | undefined;
|
|
41
41
|
formatters?: undefined;
|
|
42
|
-
serializers?:
|
|
42
|
+
serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
|
|
43
43
|
readonly network: "kaolin";
|
|
44
44
|
};
|
|
45
45
|
//#endregion
|
|
@@ -59,13 +59,13 @@ declare const localhost: {
|
|
|
59
59
|
} | undefined | undefined;
|
|
60
60
|
blockTime?: number | undefined | undefined;
|
|
61
61
|
contracts?: {
|
|
62
|
-
[x: string]:
|
|
63
|
-
[sourceId: number]:
|
|
62
|
+
[x: string]: viem0.ChainContract | {
|
|
63
|
+
[sourceId: number]: viem0.ChainContract | undefined;
|
|
64
64
|
} | undefined;
|
|
65
|
-
ensRegistry?:
|
|
66
|
-
ensUniversalResolver?:
|
|
67
|
-
multicall3?:
|
|
68
|
-
erc6492Verifier?:
|
|
65
|
+
ensRegistry?: viem0.ChainContract | undefined;
|
|
66
|
+
ensUniversalResolver?: viem0.ChainContract | undefined;
|
|
67
|
+
multicall3?: viem0.ChainContract | undefined;
|
|
68
|
+
erc6492Verifier?: viem0.ChainContract | undefined;
|
|
69
69
|
} | undefined;
|
|
70
70
|
ensTlds?: readonly string[] | undefined;
|
|
71
71
|
id: 1337;
|
|
@@ -84,9 +84,9 @@ declare const localhost: {
|
|
|
84
84
|
sourceId?: number | undefined | undefined;
|
|
85
85
|
testnet?: boolean | undefined | undefined;
|
|
86
86
|
custom?: Record<string, unknown> | undefined;
|
|
87
|
-
fees?:
|
|
87
|
+
fees?: viem0.ChainFees<undefined> | undefined;
|
|
88
88
|
formatters?: undefined;
|
|
89
|
-
serializers?:
|
|
89
|
+
serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
|
|
90
90
|
};
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region src/chains/marketplace.d.ts
|
|
@@ -100,13 +100,13 @@ declare const marketplace: {
|
|
|
100
100
|
};
|
|
101
101
|
blockTime?: number | undefined | undefined;
|
|
102
102
|
contracts?: {
|
|
103
|
-
[x: string]:
|
|
104
|
-
[sourceId: number]:
|
|
103
|
+
[x: string]: viem0.ChainContract | {
|
|
104
|
+
[sourceId: number]: viem0.ChainContract | undefined;
|
|
105
105
|
} | undefined;
|
|
106
|
-
ensRegistry?:
|
|
107
|
-
ensUniversalResolver?:
|
|
108
|
-
multicall3?:
|
|
109
|
-
erc6492Verifier?:
|
|
106
|
+
ensRegistry?: viem0.ChainContract | undefined;
|
|
107
|
+
ensUniversalResolver?: viem0.ChainContract | undefined;
|
|
108
|
+
multicall3?: viem0.ChainContract | undefined;
|
|
109
|
+
erc6492Verifier?: viem0.ChainContract | undefined;
|
|
110
110
|
} | undefined;
|
|
111
111
|
ensTlds?: readonly string[] | undefined;
|
|
112
112
|
id: 60138453027;
|
|
@@ -126,9 +126,9 @@ declare const marketplace: {
|
|
|
126
126
|
sourceId?: number | undefined | undefined;
|
|
127
127
|
testnet: true;
|
|
128
128
|
custom?: Record<string, unknown> | undefined;
|
|
129
|
-
fees?:
|
|
129
|
+
fees?: viem0.ChainFees<undefined> | undefined;
|
|
130
130
|
formatters?: undefined;
|
|
131
|
-
serializers?:
|
|
131
|
+
serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
|
|
132
132
|
readonly network: "marketplace";
|
|
133
133
|
};
|
|
134
134
|
//#endregion
|
|
@@ -143,13 +143,13 @@ declare const mendoza: {
|
|
|
143
143
|
};
|
|
144
144
|
blockTime?: number | undefined | undefined;
|
|
145
145
|
contracts?: {
|
|
146
|
-
[x: string]:
|
|
147
|
-
[sourceId: number]:
|
|
146
|
+
[x: string]: viem0.ChainContract | {
|
|
147
|
+
[sourceId: number]: viem0.ChainContract | undefined;
|
|
148
148
|
} | undefined;
|
|
149
|
-
ensRegistry?:
|
|
150
|
-
ensUniversalResolver?:
|
|
151
|
-
multicall3?:
|
|
152
|
-
erc6492Verifier?:
|
|
149
|
+
ensRegistry?: viem0.ChainContract | undefined;
|
|
150
|
+
ensUniversalResolver?: viem0.ChainContract | undefined;
|
|
151
|
+
multicall3?: viem0.ChainContract | undefined;
|
|
152
|
+
erc6492Verifier?: viem0.ChainContract | undefined;
|
|
153
153
|
} | undefined;
|
|
154
154
|
ensTlds?: readonly string[] | undefined;
|
|
155
155
|
id: 60138453056;
|
|
@@ -169,9 +169,9 @@ declare const mendoza: {
|
|
|
169
169
|
sourceId?: number | undefined | undefined;
|
|
170
170
|
testnet: true;
|
|
171
171
|
custom?: Record<string, unknown> | undefined;
|
|
172
|
-
fees?:
|
|
172
|
+
fees?: viem0.ChainFees<undefined> | undefined;
|
|
173
173
|
formatters?: undefined;
|
|
174
|
-
serializers?:
|
|
174
|
+
serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
|
|
175
175
|
readonly network: "mendoza";
|
|
176
176
|
};
|
|
177
177
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/utils/expirationTime.ts","../../src/utils/payload.ts"],"sourcesContent":[],"mappings":";;;cAEa;;;EAAA,SAAA,EAAA,CAAA,KAUZ,EAAA,MAAA,EAAA,GADkB,MAAI;;;;ECTP,SAAA,EAAA,CAAA,KAAa,EAAA,MAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/utils/expirationTime.ts","../../src/utils/payload.ts"],"sourcesContent":[],"mappings":";;;cAEa;;;EAAA,SAAA,EAAA,CAAA,KAUZ,EAAA,MAAA,EAAA,GADkB,MAAI;;;;ECTP,SAAA,EAAA,CAAA,KAAa,EAAA,MAAA,EAAA,GAAgB,MAAA;EAI7B,UAAA,EAAA,CAAA,MAAe,EAAA,MAAA,EAAA,GAAgB,MAAA;mBDK5B;;;;iBCTH,aAAA,gBAA6B;iBAI7B,eAAA,gBAA+B"}
|