@ar.io/sdk 3.24.0 → 4.0.0-alpha.1
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 +682 -600
- package/lib/esm/cli/cli.js +188 -152
- package/lib/esm/cli/commands/antCommands.js +23 -58
- package/lib/esm/cli/commands/arnsPurchaseCommands.js +48 -30
- package/lib/esm/cli/commands/escrowCommands.js +221 -0
- package/lib/esm/cli/commands/gatewayWriteCommands.js +142 -23
- package/lib/esm/cli/commands/pruneCommands.js +150 -0
- package/lib/esm/cli/commands/readCommands.js +22 -3
- package/lib/esm/cli/commands/transfer.js +6 -6
- package/lib/esm/cli/options.js +124 -58
- package/lib/esm/cli/utils.js +280 -174
- package/lib/esm/common/ant-registry.js +17 -143
- package/lib/esm/common/ant.js +44 -1167
- package/lib/esm/common/faucet.js +11 -6
- package/lib/esm/common/index.js +0 -4
- package/lib/esm/common/io.js +25 -1412
- package/lib/esm/constants.js +13 -19
- package/lib/esm/solana/ant-readable.js +724 -0
- package/lib/esm/solana/ant-registry-readable.js +133 -0
- package/lib/esm/solana/ant-registry-writeable.js +472 -0
- package/lib/esm/solana/ant-writeable.js +384 -0
- package/lib/esm/solana/ata.js +70 -0
- package/lib/esm/solana/canonical-message.js +128 -0
- package/lib/esm/solana/clusters.js +111 -0
- package/lib/esm/solana/constants.js +146 -0
- package/lib/esm/solana/delegation-math.js +112 -0
- package/lib/esm/solana/deserialize.js +711 -0
- package/lib/esm/solana/escrow.js +839 -0
- package/lib/{cjs/utils/json.js → esm/solana/events.js} +15 -10
- package/lib/esm/solana/funding-plan.js +699 -0
- package/lib/esm/solana/index.js +126 -0
- package/lib/esm/solana/instruction.js +39 -0
- package/lib/esm/solana/io-readable.js +2182 -0
- package/lib/esm/solana/io-writeable.js +3196 -0
- package/lib/esm/solana/json-rpc.js +90 -0
- package/lib/esm/solana/metadata.js +81 -0
- package/lib/esm/solana/mpl-core.js +192 -0
- package/lib/esm/solana/pda.js +332 -0
- package/lib/esm/solana/predict-prescribed-observers.js +110 -0
- package/lib/esm/solana/retry.js +117 -0
- package/lib/esm/solana/rpc-circuit-breaker.js +258 -0
- package/lib/esm/solana/send.js +372 -0
- package/lib/esm/solana/spawn-ant.js +224 -0
- package/lib/esm/solana/types.js +1 -0
- package/lib/esm/types/ant.js +27 -15
- package/lib/esm/types/io.js +8 -11
- package/lib/esm/utils/ant.js +0 -63
- package/lib/esm/utils/index.js +0 -3
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/antCommands.d.ts +5 -13
- package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +33 -7
- package/lib/types/cli/commands/escrowCommands.d.ts +68 -0
- package/lib/types/cli/commands/gatewayWriteCommands.d.ts +12 -11
- package/lib/types/cli/commands/pruneCommands.d.ts +31 -0
- package/lib/types/cli/commands/readCommands.d.ts +27 -22
- package/lib/types/cli/commands/transfer.d.ts +9 -9
- package/lib/types/cli/options.d.ts +76 -21
- package/lib/types/cli/types.d.ts +11 -13
- package/lib/types/cli/utils.d.ts +71 -31
- package/lib/types/common/ant-registry.d.ts +49 -47
- package/lib/types/common/ant.d.ts +54 -539
- package/lib/types/common/faucet.d.ts +20 -8
- package/lib/types/common/index.d.ts +0 -3
- package/lib/types/common/io.d.ts +51 -263
- package/lib/types/constants.d.ts +11 -18
- package/lib/types/solana/ant-readable.d.ts +180 -0
- package/lib/types/solana/ant-registry-readable.d.ts +105 -0
- package/lib/types/solana/ant-registry-writeable.d.ts +249 -0
- package/lib/types/solana/ant-writeable.d.ts +177 -0
- package/lib/types/solana/ata.d.ts +44 -0
- package/lib/types/solana/canonical-message.d.ts +121 -0
- package/lib/types/solana/clusters.d.ts +109 -0
- package/lib/types/solana/constants.d.ts +119 -0
- package/lib/types/solana/delegation-math.d.ts +45 -0
- package/lib/types/solana/deserialize.d.ts +262 -0
- package/lib/types/solana/escrow.d.ts +480 -0
- package/lib/types/solana/events.d.ts +38 -0
- package/lib/types/solana/funding-plan.d.ts +225 -0
- package/lib/types/solana/index.d.ts +87 -0
- package/lib/types/solana/instruction.d.ts +39 -0
- package/lib/types/solana/io-readable.d.ts +499 -0
- package/lib/types/solana/io-writeable.d.ts +893 -0
- package/lib/types/solana/json-rpc.d.ts +47 -0
- package/lib/types/solana/metadata.d.ts +84 -0
- package/lib/types/solana/mpl-core.d.ts +120 -0
- package/lib/types/solana/pda.d.ts +95 -0
- package/lib/types/solana/predict-prescribed-observers.d.ts +28 -0
- package/lib/types/solana/retry.d.ts +62 -0
- package/lib/types/solana/rpc-circuit-breaker.d.ts +78 -0
- package/lib/types/solana/send.d.ts +94 -0
- package/lib/types/solana/spawn-ant.d.ts +145 -0
- package/lib/types/solana/types.d.ts +82 -0
- package/lib/types/types/ant-registry.d.ts +43 -4
- package/lib/types/types/ant.d.ts +114 -96
- package/lib/types/types/common.d.ts +18 -74
- package/lib/types/types/faucet.d.ts +2 -2
- package/lib/types/types/io.d.ts +244 -158
- package/lib/types/types/token.d.ts +0 -12
- package/lib/types/utils/ant.d.ts +1 -12
- package/lib/types/utils/index.d.ts +0 -3
- package/lib/types/version.d.ts +1 -1
- package/package.json +36 -33
- package/lib/cjs/cli/cli.js +0 -822
- package/lib/cjs/cli/commands/antCommands.js +0 -113
- package/lib/cjs/cli/commands/arnsPurchaseCommands.js +0 -212
- package/lib/cjs/cli/commands/gatewayWriteCommands.js +0 -210
- package/lib/cjs/cli/commands/readCommands.js +0 -215
- package/lib/cjs/cli/commands/transfer.js +0 -159
- package/lib/cjs/cli/options.js +0 -470
- package/lib/cjs/cli/types.js +0 -2
- package/lib/cjs/cli/utils.js +0 -639
- package/lib/cjs/common/ant-registry.js +0 -155
- package/lib/cjs/common/ant-versions.js +0 -93
- package/lib/cjs/common/ant.js +0 -1182
- package/lib/cjs/common/arweave.js +0 -27
- package/lib/cjs/common/contracts/ao-process.js +0 -224
- package/lib/cjs/common/error.js +0 -64
- package/lib/cjs/common/faucet.js +0 -150
- package/lib/cjs/common/hyperbeam/hb.js +0 -173
- package/lib/cjs/common/index.js +0 -42
- package/lib/cjs/common/io.js +0 -1423
- package/lib/cjs/common/logger.js +0 -83
- package/lib/cjs/common/loggers/winston.js +0 -68
- package/lib/cjs/common/marketplace.js +0 -731
- package/lib/cjs/common/turbo.js +0 -223
- package/lib/cjs/constants.js +0 -41
- package/lib/cjs/node/index.js +0 -39
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/types/ant-registry.js +0 -2
- package/lib/cjs/types/ant.js +0 -168
- package/lib/cjs/types/common.js +0 -2
- package/lib/cjs/types/faucet.js +0 -2
- package/lib/cjs/types/index.js +0 -37
- package/lib/cjs/types/io.js +0 -51
- package/lib/cjs/types/token.js +0 -116
- package/lib/cjs/utils/ant.js +0 -108
- package/lib/cjs/utils/ao.js +0 -432
- package/lib/cjs/utils/arweave.js +0 -285
- package/lib/cjs/utils/base64.js +0 -62
- package/lib/cjs/utils/hash.js +0 -56
- package/lib/cjs/utils/index.js +0 -38
- package/lib/cjs/utils/processes.js +0 -173
- package/lib/cjs/utils/random.js +0 -30
- package/lib/cjs/utils/schema.js +0 -15
- package/lib/cjs/utils/url.js +0 -37
- package/lib/cjs/version.js +0 -20
- package/lib/cjs/web/index.js +0 -41
- package/lib/esm/common/ant-versions.js +0 -87
- package/lib/esm/common/arweave.js +0 -21
- package/lib/esm/common/contracts/ao-process.js +0 -220
- package/lib/esm/common/hyperbeam/hb.js +0 -169
- package/lib/esm/common/marketplace.js +0 -724
- package/lib/esm/common/turbo.js +0 -215
- package/lib/esm/node/index.js +0 -20
- package/lib/esm/utils/ao.js +0 -420
- package/lib/esm/utils/arweave.js +0 -271
- package/lib/esm/utils/processes.js +0 -167
- package/lib/esm/web/index.js +0 -20
- package/lib/types/common/ant-versions.d.ts +0 -39
- package/lib/types/common/arweave.d.ts +0 -17
- package/lib/types/common/contracts/ao-process.d.ts +0 -47
- package/lib/types/common/hyperbeam/hb.d.ts +0 -88
- package/lib/types/common/marketplace.d.ts +0 -568
- package/lib/types/common/turbo.d.ts +0 -61
- package/lib/types/node/index.d.ts +0 -20
- package/lib/types/utils/ao.d.ts +0 -80
- package/lib/types/utils/arweave.d.ts +0 -79
- package/lib/types/utils/processes.d.ts +0 -39
- package/lib/types/web/index.d.ts +0 -20
|
@@ -31,16 +31,4 @@ export declare class mARIOToken extends PositiveFiniteInteger {
|
|
|
31
31
|
minus(subtractHend: mARIOToken): mARIOToken;
|
|
32
32
|
toARIO(): ARIOToken;
|
|
33
33
|
}
|
|
34
|
-
export type AoSigner = (args: {
|
|
35
|
-
data: string | Buffer;
|
|
36
|
-
tags?: {
|
|
37
|
-
name: string;
|
|
38
|
-
value: string;
|
|
39
|
-
}[];
|
|
40
|
-
target?: string;
|
|
41
|
-
anchor?: string;
|
|
42
|
-
}) => Promise<{
|
|
43
|
-
id: string;
|
|
44
|
-
raw: ArrayBuffer;
|
|
45
|
-
}>;
|
|
46
34
|
export {};
|
package/lib/types/utils/ant.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ANTRecords,
|
|
16
|
+
import { ANTRecords, SortedANTRecords } from '../types/ant.js';
|
|
17
17
|
/**
|
|
18
18
|
* Sorts ANT records by priority and then lexicographically.
|
|
19
19
|
*
|
|
@@ -24,14 +24,3 @@ import { ANTRecords, AoANTState, HyperBeamANTState, SortedANTRecords } from '../
|
|
|
24
24
|
* @param antRecords - The ANT records to sort.
|
|
25
25
|
*/
|
|
26
26
|
export declare const sortANTRecords: (antRecords: ANTRecords) => SortedANTRecords;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated - this is no longer necessary because HyperBeam now uses the AoANTState type
|
|
29
|
-
*/
|
|
30
|
-
export declare const isHyperBeamANTState: (state: any) => state is HyperBeamANTState;
|
|
31
|
-
/**
|
|
32
|
-
* Convert HyperBeam serialized ANT state to backwards compatible format.
|
|
33
|
-
*
|
|
34
|
-
* @deprecated - this is no longer necessary because HyperBeam now uses the AOANTState type
|
|
35
|
-
* @param state - The HyperBeam serialized ANT state.
|
|
36
|
-
*/
|
|
37
|
-
export declare const convertHyperBeamStateToAoANTState: (initialState: HyperBeamANTState) => AoANTState;
|
|
@@ -13,10 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export * from './ao.js';
|
|
17
|
-
export * from './arweave.js';
|
|
18
16
|
export * from './base64.js';
|
|
19
17
|
export * from './json.js';
|
|
20
|
-
export * from './processes.js';
|
|
21
18
|
export * from './schema.js';
|
|
22
19
|
export * from './ant.js';
|
package/lib/types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ar.io/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
7
7
|
},
|
|
8
|
-
"main": "./lib/
|
|
9
|
-
"module": "./lib/esm/
|
|
10
|
-
"types": "./lib/types/
|
|
8
|
+
"main": "./lib/esm/solana/index.js",
|
|
9
|
+
"module": "./lib/esm/solana/index.js",
|
|
10
|
+
"types": "./lib/types/solana/index.d.ts",
|
|
11
11
|
"type": "module",
|
|
12
|
+
"packageManager": "yarn@1.22.22",
|
|
12
13
|
"engines": {
|
|
13
14
|
"node": ">=18"
|
|
14
15
|
},
|
|
@@ -22,22 +23,22 @@
|
|
|
22
23
|
"email": "info@ar.io",
|
|
23
24
|
"website": "https://ar.io"
|
|
24
25
|
},
|
|
25
|
-
"keywords": ["arweave", "ar", "blockchain", "ar.io", "
|
|
26
|
+
"keywords": ["arweave", "ar", "blockchain", "ar.io", "solana"],
|
|
26
27
|
"exports": {
|
|
27
28
|
".": {
|
|
28
|
-
"types": "./lib/types/
|
|
29
|
-
"import": "./lib/esm/
|
|
30
|
-
"
|
|
31
|
-
},
|
|
32
|
-
"./node": {
|
|
33
|
-
"types": "./lib/types/node/index.d.ts",
|
|
34
|
-
"import": "./lib/esm/node/index.js",
|
|
35
|
-
"require": "./lib/cjs/node/index.js"
|
|
29
|
+
"types": "./lib/types/solana/index.d.ts",
|
|
30
|
+
"import": "./lib/esm/solana/index.js",
|
|
31
|
+
"default": "./lib/esm/solana/index.js"
|
|
36
32
|
},
|
|
37
33
|
"./web": {
|
|
38
|
-
"types": "./lib/types/
|
|
39
|
-
"import": "./lib/esm/
|
|
40
|
-
"
|
|
34
|
+
"types": "./lib/types/solana/index.d.ts",
|
|
35
|
+
"import": "./lib/esm/solana/index.js",
|
|
36
|
+
"default": "./lib/esm/solana/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./solana": {
|
|
39
|
+
"types": "./lib/types/solana/index.d.ts",
|
|
40
|
+
"import": "./lib/esm/solana/index.js",
|
|
41
|
+
"default": "./lib/esm/solana/index.js"
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
44
|
"bin": {
|
|
@@ -46,25 +47,22 @@
|
|
|
46
47
|
"scripts": {
|
|
47
48
|
"build:web": "node bundle.mjs",
|
|
48
49
|
"build:esm": "yarn tsc -p tsconfig.json",
|
|
49
|
-
"build
|
|
50
|
-
"build": "yarn clean && yarn build:web && yarn build:esm && yarn build:cjs",
|
|
50
|
+
"build": "yarn clean && yarn build:web && yarn build:esm",
|
|
51
51
|
"clean": "rimraf [ lib bundles coverage tests/contracts tests/wallets ]",
|
|
52
52
|
"lint:fix": "biome check --write --unsafe",
|
|
53
53
|
"lint:check": "biome check --unsafe",
|
|
54
54
|
"format:fix": "biome format --write",
|
|
55
55
|
"format:check": "biome format",
|
|
56
|
-
"test": "yarn test:unit
|
|
57
|
-
"test:
|
|
58
|
-
"test:esm": "yarn build:esm && yarn link && cd ./tests/e2e/esm && yarn && yarn test",
|
|
59
|
-
"test:web": "yarn build:esm && yarn link && cd ./tests/e2e/web && yarn && yarn test",
|
|
60
|
-
"test:unit": "c8 tsx --test --test-reporter=spec --enable-source-maps --trace-warnings 'src/**/*.test.ts'",
|
|
56
|
+
"test": "yarn test:unit",
|
|
57
|
+
"test:unit": "c8 tsx --test --test-reporter=spec --enable-source-maps --trace-warnings $(find src -type f -name '*.test.ts' -not -name '*.localnet.test.ts' -not -name '*.cross.test.ts' -not -name '*.e2e.test.ts')",
|
|
61
58
|
"test:link": "yarn build && yarn link",
|
|
62
|
-
"test:
|
|
63
|
-
"
|
|
59
|
+
"test:localnet:io-write": "tsx --test --test-reporter=spec src/solana/io-writeable.localnet.test.ts",
|
|
60
|
+
"sdk-e2e:up": "bash scripts/sdk-e2e-bootstrap.sh",
|
|
61
|
+
"test:sdk-e2e:run": "tsx --test --test-reporter=spec src/solana/sdk.e2e.test.ts",
|
|
62
|
+
"test:sdk-e2e": "bash -c 'set -a && source test/.env.e2e && set +a && yarn test:sdk-e2e:run'",
|
|
64
63
|
"prepare": "husky install",
|
|
65
64
|
"docs:update": "markdown-toc-gen insert README.md --max-depth 2",
|
|
66
65
|
"example:esm": "cd examples/esm && yarn && node index.mjs",
|
|
67
|
-
"example:cjs": "yarn build:cjs && yarn link && cd examples/cjs && yarn && node index.cjs",
|
|
68
66
|
"example:web": "yarn build:web && http-server --port 8080 --host -o examples/web",
|
|
69
67
|
"example:vite": "yarn build:esm && yarn link && cd examples/vite && yarn && yarn start",
|
|
70
68
|
"cli:local": "node lib/esm/cli/cli.js"
|
|
@@ -81,6 +79,7 @@
|
|
|
81
79
|
"@swc/core": "^1.11.22",
|
|
82
80
|
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
|
83
81
|
"@types/node": "^22.14.1",
|
|
82
|
+
"@types/opossum": "^8.1.9",
|
|
84
83
|
"@types/prompts": "^2.4.9",
|
|
85
84
|
"@types/sinon": "^10.0.15",
|
|
86
85
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
@@ -115,16 +114,20 @@
|
|
|
115
114
|
"typescript": "^5.1.6"
|
|
116
115
|
},
|
|
117
116
|
"dependencies": {
|
|
118
|
-
"@
|
|
119
|
-
"@
|
|
120
|
-
"
|
|
121
|
-
"
|
|
117
|
+
"@ar.io/solana-contracts": "0.8.0-staging.18",
|
|
118
|
+
"@noble/hashes": "^1.8.0",
|
|
119
|
+
"@solana-program/address-lookup-table": "^0.11.0",
|
|
120
|
+
"@solana-program/compute-budget": "^0.15.0",
|
|
121
|
+
"@solana-program/token": "^0.13.0",
|
|
122
|
+
"@solana/kit": "^6.8.0",
|
|
123
|
+
"bs58": "^6.0.0",
|
|
122
124
|
"commander": "^12.1.0",
|
|
123
|
-
"
|
|
124
|
-
"prompts": "^2.4.2"
|
|
125
|
+
"opossum": "^9.0.0",
|
|
126
|
+
"prompts": "^2.4.2",
|
|
127
|
+
"zod": "^3.25.76"
|
|
125
128
|
},
|
|
126
129
|
"lint-staged": {
|
|
127
|
-
"**/*.{ts,js,mjs,cjs,
|
|
130
|
+
"**/*.{ts,js,mjs,cjs,json}": ["biome format --write"],
|
|
128
131
|
"**/README.md": ["markdown-toc-gen insert --max-depth 2"]
|
|
129
132
|
}
|
|
130
133
|
}
|