@ar.io/sdk 2.4.0-alpha.12 → 2.4.0-alpha.14
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 +85 -90
- package/lib/cjs/common/contracts/ao-process.js +1 -0
- package/lib/cjs/common/http.js +2 -2
- package/lib/cjs/common/io.js +5 -40
- package/lib/cjs/types/index.js +3 -1
- package/lib/cjs/utils/arweave.js +12 -16
- package/lib/cjs/utils/index.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/contracts/ao-process.js +1 -0
- package/lib/esm/common/http.js +1 -1
- package/lib/esm/common/io.js +6 -41
- package/lib/esm/types/index.js +3 -1
- package/lib/esm/utils/arweave.js +10 -15
- package/lib/esm/utils/index.js +2 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +4 -3
- package/lib/types/types/index.d.ts +3 -1
- package/lib/types/types/io.d.ts +6 -5
- package/lib/types/utils/arweave.d.ts +18 -1
- package/lib/types/utils/index.d.ts +2 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +2 -1
|
@@ -44,6 +44,7 @@ class AOProcess {
|
|
|
44
44
|
tags,
|
|
45
45
|
});
|
|
46
46
|
if (result.Messages === undefined || result.Messages.length === 0) {
|
|
47
|
+
this.logger.debug(`Process ${this.processId} does not support provided action.`, result, tags);
|
|
47
48
|
throw new Error(`Process ${this.processId} does not support provided action.`);
|
|
48
49
|
}
|
|
49
50
|
const tagsOutput = result.Messages[0].Tags;
|
package/lib/cjs/common/http.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AxiosHTTPService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const http_client_js_1 = require("../utils/http-client.js");
|
|
5
5
|
const error_js_1 = require("./error.js");
|
|
6
6
|
const logger_js_1 = require("./logger.js");
|
|
7
7
|
class AxiosHTTPService {
|
|
@@ -9,7 +9,7 @@ class AxiosHTTPService {
|
|
|
9
9
|
logger;
|
|
10
10
|
constructor({ url, logger = logger_js_1.Logger.default, }) {
|
|
11
11
|
this.logger = logger;
|
|
12
|
-
this.axios = (0,
|
|
12
|
+
this.axios = (0, http_client_js_1.createAxiosInstance)({
|
|
13
13
|
axiosConfig: {
|
|
14
14
|
baseURL: url,
|
|
15
15
|
},
|
package/lib/cjs/common/io.js
CHANGED
|
@@ -59,14 +59,7 @@ class IOReadable {
|
|
|
59
59
|
{
|
|
60
60
|
name: 'Timestamp',
|
|
61
61
|
value: params?.timestamp?.toString() ??
|
|
62
|
-
(await this.arweave.
|
|
63
|
-
.getCurrent()
|
|
64
|
-
.then((block) => {
|
|
65
|
-
return { timestamp: block.timestamp * 1000 };
|
|
66
|
-
})
|
|
67
|
-
.catch(() => {
|
|
68
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
69
|
-
})).timestamp.toString(),
|
|
62
|
+
(await (0, arweave_js_1.getCurrentBlockUnixTimestampMs)(this.arweave)).toString(),
|
|
70
63
|
},
|
|
71
64
|
{
|
|
72
65
|
name: 'Epoch-Index',
|
|
@@ -83,14 +76,7 @@ class IOReadable {
|
|
|
83
76
|
{
|
|
84
77
|
name: 'Timestamp',
|
|
85
78
|
value: epoch?.timestamp?.toString() ??
|
|
86
|
-
(await this.arweave.
|
|
87
|
-
.getCurrent()
|
|
88
|
-
.then((block) => {
|
|
89
|
-
return { timestamp: block.timestamp * 1000 };
|
|
90
|
-
})
|
|
91
|
-
.catch(() => {
|
|
92
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
93
|
-
})).timestamp.toString(),
|
|
79
|
+
(await (0, arweave_js_1.getCurrentBlockUnixTimestampMs)(this.arweave)).toString(),
|
|
94
80
|
},
|
|
95
81
|
{
|
|
96
82
|
name: 'Epoch-Index',
|
|
@@ -224,14 +210,7 @@ class IOReadable {
|
|
|
224
210
|
{
|
|
225
211
|
name: 'Timestamp',
|
|
226
212
|
value: epoch?.timestamp?.toString() ??
|
|
227
|
-
(await this.arweave.
|
|
228
|
-
.getCurrent()
|
|
229
|
-
.then((block) => {
|
|
230
|
-
return { timestamp: block.timestamp * 1000 };
|
|
231
|
-
})
|
|
232
|
-
.catch(() => {
|
|
233
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
234
|
-
})).timestamp.toString(),
|
|
213
|
+
(await (0, arweave_js_1.getCurrentBlockUnixTimestampMs)(this.arweave)).toString(),
|
|
235
214
|
},
|
|
236
215
|
{
|
|
237
216
|
name: 'Epoch-Index',
|
|
@@ -248,14 +227,7 @@ class IOReadable {
|
|
|
248
227
|
{
|
|
249
228
|
name: 'Timestamp',
|
|
250
229
|
value: epoch?.timestamp?.toString() ??
|
|
251
|
-
(await this.arweave.
|
|
252
|
-
.getCurrent()
|
|
253
|
-
.then((block) => {
|
|
254
|
-
return { timestamp: block.timestamp * 1000 };
|
|
255
|
-
})
|
|
256
|
-
.catch(() => {
|
|
257
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
258
|
-
})).timestamp.toString(),
|
|
230
|
+
(await (0, arweave_js_1.getCurrentBlockUnixTimestampMs)(this.arweave)).toString(),
|
|
259
231
|
},
|
|
260
232
|
{
|
|
261
233
|
name: 'Epoch-Index',
|
|
@@ -296,14 +268,7 @@ class IOReadable {
|
|
|
296
268
|
{
|
|
297
269
|
name: 'Timestamp',
|
|
298
270
|
value: epoch?.timestamp?.toString() ??
|
|
299
|
-
(await this.arweave.
|
|
300
|
-
.getCurrent()
|
|
301
|
-
.then((block) => {
|
|
302
|
-
return { timestamp: block.timestamp * 1000 };
|
|
303
|
-
})
|
|
304
|
-
.catch(() => {
|
|
305
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
306
|
-
})).timestamp.toString(),
|
|
271
|
+
(await (0, arweave_js_1.getCurrentBlockUnixTimestampMs)(this.arweave)).toString(),
|
|
307
272
|
},
|
|
308
273
|
{
|
|
309
274
|
name: 'Epoch-Index',
|
package/lib/cjs/types/index.js
CHANGED
|
@@ -29,6 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
* See the License for the specific language governing permissions and
|
|
30
30
|
* limitations under the License.
|
|
31
31
|
*/
|
|
32
|
+
__exportStar(require("./ant-registry.js"), exports);
|
|
33
|
+
__exportStar(require("./ant.js"), exports);
|
|
32
34
|
__exportStar(require("./common.js"), exports);
|
|
33
|
-
__exportStar(require("./token.js"), exports);
|
|
34
35
|
__exportStar(require("./io.js"), exports);
|
|
36
|
+
__exportStar(require("./token.js"), exports);
|
package/lib/cjs/utils/arweave.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pruneTags = exports.isBlockHeight = exports.validateArweaveId = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
3
|
+
exports.getCurrentBlockUnixTimestampMs = exports.pruneTags = exports.isBlockHeight = exports.validateArweaveId = void 0;
|
|
19
4
|
const constants_js_1 = require("../constants.js");
|
|
20
5
|
const validateArweaveId = (id) => {
|
|
21
6
|
return constants_js_1.ARWEAVE_TX_REGEX.test(id);
|
|
@@ -29,3 +14,14 @@ const pruneTags = (tags) => {
|
|
|
29
14
|
return tags.filter((tag) => tag.value !== undefined);
|
|
30
15
|
};
|
|
31
16
|
exports.pruneTags = pruneTags;
|
|
17
|
+
const getCurrentBlockUnixTimestampMs = async (arweave) => {
|
|
18
|
+
return await arweave.blocks
|
|
19
|
+
.getCurrent()
|
|
20
|
+
.then((block) => {
|
|
21
|
+
return block.timestamp * 1000;
|
|
22
|
+
})
|
|
23
|
+
.catch(() => {
|
|
24
|
+
return Date.now(); // fallback to current time
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
exports.getCurrentBlockUnixTimestampMs = getCurrentBlockUnixTimestampMs;
|
package/lib/cjs/utils/index.js
CHANGED
|
@@ -29,9 +29,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
* See the License for the specific language governing permissions and
|
|
30
30
|
* limitations under the License.
|
|
31
31
|
*/
|
|
32
|
-
__exportStar(require("./arweave.js"), exports);
|
|
33
|
-
__exportStar(require("./http-client.js"), exports);
|
|
34
32
|
__exportStar(require("./ao.js"), exports);
|
|
33
|
+
__exportStar(require("./arweave.js"), exports);
|
|
34
|
+
__exportStar(require("./base64.js"), exports);
|
|
35
35
|
__exportStar(require("./json.js"), exports);
|
|
36
36
|
__exportStar(require("./processes.js"), exports);
|
|
37
37
|
__exportStar(require("./schema.js"), exports);
|
package/lib/cjs/version.js
CHANGED
|
@@ -41,6 +41,7 @@ export class AOProcess {
|
|
|
41
41
|
tags,
|
|
42
42
|
});
|
|
43
43
|
if (result.Messages === undefined || result.Messages.length === 0) {
|
|
44
|
+
this.logger.debug(`Process ${this.processId} does not support provided action.`, result, tags);
|
|
44
45
|
throw new Error(`Process ${this.processId} does not support provided action.`);
|
|
45
46
|
}
|
|
46
47
|
const tagsOutput = result.Messages[0].Tags;
|
package/lib/esm/common/http.js
CHANGED
package/lib/esm/common/io.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IO_TESTNET_PROCESS_ID } from '../constants.js';
|
|
2
2
|
import { isProcessConfiguration, isProcessIdConfiguration, } from '../types/io.js';
|
|
3
3
|
import { createAoSigner } from '../utils/ao.js';
|
|
4
|
-
import { pruneTags } from '../utils/arweave.js';
|
|
4
|
+
import { getCurrentBlockUnixTimestampMs, pruneTags } from '../utils/arweave.js';
|
|
5
5
|
import { defaultArweave } from './arweave.js';
|
|
6
6
|
import { AOProcess } from './contracts/ao-process.js';
|
|
7
7
|
import { InvalidContractConfigurationError } from './error.js';
|
|
@@ -55,14 +55,7 @@ export class IOReadable {
|
|
|
55
55
|
{
|
|
56
56
|
name: 'Timestamp',
|
|
57
57
|
value: params?.timestamp?.toString() ??
|
|
58
|
-
(await this.arweave.
|
|
59
|
-
.getCurrent()
|
|
60
|
-
.then((block) => {
|
|
61
|
-
return { timestamp: block.timestamp * 1000 };
|
|
62
|
-
})
|
|
63
|
-
.catch(() => {
|
|
64
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
65
|
-
})).timestamp.toString(),
|
|
58
|
+
(await getCurrentBlockUnixTimestampMs(this.arweave)).toString(),
|
|
66
59
|
},
|
|
67
60
|
{
|
|
68
61
|
name: 'Epoch-Index',
|
|
@@ -79,14 +72,7 @@ export class IOReadable {
|
|
|
79
72
|
{
|
|
80
73
|
name: 'Timestamp',
|
|
81
74
|
value: epoch?.timestamp?.toString() ??
|
|
82
|
-
(await this.arweave.
|
|
83
|
-
.getCurrent()
|
|
84
|
-
.then((block) => {
|
|
85
|
-
return { timestamp: block.timestamp * 1000 };
|
|
86
|
-
})
|
|
87
|
-
.catch(() => {
|
|
88
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
89
|
-
})).timestamp.toString(),
|
|
75
|
+
(await getCurrentBlockUnixTimestampMs(this.arweave)).toString(),
|
|
90
76
|
},
|
|
91
77
|
{
|
|
92
78
|
name: 'Epoch-Index',
|
|
@@ -220,14 +206,7 @@ export class IOReadable {
|
|
|
220
206
|
{
|
|
221
207
|
name: 'Timestamp',
|
|
222
208
|
value: epoch?.timestamp?.toString() ??
|
|
223
|
-
(await this.arweave.
|
|
224
|
-
.getCurrent()
|
|
225
|
-
.then((block) => {
|
|
226
|
-
return { timestamp: block.timestamp * 1000 };
|
|
227
|
-
})
|
|
228
|
-
.catch(() => {
|
|
229
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
230
|
-
})).timestamp.toString(),
|
|
209
|
+
(await getCurrentBlockUnixTimestampMs(this.arweave)).toString(),
|
|
231
210
|
},
|
|
232
211
|
{
|
|
233
212
|
name: 'Epoch-Index',
|
|
@@ -244,14 +223,7 @@ export class IOReadable {
|
|
|
244
223
|
{
|
|
245
224
|
name: 'Timestamp',
|
|
246
225
|
value: epoch?.timestamp?.toString() ??
|
|
247
|
-
(await this.arweave.
|
|
248
|
-
.getCurrent()
|
|
249
|
-
.then((block) => {
|
|
250
|
-
return { timestamp: block.timestamp * 1000 };
|
|
251
|
-
})
|
|
252
|
-
.catch(() => {
|
|
253
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
254
|
-
})).timestamp.toString(),
|
|
226
|
+
(await getCurrentBlockUnixTimestampMs(this.arweave)).toString(),
|
|
255
227
|
},
|
|
256
228
|
{
|
|
257
229
|
name: 'Epoch-Index',
|
|
@@ -292,14 +264,7 @@ export class IOReadable {
|
|
|
292
264
|
{
|
|
293
265
|
name: 'Timestamp',
|
|
294
266
|
value: epoch?.timestamp?.toString() ??
|
|
295
|
-
(await this.arweave.
|
|
296
|
-
.getCurrent()
|
|
297
|
-
.then((block) => {
|
|
298
|
-
return { timestamp: block.timestamp * 1000 };
|
|
299
|
-
})
|
|
300
|
-
.catch(() => {
|
|
301
|
-
return { timestamp: Date.now() }; // fallback to current time
|
|
302
|
-
})).timestamp.toString(),
|
|
267
|
+
(await getCurrentBlockUnixTimestampMs(this.arweave)).toString(),
|
|
303
268
|
},
|
|
304
269
|
{
|
|
305
270
|
name: 'Epoch-Index',
|
package/lib/esm/types/index.js
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
export * from './ant-registry.js';
|
|
17
|
+
export * from './ant.js';
|
|
16
18
|
export * from './common.js';
|
|
17
|
-
export * from './token.js';
|
|
18
19
|
export * from './io.js';
|
|
20
|
+
export * from './token.js';
|
package/lib/esm/utils/arweave.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
1
|
import { ARWEAVE_TX_REGEX } from '../constants.js';
|
|
17
2
|
export const validateArweaveId = (id) => {
|
|
18
3
|
return ARWEAVE_TX_REGEX.test(id);
|
|
@@ -23,3 +8,13 @@ export function isBlockHeight(height) {
|
|
|
23
8
|
export const pruneTags = (tags) => {
|
|
24
9
|
return tags.filter((tag) => tag.value !== undefined);
|
|
25
10
|
};
|
|
11
|
+
export const getCurrentBlockUnixTimestampMs = async (arweave) => {
|
|
12
|
+
return await arweave.blocks
|
|
13
|
+
.getCurrent()
|
|
14
|
+
.then((block) => {
|
|
15
|
+
return block.timestamp * 1000;
|
|
16
|
+
})
|
|
17
|
+
.catch(() => {
|
|
18
|
+
return Date.now(); // fallback to current time
|
|
19
|
+
});
|
|
20
|
+
};
|
package/lib/esm/utils/index.js
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export * from './arweave.js';
|
|
17
|
-
export * from './http-client.js';
|
|
18
16
|
export * from './ao.js';
|
|
17
|
+
export * from './arweave.js';
|
|
18
|
+
export * from './base64.js';
|
|
19
19
|
export * from './json.js';
|
|
20
20
|
export * from './processes.js';
|
|
21
21
|
export * from './schema.js';
|
package/lib/esm/version.js
CHANGED
package/lib/types/common/io.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
17
|
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoAuction, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoTokenSupplyData, AoUpdateGatewaySettingsParams, AoWeightedObserver, ContractSigner, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types/index.js';
|
|
18
|
-
import { AoArNSNameData, AoAuctionPriceData, AoEpochData, AoEpochSettings, AoGateway,
|
|
18
|
+
import { AoArNSNameData, AoAuctionPriceData, AoEpochData, AoEpochSettings, AoGateway, AoGatewayDelegateWithAddress, AoIORead, AoIOWrite, AoRegistrationFees, EpochInput } from '../types/io.js';
|
|
19
19
|
import { mIOToken } from '../types/token.js';
|
|
20
20
|
import { AOProcess } from './contracts/ao-process.js';
|
|
21
21
|
export declare class IO {
|
|
@@ -68,8 +68,9 @@ export declare class IOReadable implements AoIORead {
|
|
|
68
68
|
address: WalletAddress;
|
|
69
69
|
}): Promise<AoGateway | undefined>;
|
|
70
70
|
getGatewayDelegates({ address, ...pageParams }: {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
[x: string]: any;
|
|
72
|
+
address: any;
|
|
73
|
+
}): Promise<PaginationResult<AoGatewayDelegateWithAddress>>;
|
|
73
74
|
getGatewayDelegateAllowList({ address, ...pageParams }: {
|
|
74
75
|
address: WalletAddress;
|
|
75
76
|
} & PaginationParams<WalletAddress>): Promise<PaginationResult<WalletAddress>>;
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
export * from './ant-registry.js';
|
|
17
|
+
export * from './ant.js';
|
|
16
18
|
export * from './common.js';
|
|
17
|
-
export * from './token.js';
|
|
18
19
|
export * from './io.js';
|
|
20
|
+
export * from './token.js';
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -188,6 +188,9 @@ export type AoGatewayDelegate = {
|
|
|
188
188
|
startTimestamp: Timestamp;
|
|
189
189
|
vaults: Record<WalletAddress, AoVaultData>;
|
|
190
190
|
};
|
|
191
|
+
export type AoGatewayDelegateWithAddress = AoGatewayDelegate & {
|
|
192
|
+
address: WalletAddress;
|
|
193
|
+
};
|
|
191
194
|
export type AoGatewaySettings = {
|
|
192
195
|
allowDelegatedStaking: boolean | 'allowlist';
|
|
193
196
|
delegateRewardShareRatio: number;
|
|
@@ -242,12 +245,10 @@ export interface AoIORead {
|
|
|
242
245
|
getGateway({ address, }: {
|
|
243
246
|
address: WalletAddress;
|
|
244
247
|
}): Promise<AoGateway | undefined>;
|
|
245
|
-
getGatewayDelegates(
|
|
246
|
-
address: WalletAddress;
|
|
247
|
-
} & PaginationParams<AoGatewayDelegate>): Promise<PaginationResult<AoGatewayDelegate>>;
|
|
248
|
-
getGatewayDelegateAllowList(params?: PaginationParams<WalletAddress> & {
|
|
248
|
+
getGatewayDelegates({ address, ...pageParams }: {
|
|
249
249
|
address: WalletAddress;
|
|
250
|
-
}): Promise<PaginationResult<
|
|
250
|
+
} & PaginationParams<AoGatewayDelegateWithAddress>): Promise<PaginationResult<AoGatewayDelegateWithAddress>>;
|
|
251
|
+
getGatewayDelegateAllowList(params?: PaginationParams<WalletAddress>): Promise<PaginationResult<WalletAddress>>;
|
|
251
252
|
getGateways(params?: PaginationParams<AoGatewayWithAddress>): Promise<PaginationResult<AoGatewayWithAddress>>;
|
|
252
253
|
getBalance(params: {
|
|
253
254
|
address: WalletAddress;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import Arweave from 'arweave';
|
|
17
|
+
import { BlockHeight, Timestamp } from '../types/common.js';
|
|
2
18
|
export declare const validateArweaveId: (id: string) => boolean;
|
|
3
19
|
export declare function isBlockHeight(height: string | number): height is BlockHeight;
|
|
4
20
|
export declare const pruneTags: (tags: {
|
|
@@ -8,3 +24,4 @@ export declare const pruneTags: (tags: {
|
|
|
8
24
|
name: string;
|
|
9
25
|
value: string;
|
|
10
26
|
}[];
|
|
27
|
+
export declare const getCurrentBlockUnixTimestampMs: (arweave: Arweave) => Promise<Timestamp>;
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export * from './arweave.js';
|
|
17
|
-
export * from './http-client.js';
|
|
18
16
|
export * from './ao.js';
|
|
17
|
+
export * from './arweave.js';
|
|
18
|
+
export * from './base64.js';
|
|
19
19
|
export * from './json.js';
|
|
20
20
|
export * from './processes.js';
|
|
21
21
|
export * from './schema.js';
|
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.4.0-alpha.
|
|
3
|
+
"version": "2.4.0-alpha.14",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
"husky": "^8.0.3",
|
|
110
110
|
"lint-staged": "^15.2.2",
|
|
111
111
|
"markdown-toc-gen": "^1.0.1",
|
|
112
|
+
"nock": "^13.5.5",
|
|
112
113
|
"prettier": "^3.0.2",
|
|
113
114
|
"rimraf": "^5.0.1",
|
|
114
115
|
"semantic-release": "^21.0.7",
|