@ar.io/sdk 3.2.0-alpha.1 → 3.2.0-alpha.3
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 +14 -7
- package/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/ant.js +9 -1
- package/lib/cjs/common/io.js +4 -4
- package/lib/cjs/types/io.js +7 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +9 -1
- package/lib/esm/common/io.js +4 -4
- package/lib/esm/types/io.js +7 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/utils.d.ts +1 -1
- package/lib/types/common/ant.d.ts +6 -1
- package/lib/types/types/ant.d.ts +3 -1
- package/lib/types/types/io.d.ts +3 -3
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/common/ant.js
CHANGED
|
@@ -74,6 +74,13 @@ class AoANTReadable {
|
|
|
74
74
|
}
|
|
75
75
|
return info;
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns the TX ID of the logo set for the ANT.
|
|
79
|
+
*/
|
|
80
|
+
async getLogo() {
|
|
81
|
+
const info = await this.getInfo();
|
|
82
|
+
return info.Logo;
|
|
83
|
+
}
|
|
77
84
|
/**
|
|
78
85
|
* @param undername @type {string} The domain name.
|
|
79
86
|
* @returns {Promise<ANTRecord>} The record of the undername domain.
|
|
@@ -472,7 +479,7 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
472
479
|
signer: this.signer,
|
|
473
480
|
});
|
|
474
481
|
}
|
|
475
|
-
async removePrimaryNames({ names, arioProcessId }, options) {
|
|
482
|
+
async removePrimaryNames({ names, arioProcessId, notifyOwners = false, }, options) {
|
|
476
483
|
return this.process.send({
|
|
477
484
|
tags: [
|
|
478
485
|
...(options?.tags ?? []),
|
|
@@ -480,6 +487,7 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
480
487
|
{ name: 'Names', value: names.join(',') },
|
|
481
488
|
{ name: 'IO-Process-Id', value: arioProcessId },
|
|
482
489
|
{ name: 'ARIO-Process-Id', value: arioProcessId },
|
|
490
|
+
{ name: 'Notify-Owners', value: notifyOwners.toString() },
|
|
483
491
|
],
|
|
484
492
|
signer: this.signer,
|
|
485
493
|
});
|
package/lib/cjs/common/io.js
CHANGED
|
@@ -269,7 +269,7 @@ class ARIOReadable {
|
|
|
269
269
|
// TODO: Can overload this function to refine different types of cost details params
|
|
270
270
|
async getCostDetails({ intent, type, years, name, quantity, fromAddress, fundFrom, }) {
|
|
271
271
|
const allTags = [
|
|
272
|
-
{ name: 'Action', value: '
|
|
272
|
+
{ name: 'Action', value: 'Cost-Details' },
|
|
273
273
|
{
|
|
274
274
|
name: 'Intent',
|
|
275
275
|
value: intent,
|
|
@@ -302,7 +302,7 @@ class ARIOReadable {
|
|
|
302
302
|
}
|
|
303
303
|
async getRegistrationFees() {
|
|
304
304
|
return this.process.read({
|
|
305
|
-
tags: [{ name: 'Action', value: '
|
|
305
|
+
tags: [{ name: 'Action', value: 'Registration-Fees' }],
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
async getDemandFactor() {
|
|
@@ -658,7 +658,7 @@ class ARIOWriteable extends ARIOReadable {
|
|
|
658
658
|
const { tags = [] } = options || {};
|
|
659
659
|
const allTags = [
|
|
660
660
|
...tags,
|
|
661
|
-
{ name: 'Action', value: 'Buy-
|
|
661
|
+
{ name: 'Action', value: 'Buy-Name' },
|
|
662
662
|
{ name: 'Name', value: params.name },
|
|
663
663
|
{ name: 'Years', value: params.years?.toString() ?? '1' },
|
|
664
664
|
{ name: 'Process-Id', value: params.processId },
|
|
@@ -682,7 +682,7 @@ class ARIOWriteable extends ARIOReadable {
|
|
|
682
682
|
const { tags = [] } = options || {};
|
|
683
683
|
const allTags = [
|
|
684
684
|
...tags,
|
|
685
|
-
{ name: 'Action', value: 'Upgrade-Name' },
|
|
685
|
+
{ name: 'Action', value: 'Upgrade-Name' },
|
|
686
686
|
{ name: 'Name', value: params.name },
|
|
687
687
|
{ name: 'Fund-From', value: params.fundFrom },
|
|
688
688
|
];
|
package/lib/cjs/types/io.js
CHANGED
|
@@ -3,13 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isLeasedArNSRecord = exports.isProcessIdConfiguration = exports.isProcessConfiguration = exports.isValidFundFrom = exports.fundFromOptions = exports.isValidIntent = exports.intentsUsingYears = exports.validIntents = void 0;
|
|
4
4
|
const arweave_js_1 = require("../utils/arweave.js");
|
|
5
5
|
exports.validIntents = [
|
|
6
|
-
'Buy-
|
|
6
|
+
'Buy-Name',
|
|
7
|
+
'Buy-Record', // for backwards compatibility
|
|
7
8
|
'Extend-Lease',
|
|
8
9
|
'Increase-Undername-Limit',
|
|
9
10
|
'Upgrade-Name',
|
|
10
11
|
'Primary-Name-Request',
|
|
11
12
|
];
|
|
12
|
-
exports.intentsUsingYears = [
|
|
13
|
+
exports.intentsUsingYears = [
|
|
14
|
+
'Buy-Record', // for backwards compatibility
|
|
15
|
+
'Buy-Name',
|
|
16
|
+
'Extend-Lease',
|
|
17
|
+
];
|
|
13
18
|
const isValidIntent = (intent) => {
|
|
14
19
|
return exports.validIntents.indexOf(intent) !== -1;
|
|
15
20
|
};
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/ant.js
CHANGED
|
@@ -70,6 +70,13 @@ export class AoANTReadable {
|
|
|
70
70
|
}
|
|
71
71
|
return info;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the TX ID of the logo set for the ANT.
|
|
75
|
+
*/
|
|
76
|
+
async getLogo() {
|
|
77
|
+
const info = await this.getInfo();
|
|
78
|
+
return info.Logo;
|
|
79
|
+
}
|
|
73
80
|
/**
|
|
74
81
|
* @param undername @type {string} The domain name.
|
|
75
82
|
* @returns {Promise<ANTRecord>} The record of the undername domain.
|
|
@@ -467,7 +474,7 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
467
474
|
signer: this.signer,
|
|
468
475
|
});
|
|
469
476
|
}
|
|
470
|
-
async removePrimaryNames({ names, arioProcessId }, options) {
|
|
477
|
+
async removePrimaryNames({ names, arioProcessId, notifyOwners = false, }, options) {
|
|
471
478
|
return this.process.send({
|
|
472
479
|
tags: [
|
|
473
480
|
...(options?.tags ?? []),
|
|
@@ -475,6 +482,7 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
475
482
|
{ name: 'Names', value: names.join(',') },
|
|
476
483
|
{ name: 'IO-Process-Id', value: arioProcessId },
|
|
477
484
|
{ name: 'ARIO-Process-Id', value: arioProcessId },
|
|
485
|
+
{ name: 'Notify-Owners', value: notifyOwners.toString() },
|
|
478
486
|
],
|
|
479
487
|
signer: this.signer,
|
|
480
488
|
});
|
package/lib/esm/common/io.js
CHANGED
|
@@ -265,7 +265,7 @@ export class ARIOReadable {
|
|
|
265
265
|
// TODO: Can overload this function to refine different types of cost details params
|
|
266
266
|
async getCostDetails({ intent, type, years, name, quantity, fromAddress, fundFrom, }) {
|
|
267
267
|
const allTags = [
|
|
268
|
-
{ name: 'Action', value: '
|
|
268
|
+
{ name: 'Action', value: 'Cost-Details' },
|
|
269
269
|
{
|
|
270
270
|
name: 'Intent',
|
|
271
271
|
value: intent,
|
|
@@ -298,7 +298,7 @@ export class ARIOReadable {
|
|
|
298
298
|
}
|
|
299
299
|
async getRegistrationFees() {
|
|
300
300
|
return this.process.read({
|
|
301
|
-
tags: [{ name: 'Action', value: '
|
|
301
|
+
tags: [{ name: 'Action', value: 'Registration-Fees' }],
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
async getDemandFactor() {
|
|
@@ -653,7 +653,7 @@ export class ARIOWriteable extends ARIOReadable {
|
|
|
653
653
|
const { tags = [] } = options || {};
|
|
654
654
|
const allTags = [
|
|
655
655
|
...tags,
|
|
656
|
-
{ name: 'Action', value: 'Buy-
|
|
656
|
+
{ name: 'Action', value: 'Buy-Name' },
|
|
657
657
|
{ name: 'Name', value: params.name },
|
|
658
658
|
{ name: 'Years', value: params.years?.toString() ?? '1' },
|
|
659
659
|
{ name: 'Process-Id', value: params.processId },
|
|
@@ -677,7 +677,7 @@ export class ARIOWriteable extends ARIOReadable {
|
|
|
677
677
|
const { tags = [] } = options || {};
|
|
678
678
|
const allTags = [
|
|
679
679
|
...tags,
|
|
680
|
-
{ name: 'Action', value: 'Upgrade-Name' },
|
|
680
|
+
{ name: 'Action', value: 'Upgrade-Name' },
|
|
681
681
|
{ name: 'Name', value: params.name },
|
|
682
682
|
{ name: 'Fund-From', value: params.fundFrom },
|
|
683
683
|
];
|
package/lib/esm/types/io.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { validateArweaveId } from '../utils/arweave.js';
|
|
2
2
|
export const validIntents = [
|
|
3
|
-
'Buy-
|
|
3
|
+
'Buy-Name',
|
|
4
|
+
'Buy-Record', // for backwards compatibility
|
|
4
5
|
'Extend-Lease',
|
|
5
6
|
'Increase-Undername-Limit',
|
|
6
7
|
'Upgrade-Name',
|
|
7
8
|
'Primary-Name-Request',
|
|
8
9
|
];
|
|
9
|
-
export const intentsUsingYears = [
|
|
10
|
+
export const intentsUsingYears = [
|
|
11
|
+
'Buy-Record', // for backwards compatibility
|
|
12
|
+
'Buy-Name',
|
|
13
|
+
'Extend-Lease',
|
|
14
|
+
];
|
|
10
15
|
export const isValidIntent = (intent) => {
|
|
11
16
|
return validIntents.indexOf(intent) !== -1;
|
|
12
17
|
};
|
package/lib/esm/version.js
CHANGED
package/lib/types/cli/utils.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export declare function getTokenCostParamsFromOptions(o: GetTokenCostCLIOptions)
|
|
|
79
79
|
type: "lease" | "permabuy";
|
|
80
80
|
quantity: number | undefined;
|
|
81
81
|
years: number;
|
|
82
|
-
intent: "Buy-Record" | "Extend-Lease" | "Increase-Undername-Limit" | "Upgrade-Name" | "Primary-Name-Request";
|
|
82
|
+
intent: "Buy-Name" | "Buy-Record" | "Extend-Lease" | "Increase-Undername-Limit" | "Upgrade-Name" | "Primary-Name-Request";
|
|
83
83
|
name: string;
|
|
84
84
|
fromAddress: string | undefined;
|
|
85
85
|
};
|
|
@@ -18,6 +18,10 @@ export declare class AoANTReadable implements AoANTRead {
|
|
|
18
18
|
});
|
|
19
19
|
getState({ strict }?: AntReadOptions): Promise<AoANTState>;
|
|
20
20
|
getInfo({ strict }?: AntReadOptions): Promise<AoANTInfo>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the TX ID of the logo set for the ANT.
|
|
23
|
+
*/
|
|
24
|
+
getLogo(): Promise<string>;
|
|
21
25
|
/**
|
|
22
26
|
* @param undername @type {string} The domain name.
|
|
23
27
|
* @returns {Promise<ANTRecord>} The record of the undername domain.
|
|
@@ -263,8 +267,9 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
263
267
|
address: WalletAddress;
|
|
264
268
|
arioProcessId: string;
|
|
265
269
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
266
|
-
removePrimaryNames({ names, arioProcessId }: {
|
|
270
|
+
removePrimaryNames({ names, arioProcessId, notifyOwners, }: {
|
|
267
271
|
names: string[];
|
|
268
272
|
arioProcessId: string;
|
|
273
|
+
notifyOwners?: boolean;
|
|
269
274
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
270
275
|
}
|
package/lib/types/types/ant.d.ts
CHANGED
|
@@ -170,6 +170,7 @@ export interface AoANTRead {
|
|
|
170
170
|
getOwner(opts?: AntReadOptions): Promise<WalletAddress>;
|
|
171
171
|
getControllers(): Promise<WalletAddress[]>;
|
|
172
172
|
getTicker(opts?: AntReadOptions): Promise<string>;
|
|
173
|
+
getLogo(opts?: AntReadOptions): Promise<string>;
|
|
173
174
|
getName(opts?: AntReadOptions): Promise<string>;
|
|
174
175
|
getBalance({ address }: {
|
|
175
176
|
address: WalletAddress;
|
|
@@ -224,8 +225,9 @@ export interface AoANTWrite extends AoANTRead {
|
|
|
224
225
|
address: WalletAddress;
|
|
225
226
|
arioProcessId: string;
|
|
226
227
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
227
|
-
removePrimaryNames({ names, arioProcessId }: {
|
|
228
|
+
removePrimaryNames({ names, arioProcessId, notifyOwners, }: {
|
|
228
229
|
names: string[];
|
|
229
230
|
arioProcessId: string;
|
|
231
|
+
notifyOwners?: boolean;
|
|
230
232
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
231
233
|
}
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -257,10 +257,10 @@ export type AoRedelegateStakeParams = {
|
|
|
257
257
|
stakeQty: number | mARIOToken;
|
|
258
258
|
vaultId?: string;
|
|
259
259
|
};
|
|
260
|
-
export declare const validIntents: readonly ["Buy-Record", "Extend-Lease", "Increase-Undername-Limit", "Upgrade-Name", "Primary-Name-Request"];
|
|
261
|
-
export declare const intentsUsingYears: readonly ["Buy-Record", "Extend-Lease"];
|
|
260
|
+
export declare const validIntents: readonly ["Buy-Name", "Buy-Record", "Extend-Lease", "Increase-Undername-Limit", "Upgrade-Name", "Primary-Name-Request"];
|
|
261
|
+
export declare const intentsUsingYears: readonly ["Buy-Record", "Buy-Name", "Extend-Lease"];
|
|
262
262
|
export type Intent = (typeof validIntents)[number];
|
|
263
|
-
export declare const isValidIntent: (intent: string) => intent is "Buy-Record" | "Extend-Lease" | "Increase-Undername-Limit" | "Upgrade-Name" | "Primary-Name-Request";
|
|
263
|
+
export declare const isValidIntent: (intent: string) => intent is "Buy-Name" | "Buy-Record" | "Extend-Lease" | "Increase-Undername-Limit" | "Upgrade-Name" | "Primary-Name-Request";
|
|
264
264
|
export type AoTokenCostParams = {
|
|
265
265
|
intent: Intent;
|
|
266
266
|
type?: 'permabuy' | 'lease';
|
package/lib/types/version.d.ts
CHANGED