@ar.io/sdk 3.3.0-alpha.6 → 3.3.0-alpha.7
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 +58 -56
- package/lib/cjs/common/ant-registry.js +14 -21
- package/lib/cjs/common/ant.js +5 -8
- package/lib/cjs/common/io.js +12 -33
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant-registry.js +14 -21
- package/lib/esm/common/ant.js +5 -8
- package/lib/esm/common/io.js +12 -33
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant-registry.d.ts +5 -4
- package/lib/types/common/ant.d.ts +9 -10
- package/lib/types/common/io.d.ts +8 -27
- package/lib/types/types/common.d.ts +4 -0
- package/lib/types/types/io.d.ts +14 -13
- package/lib/types/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -22,12 +22,8 @@ const ao_js_1 = require("../utils/ao.js");
|
|
|
22
22
|
const index_js_2 = require("./index.js");
|
|
23
23
|
class ANTRegistry {
|
|
24
24
|
static init(config) {
|
|
25
|
-
if (config && config
|
|
26
|
-
|
|
27
|
-
return new AoANTRegistryWriteable({
|
|
28
|
-
...rest,
|
|
29
|
-
signer,
|
|
30
|
-
});
|
|
25
|
+
if (config !== undefined && 'signer' in config) {
|
|
26
|
+
return new AoANTRegistryWriteable(config);
|
|
31
27
|
}
|
|
32
28
|
return new AoANTRegistryReadable(config);
|
|
33
29
|
}
|
|
@@ -36,25 +32,22 @@ exports.ANTRegistry = ANTRegistry;
|
|
|
36
32
|
class AoANTRegistryReadable {
|
|
37
33
|
process;
|
|
38
34
|
constructor(config) {
|
|
39
|
-
if (config
|
|
40
|
-
((0, index_js_1.isProcessIdConfiguration)(config) || (0, index_js_1.isProcessConfiguration)(config))) {
|
|
41
|
-
if ((0, index_js_1.isProcessConfiguration)(config)) {
|
|
42
|
-
this.process = config.process;
|
|
43
|
-
}
|
|
44
|
-
else if ((0, index_js_1.isProcessIdConfiguration)(config)) {
|
|
45
|
-
this.process = new index_js_2.AOProcess({
|
|
46
|
-
processId: config.processId,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
throw new index_js_2.InvalidContractConfigurationError();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
35
|
+
if (config === undefined || Object.keys(config).length === 0) {
|
|
54
36
|
this.process = new index_js_2.AOProcess({
|
|
55
37
|
processId: constants_js_1.ANT_REGISTRY_ID,
|
|
56
38
|
});
|
|
57
39
|
}
|
|
40
|
+
else if ((0, index_js_1.isProcessConfiguration)(config)) {
|
|
41
|
+
this.process = config.process;
|
|
42
|
+
}
|
|
43
|
+
else if ((0, index_js_1.isProcessIdConfiguration)(config)) {
|
|
44
|
+
this.process = new index_js_2.AOProcess({
|
|
45
|
+
processId: config.processId,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
throw new index_js_2.InvalidContractConfigurationError();
|
|
50
|
+
}
|
|
58
51
|
}
|
|
59
52
|
// Should we rename this to "getANTsByAddress"? seems more clear, though not same as handler name
|
|
60
53
|
async accessControlList({ address, }) {
|
package/lib/cjs/common/ant.js
CHANGED
|
@@ -23,15 +23,12 @@ const ao_js_1 = require("../utils/ao.js");
|
|
|
23
23
|
const schema_js_1 = require("../utils/schema.js");
|
|
24
24
|
const index_js_2 = require("./index.js");
|
|
25
25
|
class ANT {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
return new AoANTReadable({ strict, ...config });
|
|
31
|
-
}
|
|
32
|
-
return new AoANTWriteable({ signer, strict, ...config });
|
|
26
|
+
// implementation
|
|
27
|
+
static init(config) {
|
|
28
|
+
if (config !== undefined && 'signer' in config) {
|
|
29
|
+
return new AoANTWriteable(config);
|
|
33
30
|
}
|
|
34
|
-
|
|
31
|
+
return new AoANTReadable(config);
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
34
|
exports.ANT = ANT;
|
package/lib/cjs/common/io.js
CHANGED
|
@@ -9,19 +9,12 @@ const arweave_js_2 = require("./arweave.js");
|
|
|
9
9
|
const ao_process_js_1 = require("./contracts/ao-process.js");
|
|
10
10
|
const error_js_1 = require("./error.js");
|
|
11
11
|
class ARIO {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return new ARIOWriteable(
|
|
16
|
-
...rest,
|
|
17
|
-
signer,
|
|
18
|
-
arweave,
|
|
19
|
-
});
|
|
12
|
+
// Implementation
|
|
13
|
+
static init(config) {
|
|
14
|
+
if (config !== undefined && 'signer' in config) {
|
|
15
|
+
return new ARIOWriteable(config);
|
|
20
16
|
}
|
|
21
|
-
return new ARIOReadable(
|
|
22
|
-
arweave,
|
|
23
|
-
...config,
|
|
24
|
-
});
|
|
17
|
+
return new ARIOReadable(config);
|
|
25
18
|
}
|
|
26
19
|
}
|
|
27
20
|
exports.ARIO = ARIO;
|
|
@@ -29,8 +22,9 @@ class ARIOReadable {
|
|
|
29
22
|
process;
|
|
30
23
|
epochSettings;
|
|
31
24
|
arweave;
|
|
32
|
-
constructor(
|
|
33
|
-
|
|
25
|
+
constructor(config) {
|
|
26
|
+
this.arweave = config?.arweave ?? arweave_js_2.defaultArweave;
|
|
27
|
+
if (config === undefined || Object.keys(config).length === 0) {
|
|
34
28
|
this.process = new ao_process_js_1.AOProcess({
|
|
35
29
|
processId: constants_js_1.ARIO_TESTNET_PROCESS_ID,
|
|
36
30
|
});
|
|
@@ -46,7 +40,6 @@ class ARIOReadable {
|
|
|
46
40
|
else {
|
|
47
41
|
throw new error_js_1.InvalidContractConfigurationError();
|
|
48
42
|
}
|
|
49
|
-
this.arweave = arweave;
|
|
50
43
|
}
|
|
51
44
|
async getInfo() {
|
|
52
45
|
return this.process.read({
|
|
@@ -460,32 +453,18 @@ class ARIOReadable {
|
|
|
460
453
|
exports.ARIOReadable = ARIOReadable;
|
|
461
454
|
class ARIOWriteable extends ARIOReadable {
|
|
462
455
|
signer;
|
|
463
|
-
constructor({ signer,
|
|
464
|
-
if (
|
|
456
|
+
constructor({ signer, ...config }) {
|
|
457
|
+
if (config === undefined) {
|
|
465
458
|
super({
|
|
466
459
|
process: new ao_process_js_1.AOProcess({
|
|
467
460
|
processId: constants_js_1.ARIO_TESTNET_PROCESS_ID,
|
|
468
461
|
}),
|
|
469
|
-
arweave: arweave,
|
|
470
462
|
});
|
|
471
|
-
this.signer = (0, ao_js_1.createAoSigner)(signer);
|
|
472
|
-
}
|
|
473
|
-
else if ((0, io_js_1.isProcessConfiguration)(config)) {
|
|
474
|
-
super({ process: config.process });
|
|
475
|
-
this.signer = (0, ao_js_1.createAoSigner)(signer);
|
|
476
|
-
}
|
|
477
|
-
else if ((0, io_js_1.isProcessIdConfiguration)(config)) {
|
|
478
|
-
super({
|
|
479
|
-
process: new ao_process_js_1.AOProcess({
|
|
480
|
-
processId: config.processId,
|
|
481
|
-
}),
|
|
482
|
-
arweave: arweave,
|
|
483
|
-
});
|
|
484
|
-
this.signer = (0, ao_js_1.createAoSigner)(signer);
|
|
485
463
|
}
|
|
486
464
|
else {
|
|
487
|
-
|
|
465
|
+
super(config);
|
|
488
466
|
}
|
|
467
|
+
this.signer = (0, ao_js_1.createAoSigner)(signer);
|
|
489
468
|
}
|
|
490
469
|
async transfer({ target, qty, }, options) {
|
|
491
470
|
const { tags = [] } = options || {};
|
package/lib/cjs/version.js
CHANGED
|
@@ -19,12 +19,8 @@ import { createAoSigner } from '../utils/ao.js';
|
|
|
19
19
|
import { AOProcess, InvalidContractConfigurationError } from './index.js';
|
|
20
20
|
export class ANTRegistry {
|
|
21
21
|
static init(config) {
|
|
22
|
-
if (config && config
|
|
23
|
-
|
|
24
|
-
return new AoANTRegistryWriteable({
|
|
25
|
-
...rest,
|
|
26
|
-
signer,
|
|
27
|
-
});
|
|
22
|
+
if (config !== undefined && 'signer' in config) {
|
|
23
|
+
return new AoANTRegistryWriteable(config);
|
|
28
24
|
}
|
|
29
25
|
return new AoANTRegistryReadable(config);
|
|
30
26
|
}
|
|
@@ -32,25 +28,22 @@ export class ANTRegistry {
|
|
|
32
28
|
export class AoANTRegistryReadable {
|
|
33
29
|
process;
|
|
34
30
|
constructor(config) {
|
|
35
|
-
if (config
|
|
36
|
-
(isProcessIdConfiguration(config) || isProcessConfiguration(config))) {
|
|
37
|
-
if (isProcessConfiguration(config)) {
|
|
38
|
-
this.process = config.process;
|
|
39
|
-
}
|
|
40
|
-
else if (isProcessIdConfiguration(config)) {
|
|
41
|
-
this.process = new AOProcess({
|
|
42
|
-
processId: config.processId,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
throw new InvalidContractConfigurationError();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
31
|
+
if (config === undefined || Object.keys(config).length === 0) {
|
|
50
32
|
this.process = new AOProcess({
|
|
51
33
|
processId: ANT_REGISTRY_ID,
|
|
52
34
|
});
|
|
53
35
|
}
|
|
36
|
+
else if (isProcessConfiguration(config)) {
|
|
37
|
+
this.process = config.process;
|
|
38
|
+
}
|
|
39
|
+
else if (isProcessIdConfiguration(config)) {
|
|
40
|
+
this.process = new AOProcess({
|
|
41
|
+
processId: config.processId,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
throw new InvalidContractConfigurationError();
|
|
46
|
+
}
|
|
54
47
|
}
|
|
55
48
|
// Should we rename this to "getANTsByAddress"? seems more clear, though not same as handler name
|
|
56
49
|
async accessControlList({ address, }) {
|
package/lib/esm/common/ant.js
CHANGED
|
@@ -20,15 +20,12 @@ import { createAoSigner } from '../utils/ao.js';
|
|
|
20
20
|
import { parseSchemaResult } from '../utils/schema.js';
|
|
21
21
|
import { AOProcess, InvalidContractConfigurationError } from './index.js';
|
|
22
22
|
export class ANT {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
return new AoANTReadable({ strict, ...config });
|
|
28
|
-
}
|
|
29
|
-
return new AoANTWriteable({ signer, strict, ...config });
|
|
23
|
+
// implementation
|
|
24
|
+
static init(config) {
|
|
25
|
+
if (config !== undefined && 'signer' in config) {
|
|
26
|
+
return new AoANTWriteable(config);
|
|
30
27
|
}
|
|
31
|
-
|
|
28
|
+
return new AoANTReadable(config);
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
export class AoANTReadable {
|
package/lib/esm/common/io.js
CHANGED
|
@@ -6,27 +6,21 @@ import { defaultArweave } from './arweave.js';
|
|
|
6
6
|
import { AOProcess } from './contracts/ao-process.js';
|
|
7
7
|
import { InvalidContractConfigurationError } from './error.js';
|
|
8
8
|
export class ARIO {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return new ARIOWriteable(
|
|
13
|
-
...rest,
|
|
14
|
-
signer,
|
|
15
|
-
arweave,
|
|
16
|
-
});
|
|
9
|
+
// Implementation
|
|
10
|
+
static init(config) {
|
|
11
|
+
if (config !== undefined && 'signer' in config) {
|
|
12
|
+
return new ARIOWriteable(config);
|
|
17
13
|
}
|
|
18
|
-
return new ARIOReadable(
|
|
19
|
-
arweave,
|
|
20
|
-
...config,
|
|
21
|
-
});
|
|
14
|
+
return new ARIOReadable(config);
|
|
22
15
|
}
|
|
23
16
|
}
|
|
24
17
|
export class ARIOReadable {
|
|
25
18
|
process;
|
|
26
19
|
epochSettings;
|
|
27
20
|
arweave;
|
|
28
|
-
constructor(
|
|
29
|
-
|
|
21
|
+
constructor(config) {
|
|
22
|
+
this.arweave = config?.arweave ?? defaultArweave;
|
|
23
|
+
if (config === undefined || Object.keys(config).length === 0) {
|
|
30
24
|
this.process = new AOProcess({
|
|
31
25
|
processId: ARIO_TESTNET_PROCESS_ID,
|
|
32
26
|
});
|
|
@@ -42,7 +36,6 @@ export class ARIOReadable {
|
|
|
42
36
|
else {
|
|
43
37
|
throw new InvalidContractConfigurationError();
|
|
44
38
|
}
|
|
45
|
-
this.arweave = arweave;
|
|
46
39
|
}
|
|
47
40
|
async getInfo() {
|
|
48
41
|
return this.process.read({
|
|
@@ -455,32 +448,18 @@ export class ARIOReadable {
|
|
|
455
448
|
}
|
|
456
449
|
export class ARIOWriteable extends ARIOReadable {
|
|
457
450
|
signer;
|
|
458
|
-
constructor({ signer,
|
|
459
|
-
if (
|
|
451
|
+
constructor({ signer, ...config }) {
|
|
452
|
+
if (config === undefined) {
|
|
460
453
|
super({
|
|
461
454
|
process: new AOProcess({
|
|
462
455
|
processId: ARIO_TESTNET_PROCESS_ID,
|
|
463
456
|
}),
|
|
464
|
-
arweave: arweave,
|
|
465
457
|
});
|
|
466
|
-
this.signer = createAoSigner(signer);
|
|
467
|
-
}
|
|
468
|
-
else if (isProcessConfiguration(config)) {
|
|
469
|
-
super({ process: config.process });
|
|
470
|
-
this.signer = createAoSigner(signer);
|
|
471
|
-
}
|
|
472
|
-
else if (isProcessIdConfiguration(config)) {
|
|
473
|
-
super({
|
|
474
|
-
process: new AOProcess({
|
|
475
|
-
processId: config.processId,
|
|
476
|
-
}),
|
|
477
|
-
arweave: arweave,
|
|
478
|
-
});
|
|
479
|
-
this.signer = createAoSigner(signer);
|
|
480
458
|
}
|
|
481
459
|
else {
|
|
482
|
-
|
|
460
|
+
super(config);
|
|
483
461
|
}
|
|
462
|
+
this.signer = createAoSigner(signer);
|
|
484
463
|
}
|
|
485
464
|
async transfer({ target, qty, }, options) {
|
|
486
465
|
const { tags = [] } = options || {};
|
package/lib/esm/version.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AoANTRegistryRead, AoANTRegistryWrite } from '../types/ant-registry.js';
|
|
2
2
|
import { AoMessageResult, ProcessConfiguration, WithSigner } from '../types/index.js';
|
|
3
3
|
import { AOProcess } from './index.js';
|
|
4
|
+
type ANTRegistryNoSigner = ProcessConfiguration;
|
|
5
|
+
type ANTRegistryWithSigner = WithSigner<ProcessConfiguration>;
|
|
4
6
|
export declare class ANTRegistry {
|
|
5
7
|
static init(): AoANTRegistryRead;
|
|
6
|
-
static init(config:
|
|
7
|
-
|
|
8
|
-
}): AoANTRegistryRead;
|
|
9
|
-
static init({ signer, ...config }: WithSigner<Required<ProcessConfiguration>>): AoANTRegistryWrite;
|
|
8
|
+
static init(config: ANTRegistryNoSigner): AoANTRegistryRead;
|
|
9
|
+
static init(config: ANTRegistryWithSigner): AoANTRegistryWrite;
|
|
10
10
|
}
|
|
11
11
|
export declare class AoANTRegistryReadable implements AoANTRegistryRead {
|
|
12
12
|
protected process: AOProcess;
|
|
@@ -25,3 +25,4 @@ export declare class AoANTRegistryWriteable extends AoANTRegistryReadable implem
|
|
|
25
25
|
processId: string;
|
|
26
26
|
}): Promise<AoMessageResult>;
|
|
27
27
|
}
|
|
28
|
+
export {};
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { AntReadOptions, AoANTHandler, AoANTInfo, AoANTRead, AoANTRecord, AoANTState, AoANTWrite } from '../types/ant.js';
|
|
2
2
|
import { AoMessageResult, ProcessConfiguration, WalletAddress, WithSigner, WriteOptions } from '../types/index.js';
|
|
3
3
|
import { AOProcess } from './index.js';
|
|
4
|
+
type ANTConfigOptionalStrict = Required<ProcessConfiguration> & {
|
|
5
|
+
strict?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type ANTConfigNoSigner = ANTConfigOptionalStrict;
|
|
8
|
+
type ANTConfigWithSigner = WithSigner<ANTConfigOptionalStrict>;
|
|
4
9
|
export declare class ANT {
|
|
5
|
-
static init(config:
|
|
6
|
-
|
|
7
|
-
strict?: boolean;
|
|
8
|
-
}): AoANTRead;
|
|
9
|
-
static init({ signer, ...config }: WithSigner<Required<ProcessConfiguration>> & {
|
|
10
|
-
strict?: boolean;
|
|
11
|
-
}): AoANTWrite;
|
|
10
|
+
static init(config: ANTConfigNoSigner): AoANTRead;
|
|
11
|
+
static init(config: ANTConfigWithSigner): AoANTWrite;
|
|
12
12
|
}
|
|
13
13
|
export declare class AoANTReadable implements AoANTRead {
|
|
14
14
|
protected process: AOProcess;
|
|
15
15
|
private strict;
|
|
16
|
-
constructor(config:
|
|
17
|
-
strict?: boolean;
|
|
18
|
-
});
|
|
16
|
+
constructor(config: ANTConfigOptionalStrict);
|
|
19
17
|
getState({ strict }?: AntReadOptions): Promise<AoANTState>;
|
|
20
18
|
getInfo({ strict }?: AntReadOptions): Promise<AoANTInfo>;
|
|
21
19
|
/**
|
|
@@ -273,3 +271,4 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
273
271
|
notifyOwners?: boolean;
|
|
274
272
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
275
273
|
}
|
|
274
|
+
export {};
|
package/lib/types/common/io.d.ts
CHANGED
|
@@ -14,36 +14,22 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
|
-
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AoRedelegationFeeInfo, AoReturnedName, AoTokenSupplyData, AoUpdateGatewaySettingsParams, AoWeightedObserver,
|
|
17
|
+
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AoRedelegationFeeInfo, AoReturnedName, AoTokenSupplyData, AoUpdateGatewaySettingsParams, AoWeightedObserver, OptionalArweave, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types/index.js';
|
|
18
18
|
import { AoARIORead, AoARIOWrite, AoAllDelegates, AoArNSNameData, AoArNSPurchaseParams, AoArNSReservedNameDataWithName, AoBuyRecordParams, AoDelegation, AoEpochData, AoEpochSettings, AoExtendLeaseParams, AoGateway, AoGatewayDelegateWithAddress, AoGatewayRegistrySettings, AoGatewayVault, AoGetCostDetailsParams, AoIncreaseUndernameLimitParams, AoPaginatedAddressParams, AoRegistrationFees, AoVaultData, AoWalletVault, CostDetailsResult, DemandFactorSettings, EpochInput } from '../types/io.js';
|
|
19
19
|
import { mARIOToken } from '../types/token.js';
|
|
20
20
|
import { AOProcess } from './contracts/ao-process.js';
|
|
21
|
+
type ARIOConfigNoSigner = OptionalArweave<ProcessConfiguration>;
|
|
22
|
+
type ARIOConfigWithSigner = WithSigner<OptionalArweave<ProcessConfiguration>>;
|
|
21
23
|
export declare class ARIO {
|
|
22
24
|
static init(): AoARIORead;
|
|
23
|
-
static init(
|
|
24
|
-
|
|
25
|
-
}): AoARIORead;
|
|
26
|
-
static init({ process, signer, }: WithSigner<{
|
|
27
|
-
process: AOProcess;
|
|
28
|
-
}>): AoARIOWrite;
|
|
29
|
-
static init({ processId, signer, }: WithSigner<{
|
|
30
|
-
processId?: string;
|
|
31
|
-
}>): AoARIOWrite;
|
|
32
|
-
static init({ processId, signer, }: {
|
|
33
|
-
signer?: ContractSigner | undefined;
|
|
34
|
-
processId: string;
|
|
35
|
-
}): any;
|
|
36
|
-
static init({ processId }: {
|
|
37
|
-
processId: string;
|
|
38
|
-
}): AoARIORead;
|
|
25
|
+
static init(config: ARIOConfigWithSigner): AoARIOWrite;
|
|
26
|
+
static init(config: ARIOConfigNoSigner): AoARIORead;
|
|
39
27
|
}
|
|
40
28
|
export declare class ARIOReadable implements AoARIORead {
|
|
41
29
|
protected process: AOProcess;
|
|
42
30
|
protected epochSettings: AoEpochSettings | undefined;
|
|
43
31
|
protected arweave: Arweave;
|
|
44
|
-
constructor(
|
|
45
|
-
arweave?: Arweave;
|
|
46
|
-
});
|
|
32
|
+
constructor(config?: OptionalArweave<ProcessConfiguration>);
|
|
47
33
|
getInfo(): Promise<{
|
|
48
34
|
Name: string;
|
|
49
35
|
Ticker: string;
|
|
@@ -155,13 +141,7 @@ export declare class ARIOReadable implements AoARIORead {
|
|
|
155
141
|
export declare class ARIOWriteable extends ARIOReadable implements AoARIOWrite {
|
|
156
142
|
protected process: AOProcess;
|
|
157
143
|
private signer;
|
|
158
|
-
constructor({ signer,
|
|
159
|
-
process?: AOProcess;
|
|
160
|
-
} | {
|
|
161
|
-
processId?: string;
|
|
162
|
-
}> & {
|
|
163
|
-
arweave?: Arweave;
|
|
164
|
-
});
|
|
144
|
+
constructor({ signer, ...config }: ARIOConfigWithSigner);
|
|
165
145
|
transfer({ target, qty, }: {
|
|
166
146
|
target: string;
|
|
167
147
|
qty: number | mARIOToken;
|
|
@@ -254,3 +234,4 @@ export declare class ARIOWriteable extends ARIOReadable implements AoARIOWrite {
|
|
|
254
234
|
vaultId?: string;
|
|
255
235
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
256
236
|
}
|
|
237
|
+
export {};
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { Signer } from '@dha-team/arbundles';
|
|
18
18
|
import { dryrun, message, monitor, result, results, spawn, unmonitor } from '@permaweb/aoconnect';
|
|
19
|
+
import Arweave from 'arweave';
|
|
19
20
|
import { AoSigner } from './token.js';
|
|
20
21
|
export type BlockHeight = number;
|
|
21
22
|
export type SortKey = string;
|
|
@@ -23,6 +24,9 @@ export type Timestamp = number;
|
|
|
23
24
|
export type WalletAddress = string;
|
|
24
25
|
export type TransactionId = string;
|
|
25
26
|
export type ProcessId = string;
|
|
27
|
+
export type OptionalArweave<T = NonNullable<unknown>> = {
|
|
28
|
+
arweave?: Arweave;
|
|
29
|
+
} & T;
|
|
26
30
|
export type ContractSigner = Signer | Window['arweaveWallet'] | AoSigner;
|
|
27
31
|
export type WithSigner<T = NonNullable<unknown>> = {
|
|
28
32
|
signer: ContractSigner;
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -31,16 +31,20 @@ export type PaginationResult<T> = {
|
|
|
31
31
|
sortOrder: 'asc' | 'desc';
|
|
32
32
|
hasMore: boolean;
|
|
33
33
|
};
|
|
34
|
-
export type
|
|
35
|
-
process?: AOProcess;
|
|
36
|
-
} | {
|
|
34
|
+
export type ProcessIdConfig = {
|
|
37
35
|
processId?: string;
|
|
38
36
|
};
|
|
39
|
-
export type
|
|
40
|
-
|
|
41
|
-
}
|
|
37
|
+
export type ProcessConfig = {
|
|
38
|
+
process?: AOProcess;
|
|
39
|
+
};
|
|
40
|
+
export type ProcessConfiguration = ProcessConfig | ProcessIdConfig;
|
|
41
|
+
export type EpochTimestampInput = {
|
|
42
42
|
timestamp: Timestamp;
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
|
+
export type EpochIndexInput = {
|
|
45
|
+
epochIndex: AoEpochIndex;
|
|
46
|
+
};
|
|
47
|
+
export type EpochInput = EpochTimestampInput | EpochIndexInput | undefined;
|
|
44
48
|
export type AoBalances = Record<WalletAddress, number>;
|
|
45
49
|
export type AoRegistrationFees = Record<number, {
|
|
46
50
|
lease: Record<number, number>;
|
|
@@ -117,6 +121,7 @@ export type AoEpochData = {
|
|
|
117
121
|
startTimestamp: Timestamp;
|
|
118
122
|
endTimestamp: Timestamp;
|
|
119
123
|
distributionTimestamp: Timestamp;
|
|
124
|
+
/** @deprecated - use `getDistributions` to get distribution data for a given epoch **/
|
|
120
125
|
distributions: AoEpochDistributionData;
|
|
121
126
|
};
|
|
122
127
|
export type AoTokenSupplyData = {
|
|
@@ -465,10 +470,6 @@ export interface AoARIOWrite extends AoARIORead {
|
|
|
465
470
|
requestPrimaryName(params: AoArNSPurchaseParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
466
471
|
redelegateStake(params: AoRedelegateStakeParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
467
472
|
}
|
|
468
|
-
export declare function isProcessConfiguration(config: object): config is
|
|
469
|
-
|
|
470
|
-
};
|
|
471
|
-
export declare function isProcessIdConfiguration(config: object): config is {
|
|
472
|
-
processId: string;
|
|
473
|
-
};
|
|
473
|
+
export declare function isProcessConfiguration(config: object): config is Required<ProcessConfiguration> & Record<string, never>;
|
|
474
|
+
export declare function isProcessIdConfiguration(config: object): config is Required<ProcessIdConfig> & Record<string, never>;
|
|
474
475
|
export declare function isLeasedArNSRecord(record: AoArNSNameData): record is AoArNSLeaseData;
|
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": "3.3.0-alpha.
|
|
3
|
+
"version": "3.3.0-alpha.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"dependencies": {
|
|
127
127
|
"@dha-team/arbundles": "^1.0.1",
|
|
128
128
|
"@permaweb/aoconnect": "^0.0.57",
|
|
129
|
-
"arweave": "1.
|
|
129
|
+
"arweave": "1.15.5",
|
|
130
130
|
"axios": "1.7.9",
|
|
131
131
|
"axios-retry": "^4.3.0",
|
|
132
132
|
"commander": "^12.1.0",
|