@ar.io/sdk 2.2.3-alpha.1 → 2.3.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/bundles/web.bundle.min.js +4 -4
- package/lib/cjs/common/io.js +5 -0
- package/lib/cjs/io.js +6 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +5 -0
- package/lib/esm/io.js +6 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +2 -1
- package/lib/types/io.d.ts +8 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +7 -11
package/lib/cjs/common/io.js
CHANGED
|
@@ -336,6 +336,11 @@ class IOReadable {
|
|
|
336
336
|
tags: prunedTags,
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
|
+
async getRegistrationFees() {
|
|
340
|
+
return this.process.read({
|
|
341
|
+
tags: [{ name: 'Action', value: 'Get-Registration-Fees' }],
|
|
342
|
+
});
|
|
343
|
+
}
|
|
339
344
|
}
|
|
340
345
|
exports.IOReadable = IOReadable;
|
|
341
346
|
class IOWriteable extends IOReadable {
|
package/lib/cjs/io.js
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isLeasedArNSRecord = exports.isProcessIdConfiguration = exports.isProcessConfiguration = void 0;
|
|
4
4
|
const arweave_js_1 = require("./utils/arweave.js");
|
|
5
|
+
const nameLengthArray = [
|
|
6
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
|
|
7
|
+
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
|
8
|
+
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
|
|
9
|
+
];
|
|
10
|
+
const leaseLengthArray = [1, 2, 3, 4, 5];
|
|
5
11
|
// Typeguard functions
|
|
6
12
|
function isProcessConfiguration(config) {
|
|
7
13
|
return 'process' in config;
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/io.js
CHANGED
|
@@ -332,6 +332,11 @@ export class IOReadable {
|
|
|
332
332
|
tags: prunedTags,
|
|
333
333
|
});
|
|
334
334
|
}
|
|
335
|
+
async getRegistrationFees() {
|
|
336
|
+
return this.process.read({
|
|
337
|
+
tags: [{ name: 'Action', value: 'Get-Registration-Fees' }],
|
|
338
|
+
});
|
|
339
|
+
}
|
|
335
340
|
}
|
|
336
341
|
export class IOWriteable extends IOReadable {
|
|
337
342
|
signer;
|
package/lib/esm/io.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { validateArweaveId } from './utils/arweave.js';
|
|
2
|
+
const nameLengthArray = [
|
|
3
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
|
|
4
|
+
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
|
5
|
+
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
|
|
6
|
+
];
|
|
7
|
+
const leaseLengthArray = [1, 2, 3, 4, 5];
|
|
2
8
|
// Typeguard functions
|
|
3
9
|
export function isProcessConfiguration(config) {
|
|
4
10
|
return 'process' in config;
|
package/lib/esm/version.js
CHANGED
package/lib/types/common/io.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
|
-
import { AoArNSNameData, AoEpochData, AoEpochSettings, AoGateway, AoIORead, AoIOWrite, EpochInput } from '../io.js';
|
|
17
|
+
import { AoArNSNameData, AoEpochData, AoEpochSettings, AoGateway, AoIORead, AoIOWrite, AoRegistrationFees, EpochInput } from '../io.js';
|
|
18
18
|
import { mIOToken } from '../token.js';
|
|
19
19
|
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoUpdateGatewaySettingsParams, AoWeightedObserver, ContractSigner, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types.js';
|
|
20
20
|
import { AOProcess } from './contracts/ao-process.js';
|
|
@@ -87,6 +87,7 @@ export declare class IOReadable implements AoIORead {
|
|
|
87
87
|
quantity: number;
|
|
88
88
|
name: string;
|
|
89
89
|
}): Promise<number>;
|
|
90
|
+
getRegistrationFees(): Promise<AoRegistrationFees>;
|
|
90
91
|
}
|
|
91
92
|
export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
92
93
|
protected process: AOProcess;
|
package/lib/types/io.d.ts
CHANGED
|
@@ -41,7 +41,12 @@ export type EpochInput = {
|
|
|
41
41
|
timestamp: Timestamp;
|
|
42
42
|
} | undefined;
|
|
43
43
|
export type AoBalances = Record<WalletAddress, number>;
|
|
44
|
-
|
|
44
|
+
declare const nameLengthArray: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51];
|
|
45
|
+
declare const leaseLengthArray: readonly [1, 2, 3, 4, 5];
|
|
46
|
+
export type AoRegistrationFees = Record<(typeof nameLengthArray)[number], {
|
|
47
|
+
lease: Record<(typeof leaseLengthArray)[number], number>;
|
|
48
|
+
permabuy: number;
|
|
49
|
+
}>;
|
|
45
50
|
export type AoObservations = Record<number, AoEpochObservationData>;
|
|
46
51
|
export type AoEpochIndex = number;
|
|
47
52
|
export interface AoIOState {
|
|
@@ -257,6 +262,7 @@ export interface AoIORead {
|
|
|
257
262
|
name?: string;
|
|
258
263
|
quantity?: number;
|
|
259
264
|
}): Promise<number>;
|
|
265
|
+
getRegistrationFees(): Promise<AoRegistrationFees>;
|
|
260
266
|
}
|
|
261
267
|
export interface AoIOWrite extends AoIORead {
|
|
262
268
|
transfer({ target, qty, }: {
|
|
@@ -366,3 +372,4 @@ export declare function isProcessIdConfiguration(config: object): config is {
|
|
|
366
372
|
processId: string;
|
|
367
373
|
};
|
|
368
374
|
export declare function isLeasedArNSRecord(record: AoArNSNameData): record is AoArNSLeaseData;
|
|
375
|
+
export {};
|
package/lib/types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ar.io/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"format": "prettier --check .",
|
|
67
67
|
"format:fix": "prettier --write .",
|
|
68
68
|
"test": "yarn test:unit && yarn test:e2e",
|
|
69
|
-
"test:cjs": "cd ./tests/e2e/cjs && yarn && yarn test",
|
|
70
|
-
"test:esm": "cd ./tests/e2e/esm && yarn && yarn test",
|
|
71
|
-
"test:web": "cd ./tests/e2e/web && yarn && yarn test",
|
|
72
|
-
"test:unit": "
|
|
69
|
+
"test:cjs": "yarn test:link && cd ./tests/e2e/cjs && yarn && yarn test",
|
|
70
|
+
"test:esm": "yarn test:link && cd ./tests/e2e/esm && yarn && yarn test",
|
|
71
|
+
"test:web": "yarn test:link && cd ./tests/e2e/web && yarn && yarn test",
|
|
72
|
+
"test:unit": "NODE_OPTIONS=\"--import=./register.mjs\" node --test tests/unit/**.test.ts",
|
|
73
73
|
"test:link": "yarn build && yarn link",
|
|
74
|
-
"test:e2e": "yarn test:
|
|
74
|
+
"test:e2e": "yarn test:cjs && yarn test:esm && yarn test:web",
|
|
75
75
|
"prepare": "husky install",
|
|
76
76
|
"example:esm": "cd examples/esm && yarn && node index.mjs",
|
|
77
77
|
"example:cjs": "yarn test:link && cd examples/cjs && yarn && node index.cjs",
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
"@semantic-release/git": "^10.0.1",
|
|
87
87
|
"@semantic-release/npm": "^11.0.3",
|
|
88
88
|
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
|
89
|
-
"@types/jest": "^29.5.12",
|
|
90
89
|
"@types/node": "^20.12.12",
|
|
91
90
|
"@types/sinon": "^10.0.15",
|
|
92
91
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
@@ -101,13 +100,11 @@
|
|
|
101
100
|
"eslint-config-standard-with-typescript": "^37.0.0",
|
|
102
101
|
"eslint-plugin-header": "^3.1.1",
|
|
103
102
|
"eslint-plugin-import": "^2.28.0",
|
|
104
|
-
"eslint-plugin-jest": "^27.6.3",
|
|
105
103
|
"eslint-plugin-n": "^16.0.1",
|
|
106
104
|
"eslint-plugin-prettier": "^5.0.0",
|
|
107
105
|
"eslint-plugin-promise": "^6.1.1",
|
|
108
106
|
"http-server": "^14.1.1",
|
|
109
107
|
"husky": "^8.0.3",
|
|
110
|
-
"jest": "^29.7.0",
|
|
111
108
|
"lint-staged": "^15.2.2",
|
|
112
109
|
"markdown-toc-gen": "^1.0.1",
|
|
113
110
|
"prettier": "^3.0.2",
|
|
@@ -115,8 +112,7 @@
|
|
|
115
112
|
"semantic-release": "^21.0.7",
|
|
116
113
|
"sinon": "^15.2.0",
|
|
117
114
|
"testcontainers": "^10.13.1",
|
|
118
|
-
"ts-
|
|
119
|
-
"ts-node": "^10.9.1",
|
|
115
|
+
"ts-node": "^10.9.2",
|
|
120
116
|
"typescript": "^5.1.6",
|
|
121
117
|
"vite-plugin-node-polyfills": "^0.22.0"
|
|
122
118
|
},
|