@ar.io/sdk 3.19.0-alpha.9 → 3.20.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 +191 -7
- package/bundles/web.bundle.min.js +56 -56
- package/lib/cjs/cli/cli.js +8 -1
- package/lib/cjs/cli/commands/antCommands.js +32 -16
- package/lib/cjs/cli/options.js +25 -1
- package/lib/cjs/cli/utils.js +14 -0
- package/lib/cjs/common/ant.js +70 -12
- package/lib/cjs/common/io.js +2 -2
- package/lib/cjs/types/ant.js +18 -0
- package/lib/cjs/utils/processes.js +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +10 -3
- package/lib/esm/cli/commands/antCommands.js +32 -17
- package/lib/esm/cli/options.js +24 -0
- package/lib/esm/cli/utils.js +13 -0
- package/lib/esm/common/ant.js +70 -12
- package/lib/esm/common/io.js +2 -2
- package/lib/esm/types/ant.js +18 -0
- package/lib/esm/utils/processes.js +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/antCommands.d.ts +4 -0
- package/lib/types/cli/options.d.ts +16 -0
- package/lib/types/cli/types.d.ts +1 -0
- package/lib/types/cli/utils.d.ts +13 -0
- package/lib/types/common/ant.d.ts +33 -3
- package/lib/types/common/io.d.ts +1 -1
- package/lib/types/types/ant.d.ts +97 -8
- package/lib/types/utils/processes.d.ts +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +3 -2
package/lib/esm/common/ant.js
CHANGED
|
@@ -392,7 +392,7 @@ export class AoANTReadable {
|
|
|
392
392
|
query {
|
|
393
393
|
transactions(
|
|
394
394
|
ids: ["${this.processId}"]
|
|
395
|
-
first: 1
|
|
395
|
+
first: 1
|
|
396
396
|
) {
|
|
397
397
|
edges {
|
|
398
398
|
node {
|
|
@@ -758,17 +758,31 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
758
758
|
* @param undername @type {string} The record you want to set the transactionId and ttlSeconds of.
|
|
759
759
|
* @param transactionId @type {string} The transactionId of the record.
|
|
760
760
|
* @param ttlSeconds @type {number} The time to live of the record.
|
|
761
|
+
* @param owner @type {string} Optional owner address for the record.
|
|
762
|
+
* @param displayName @type {string} Optional display name for the record.
|
|
763
|
+
* @param logo @type {string} Optional logo transaction ID for the record.
|
|
764
|
+
* @param description @type {string} Optional description for the record.
|
|
765
|
+
* @param keywords @type {string[]} Optional keywords array for the record.
|
|
761
766
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
762
767
|
*/
|
|
763
|
-
async setRecord({ undername, transactionId, ttlSeconds }, options) {
|
|
768
|
+
async setRecord({ undername, transactionId, ttlSeconds, owner, displayName, logo, description, keywords, }, options) {
|
|
769
|
+
const tags = [
|
|
770
|
+
...(options?.tags ?? []),
|
|
771
|
+
{ name: 'Action', value: 'Set-Record' },
|
|
772
|
+
{ name: 'Sub-Domain', value: undername },
|
|
773
|
+
{ name: 'Transaction-Id', value: transactionId },
|
|
774
|
+
{ name: 'TTL-Seconds', value: ttlSeconds.toString() },
|
|
775
|
+
{ name: 'Record-Owner', value: owner },
|
|
776
|
+
{ name: 'Display-Name', value: displayName },
|
|
777
|
+
{ name: 'Logo', value: logo },
|
|
778
|
+
{ name: 'Description', value: description },
|
|
779
|
+
{
|
|
780
|
+
name: 'Keywords',
|
|
781
|
+
value: keywords ? JSON.stringify(keywords) : undefined,
|
|
782
|
+
},
|
|
783
|
+
].filter((tag) => tag.value !== undefined);
|
|
764
784
|
return this.process.send({
|
|
765
|
-
tags
|
|
766
|
-
...(options?.tags ?? []),
|
|
767
|
-
{ name: 'Action', value: 'Set-Record' },
|
|
768
|
-
{ name: 'Sub-Domain', value: undername },
|
|
769
|
-
{ name: 'Transaction-Id', value: transactionId },
|
|
770
|
-
{ name: 'TTL-Seconds', value: ttlSeconds.toString() },
|
|
771
|
-
],
|
|
785
|
+
tags,
|
|
772
786
|
signer: this.signer,
|
|
773
787
|
});
|
|
774
788
|
}
|
|
@@ -777,17 +791,27 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
777
791
|
*
|
|
778
792
|
* @param transactionId @type {string} The transactionId of the record.
|
|
779
793
|
* @param ttlSeconds @type {number} The time to live of the record.
|
|
794
|
+
* @param owner @type {string} Optional owner address for the record.
|
|
795
|
+
* @param displayName @type {string} Optional display name for the record.
|
|
796
|
+
* @param logo @type {string} Optional logo transaction ID for the record.
|
|
797
|
+
* @param description @type {string} Optional description for the record.
|
|
798
|
+
* @param keywords @type {string[]} Optional keywords array for the record.
|
|
780
799
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
781
800
|
* @example
|
|
782
801
|
* ```ts
|
|
783
802
|
* ant.setBaseNameRecord({ transactionId: "432l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM", ttlSeconds: 100 }); // ardrive.ar.io will resolve to the provided transaction id and be cached for 100 seconds by clients
|
|
784
803
|
* ```
|
|
785
804
|
*/
|
|
786
|
-
async setBaseNameRecord({ transactionId, ttlSeconds }, options) {
|
|
805
|
+
async setBaseNameRecord({ transactionId, ttlSeconds, owner, displayName, logo, description, keywords, }, options) {
|
|
787
806
|
return this.setRecord({
|
|
788
807
|
transactionId,
|
|
789
808
|
ttlSeconds,
|
|
790
809
|
undername: '@',
|
|
810
|
+
owner,
|
|
811
|
+
displayName,
|
|
812
|
+
logo,
|
|
813
|
+
description,
|
|
814
|
+
keywords,
|
|
791
815
|
}, options);
|
|
792
816
|
}
|
|
793
817
|
/**
|
|
@@ -796,17 +820,27 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
796
820
|
* @param undername @type {string} The undername of the ANT.
|
|
797
821
|
* @param transactionId @type {string} The transactionId of the record.
|
|
798
822
|
* @param ttlSeconds @type {number} The time to live of the record.
|
|
823
|
+
* @param owner @type {string} Optional owner address for the record.
|
|
824
|
+
* @param displayName @type {string} Optional display name for the record.
|
|
825
|
+
* @param logo @type {string} Optional logo transaction ID for the record.
|
|
826
|
+
* @param description @type {string} Optional description for the record.
|
|
827
|
+
* @param keywords @type {string[]} Optional keywords array for the record.
|
|
799
828
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
800
829
|
* @example
|
|
801
830
|
* ```ts
|
|
802
831
|
* ant.setUndernameRecord({ undername: "dapp", transactionId: "432l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM", ttlSeconds: 100 }); // dapp_ardrive.ar.io will resolve to the provided transaction id and be cached for 100 seconds by clients
|
|
803
832
|
* ```
|
|
804
833
|
*/
|
|
805
|
-
async setUndernameRecord({ undername, transactionId, ttlSeconds }, options) {
|
|
834
|
+
async setUndernameRecord({ undername, transactionId, ttlSeconds, owner, displayName, logo, description, keywords, }, options) {
|
|
806
835
|
return this.setRecord({
|
|
807
836
|
undername,
|
|
808
837
|
transactionId,
|
|
809
838
|
ttlSeconds,
|
|
839
|
+
owner,
|
|
840
|
+
displayName,
|
|
841
|
+
logo,
|
|
842
|
+
description,
|
|
843
|
+
keywords,
|
|
810
844
|
}, options);
|
|
811
845
|
}
|
|
812
846
|
/**
|
|
@@ -1029,7 +1063,9 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
1029
1063
|
* ant.removePrimaryNames({ names: ["ardrive", "dapp_ardrive"], arioProcessId: ARIO_MAINNET_PROCESS_ID, notifyOwners: true }); // removes the primary names and associated wallet addresses assigned to "ardrive" and "dapp_ardrive"
|
|
1030
1064
|
* ```
|
|
1031
1065
|
*/
|
|
1032
|
-
async removePrimaryNames({ names, arioProcessId,
|
|
1066
|
+
async removePrimaryNames({ names, arioProcessId,
|
|
1067
|
+
// TODO: remove this param, its not used on the ANT contract
|
|
1068
|
+
notifyOwners = false, }, options) {
|
|
1033
1069
|
return this.process.send({
|
|
1034
1070
|
tags: [
|
|
1035
1071
|
...(options?.tags ?? []),
|
|
@@ -1098,4 +1134,26 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
1098
1134
|
});
|
|
1099
1135
|
}
|
|
1100
1136
|
}
|
|
1137
|
+
/**
|
|
1138
|
+
* Transfers ownership of a specific record (undername) to another address. This allows delegation of control for individual records within an ANT while maintaining the ANT owner's ultimate authority.
|
|
1139
|
+
*
|
|
1140
|
+
* @param undername @type {string} The subdomain/record whose ownership you want to transfer.
|
|
1141
|
+
* @param recipient @type {string} The address of the new owner for this record.
|
|
1142
|
+
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
1143
|
+
* @example
|
|
1144
|
+
* ```ts
|
|
1145
|
+
* ant.transferRecord({ undername: "alice", recipient: "new-owner-address-123..." }); // transfers ownership of the "alice" record to the new owner
|
|
1146
|
+
* ```
|
|
1147
|
+
*/
|
|
1148
|
+
async transferRecord({ undername, recipient, }, options) {
|
|
1149
|
+
return this.process.send({
|
|
1150
|
+
tags: [
|
|
1151
|
+
...(options?.tags ?? []),
|
|
1152
|
+
{ name: 'Action', value: 'Transfer-Record' },
|
|
1153
|
+
{ name: 'Sub-Domain', value: undername },
|
|
1154
|
+
{ name: 'Recipient', value: recipient },
|
|
1155
|
+
],
|
|
1156
|
+
signer: this.signer,
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1101
1159
|
}
|
package/lib/esm/common/io.js
CHANGED
|
@@ -680,12 +680,12 @@ export class ARIOReadable {
|
|
|
680
680
|
* @returns {Promise<AoArNSNameData[]>} The ARNS names associated with the address
|
|
681
681
|
*/
|
|
682
682
|
async getArNSRecordsForAddress(params) {
|
|
683
|
-
const {
|
|
683
|
+
const { antRegistryProcessId = ANT_REGISTRY_ID, address } = params;
|
|
684
684
|
const antRegistry = ANTRegistry.init({
|
|
685
685
|
hyperbeamUrl: this.hyperbeamUrl,
|
|
686
686
|
process: new AOProcess({
|
|
687
687
|
ao: this.process.ao,
|
|
688
|
-
processId:
|
|
688
|
+
processId: antRegistryProcessId,
|
|
689
689
|
}),
|
|
690
690
|
});
|
|
691
691
|
// Note: there could be a race condition here if the ACL changes during pagination requests, resulting in different results from the `getArNSRecords`.
|
package/lib/esm/types/ant.js
CHANGED
|
@@ -51,6 +51,23 @@ export const AntRecordSchema = z.object({
|
|
|
51
51
|
transactionId: ArweaveTxIdSchema.describe('The Target ID of the undername'),
|
|
52
52
|
ttlSeconds: z.number(),
|
|
53
53
|
priority: z.number().optional(),
|
|
54
|
+
owner: AOAddressSchema.describe('The owner address of the record').optional(),
|
|
55
|
+
displayName: z
|
|
56
|
+
.string()
|
|
57
|
+
.max(61)
|
|
58
|
+
.describe('Display name of the record (max 61 chars)')
|
|
59
|
+
.optional(),
|
|
60
|
+
logo: ArweaveTxIdSchema.describe('Logo transaction ID for the record').optional(),
|
|
61
|
+
description: z
|
|
62
|
+
.string()
|
|
63
|
+
.max(512)
|
|
64
|
+
.describe('Description of the record (max 512 chars)')
|
|
65
|
+
.optional(),
|
|
66
|
+
keywords: z
|
|
67
|
+
.array(z.string().max(32))
|
|
68
|
+
.max(16)
|
|
69
|
+
.describe('Keywords array (max 16, each max 32 chars)')
|
|
70
|
+
.optional(),
|
|
54
71
|
});
|
|
55
72
|
export const AntRecordsSchema = z.record(z.string(), AntRecordSchema);
|
|
56
73
|
export const AntControllersSchema = z.array(AOAddressSchema.describe('Controller address'));
|
|
@@ -116,6 +133,7 @@ export const AntWriteHandlers = [
|
|
|
116
133
|
'reassignName',
|
|
117
134
|
'approvePrimaryName',
|
|
118
135
|
'removePrimaryNames',
|
|
136
|
+
'transferRecordOwnership',
|
|
119
137
|
];
|
|
120
138
|
export const AntHandlerNames = [...AntReadHandlers, ...AntWriteHandlers];
|
|
121
139
|
export const AntHandlersSchema = z
|
|
@@ -23,7 +23,7 @@ import { ARIO } from '../common/io.js';
|
|
|
23
23
|
import { Logger } from '../common/logger.js';
|
|
24
24
|
import { ARIO_MAINNET_PROCESS_ID } from '../constants.js';
|
|
25
25
|
/**
|
|
26
|
-
* @
|
|
26
|
+
* @deprecated Use getArNSRecordsForAddress instead
|
|
27
27
|
*/
|
|
28
28
|
export const getANTProcessesOwnedByWallet = async ({ address, registry = ANTRegistry.init(), }) => {
|
|
29
29
|
const res = await registry.accessControlList({ address });
|
package/lib/esm/version.js
CHANGED
|
@@ -19,6 +19,10 @@ import { CLIWriteOptionsFromAoAntParams } from '../types.js';
|
|
|
19
19
|
export declare function setAntRecordCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetUndernameRecordParams>): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
|
|
20
20
|
export declare function setAntBaseNameCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetBaseNameRecordParams>): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
|
|
21
21
|
export declare function setAntUndernameCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetUndernameRecordParams>): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
|
|
22
|
+
export declare function transferRecordOwnershipCLICommand(o: CLIWriteOptionsFromAoAntParams<{
|
|
23
|
+
undername: string;
|
|
24
|
+
recipient: string;
|
|
25
|
+
}>): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
|
|
22
26
|
export declare function upgradeAntCLICommand(o: CLIWriteOptionsFromAoAntParams<Record<string, unknown>>): Promise<{
|
|
23
27
|
forkedProcessId: string;
|
|
24
28
|
reassignedNames: Record<string, import("../../types/common.js").AoMessageResult>;
|
|
@@ -247,6 +247,14 @@ export declare const optionMap: {
|
|
|
247
247
|
description: string;
|
|
248
248
|
type: string;
|
|
249
249
|
};
|
|
250
|
+
owner: {
|
|
251
|
+
alias: string;
|
|
252
|
+
description: string;
|
|
253
|
+
};
|
|
254
|
+
displayName: {
|
|
255
|
+
alias: string;
|
|
256
|
+
description: string;
|
|
257
|
+
};
|
|
250
258
|
names: {
|
|
251
259
|
alias: string;
|
|
252
260
|
description: string;
|
|
@@ -282,6 +290,10 @@ export declare const optionMap: {
|
|
|
282
290
|
alias: string;
|
|
283
291
|
description: string;
|
|
284
292
|
};
|
|
293
|
+
module: {
|
|
294
|
+
alias: string;
|
|
295
|
+
description: string;
|
|
296
|
+
};
|
|
285
297
|
token: {
|
|
286
298
|
alias: string;
|
|
287
299
|
description: string;
|
|
@@ -399,3 +411,7 @@ export declare const upgradeAntOptions: {
|
|
|
399
411
|
alias: string;
|
|
400
412
|
description: string;
|
|
401
413
|
}[];
|
|
414
|
+
export declare const transferRecordOwnershipOptions: {
|
|
415
|
+
alias: string;
|
|
416
|
+
description: string;
|
|
417
|
+
}[];
|
package/lib/types/cli/types.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ export type ANTStateCLIOptions = WriteActionCLIOptions & {
|
|
|
107
107
|
controllers?: string[];
|
|
108
108
|
ttlSeconds?: string;
|
|
109
109
|
logo?: string;
|
|
110
|
+
module?: string;
|
|
110
111
|
};
|
|
111
112
|
export type JsonSerializable = string | number | boolean | null | JsonSerializable[] | {
|
|
112
113
|
[key: string]: JsonSerializable;
|
package/lib/types/cli/utils.d.ts
CHANGED
|
@@ -97,3 +97,16 @@ export declare function referrerFromOptions<O extends {
|
|
|
97
97
|
referrer?: string;
|
|
98
98
|
}>(o: O): string | undefined;
|
|
99
99
|
export declare function assertLockLengthInRange(lockLengthMs: number, assertMin?: boolean): void;
|
|
100
|
+
export declare function antRecordMetadataFromOptions<O extends {
|
|
101
|
+
owner?: string;
|
|
102
|
+
displayName?: string;
|
|
103
|
+
logo?: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
keywords?: string[];
|
|
106
|
+
}>(options: O): {
|
|
107
|
+
owner?: string;
|
|
108
|
+
displayName?: string;
|
|
109
|
+
logo?: string;
|
|
110
|
+
description?: string;
|
|
111
|
+
keywords?: string[];
|
|
112
|
+
};
|
|
@@ -276,34 +276,49 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
276
276
|
* @param undername @type {string} The record you want to set the transactionId and ttlSeconds of.
|
|
277
277
|
* @param transactionId @type {string} The transactionId of the record.
|
|
278
278
|
* @param ttlSeconds @type {number} The time to live of the record.
|
|
279
|
+
* @param owner @type {string} Optional owner address for the record.
|
|
280
|
+
* @param displayName @type {string} Optional display name for the record.
|
|
281
|
+
* @param logo @type {string} Optional logo transaction ID for the record.
|
|
282
|
+
* @param description @type {string} Optional description for the record.
|
|
283
|
+
* @param keywords @type {string[]} Optional keywords array for the record.
|
|
279
284
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
280
285
|
*/
|
|
281
|
-
setRecord({ undername, transactionId, ttlSeconds }: AoANTSetUndernameRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
286
|
+
setRecord({ undername, transactionId, ttlSeconds, owner, displayName, logo, description, keywords, }: AoANTSetUndernameRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
282
287
|
/**
|
|
283
288
|
* Sets the top level name of the ANT. This is the name that will be used to resolve the ANT (e.g. ardrive.ar.io)
|
|
284
289
|
*
|
|
285
290
|
* @param transactionId @type {string} The transactionId of the record.
|
|
286
291
|
* @param ttlSeconds @type {number} The time to live of the record.
|
|
292
|
+
* @param owner @type {string} Optional owner address for the record.
|
|
293
|
+
* @param displayName @type {string} Optional display name for the record.
|
|
294
|
+
* @param logo @type {string} Optional logo transaction ID for the record.
|
|
295
|
+
* @param description @type {string} Optional description for the record.
|
|
296
|
+
* @param keywords @type {string[]} Optional keywords array for the record.
|
|
287
297
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
288
298
|
* @example
|
|
289
299
|
* ```ts
|
|
290
300
|
* ant.setBaseNameRecord({ transactionId: "432l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM", ttlSeconds: 100 }); // ardrive.ar.io will resolve to the provided transaction id and be cached for 100 seconds by clients
|
|
291
301
|
* ```
|
|
292
302
|
*/
|
|
293
|
-
setBaseNameRecord({ transactionId, ttlSeconds }: AoANTSetBaseNameRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
303
|
+
setBaseNameRecord({ transactionId, ttlSeconds, owner, displayName, logo, description, keywords, }: AoANTSetBaseNameRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
294
304
|
/**
|
|
295
305
|
* Adds or updates an undername of the ANT. An undername is appended to the base name of the ANT (e.g. ardrive.ar.io) to form a fully qualified name (e.g. dapp_ardrive.ar.io)
|
|
296
306
|
*
|
|
297
307
|
* @param undername @type {string} The undername of the ANT.
|
|
298
308
|
* @param transactionId @type {string} The transactionId of the record.
|
|
299
309
|
* @param ttlSeconds @type {number} The time to live of the record.
|
|
310
|
+
* @param owner @type {string} Optional owner address for the record.
|
|
311
|
+
* @param displayName @type {string} Optional display name for the record.
|
|
312
|
+
* @param logo @type {string} Optional logo transaction ID for the record.
|
|
313
|
+
* @param description @type {string} Optional description for the record.
|
|
314
|
+
* @param keywords @type {string[]} Optional keywords array for the record.
|
|
300
315
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
301
316
|
* @example
|
|
302
317
|
* ```ts
|
|
303
318
|
* ant.setUndernameRecord({ undername: "dapp", transactionId: "432l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM", ttlSeconds: 100 }); // dapp_ardrive.ar.io will resolve to the provided transaction id and be cached for 100 seconds by clients
|
|
304
319
|
* ```
|
|
305
320
|
*/
|
|
306
|
-
setUndernameRecord({ undername, transactionId, ttlSeconds }: AoANTSetUndernameRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
321
|
+
setUndernameRecord({ undername, transactionId, ttlSeconds, owner, displayName, logo, description, keywords, }: AoANTSetUndernameRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
307
322
|
/**
|
|
308
323
|
* Removes an undername from the ANT. This will remove the undername from the ANT.
|
|
309
324
|
*
|
|
@@ -504,5 +519,20 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
504
519
|
error: Error;
|
|
505
520
|
}>;
|
|
506
521
|
}>;
|
|
522
|
+
/**
|
|
523
|
+
* Transfers ownership of a specific record (undername) to another address. This allows delegation of control for individual records within an ANT while maintaining the ANT owner's ultimate authority.
|
|
524
|
+
*
|
|
525
|
+
* @param undername @type {string} The subdomain/record whose ownership you want to transfer.
|
|
526
|
+
* @param recipient @type {string} The address of the new owner for this record.
|
|
527
|
+
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
528
|
+
* @example
|
|
529
|
+
* ```ts
|
|
530
|
+
* ant.transferRecord({ undername: "alice", recipient: "new-owner-address-123..." }); // transfers ownership of the "alice" record to the new owner
|
|
531
|
+
* ```
|
|
532
|
+
*/
|
|
533
|
+
transferRecord({ undername, recipient, }: {
|
|
534
|
+
undername: string;
|
|
535
|
+
recipient: string;
|
|
536
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
507
537
|
}
|
|
508
538
|
export {};
|
package/lib/types/common/io.d.ts
CHANGED
|
@@ -155,7 +155,7 @@ export declare class ARIOReadable implements AoARIORead, ArNSNameResolver {
|
|
|
155
155
|
* @returns {Promise<AoArNSNameData[]>} The ARNS names associated with the address
|
|
156
156
|
*/
|
|
157
157
|
getArNSRecordsForAddress(params: PaginationParams<AoArNSNameDataWithName> & {
|
|
158
|
-
|
|
158
|
+
antRegistryProcessId?: string;
|
|
159
159
|
address: WalletAddress;
|
|
160
160
|
}): Promise<PaginationResult<AoArNSNameDataWithName>>;
|
|
161
161
|
}
|
package/lib/types/types/ant.d.ts
CHANGED
|
@@ -36,14 +36,29 @@ export declare const AntRecordSchema: z.ZodObject<{
|
|
|
36
36
|
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
37
37
|
ttlSeconds: z.ZodNumber;
|
|
38
38
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
40
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
41
|
+
logo: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
42
|
+
description: z.ZodOptional<z.ZodString>;
|
|
43
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
39
44
|
}, "strip", z.ZodTypeAny, {
|
|
40
45
|
transactionId: string;
|
|
41
46
|
ttlSeconds: number;
|
|
47
|
+
description?: string | undefined;
|
|
42
48
|
priority?: number | undefined;
|
|
49
|
+
owner?: string | undefined;
|
|
50
|
+
displayName?: string | undefined;
|
|
51
|
+
logo?: string | undefined;
|
|
52
|
+
keywords?: string[] | undefined;
|
|
43
53
|
}, {
|
|
44
54
|
transactionId: string;
|
|
45
55
|
ttlSeconds: number;
|
|
56
|
+
description?: string | undefined;
|
|
46
57
|
priority?: number | undefined;
|
|
58
|
+
owner?: string | undefined;
|
|
59
|
+
displayName?: string | undefined;
|
|
60
|
+
logo?: string | undefined;
|
|
61
|
+
keywords?: string[] | undefined;
|
|
47
62
|
}>;
|
|
48
63
|
export type AoANTRecord = z.infer<typeof AntRecordSchema>;
|
|
49
64
|
export type ANTRecords = Record<string, AoANTRecord>;
|
|
@@ -55,14 +70,29 @@ export declare const AntRecordsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
55
70
|
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
56
71
|
ttlSeconds: z.ZodNumber;
|
|
57
72
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
74
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
75
|
+
logo: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
76
|
+
description: z.ZodOptional<z.ZodString>;
|
|
77
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
58
78
|
}, "strip", z.ZodTypeAny, {
|
|
59
79
|
transactionId: string;
|
|
60
80
|
ttlSeconds: number;
|
|
81
|
+
description?: string | undefined;
|
|
61
82
|
priority?: number | undefined;
|
|
83
|
+
owner?: string | undefined;
|
|
84
|
+
displayName?: string | undefined;
|
|
85
|
+
logo?: string | undefined;
|
|
86
|
+
keywords?: string[] | undefined;
|
|
62
87
|
}, {
|
|
63
88
|
transactionId: string;
|
|
64
89
|
ttlSeconds: number;
|
|
90
|
+
description?: string | undefined;
|
|
65
91
|
priority?: number | undefined;
|
|
92
|
+
owner?: string | undefined;
|
|
93
|
+
displayName?: string | undefined;
|
|
94
|
+
logo?: string | undefined;
|
|
95
|
+
keywords?: string[] | undefined;
|
|
66
96
|
}>>;
|
|
67
97
|
export declare const AntControllersSchema: z.ZodArray<z.ZodString, "many">;
|
|
68
98
|
export declare const AntBalancesSchema: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
@@ -78,14 +108,29 @@ export declare const AntStateSchema: z.ZodObject<{
|
|
|
78
108
|
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
79
109
|
ttlSeconds: z.ZodNumber;
|
|
80
110
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
112
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
113
|
+
logo: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
114
|
+
description: z.ZodOptional<z.ZodString>;
|
|
115
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
81
116
|
}, "strip", z.ZodTypeAny, {
|
|
82
117
|
transactionId: string;
|
|
83
118
|
ttlSeconds: number;
|
|
119
|
+
description?: string | undefined;
|
|
84
120
|
priority?: number | undefined;
|
|
121
|
+
owner?: string | undefined;
|
|
122
|
+
displayName?: string | undefined;
|
|
123
|
+
logo?: string | undefined;
|
|
124
|
+
keywords?: string[] | undefined;
|
|
85
125
|
}, {
|
|
86
126
|
transactionId: string;
|
|
87
127
|
ttlSeconds: number;
|
|
128
|
+
description?: string | undefined;
|
|
88
129
|
priority?: number | undefined;
|
|
130
|
+
owner?: string | undefined;
|
|
131
|
+
displayName?: string | undefined;
|
|
132
|
+
logo?: string | undefined;
|
|
133
|
+
keywords?: string[] | undefined;
|
|
89
134
|
}>>;
|
|
90
135
|
Balances: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
91
136
|
Logo: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -102,7 +147,12 @@ export declare const AntStateSchema: z.ZodObject<{
|
|
|
102
147
|
Records: Record<string, {
|
|
103
148
|
transactionId: string;
|
|
104
149
|
ttlSeconds: number;
|
|
150
|
+
description?: string | undefined;
|
|
105
151
|
priority?: number | undefined;
|
|
152
|
+
owner?: string | undefined;
|
|
153
|
+
displayName?: string | undefined;
|
|
154
|
+
logo?: string | undefined;
|
|
155
|
+
keywords?: string[] | undefined;
|
|
106
156
|
}>;
|
|
107
157
|
Balances: Record<string, number>;
|
|
108
158
|
Logo: string;
|
|
@@ -119,7 +169,12 @@ export declare const AntStateSchema: z.ZodObject<{
|
|
|
119
169
|
Records: Record<string, {
|
|
120
170
|
transactionId: string;
|
|
121
171
|
ttlSeconds: number;
|
|
172
|
+
description?: string | undefined;
|
|
122
173
|
priority?: number | undefined;
|
|
174
|
+
owner?: string | undefined;
|
|
175
|
+
displayName?: string | undefined;
|
|
176
|
+
logo?: string | undefined;
|
|
177
|
+
keywords?: string[] | undefined;
|
|
123
178
|
}>;
|
|
124
179
|
Balances: Record<string, number>;
|
|
125
180
|
Logo: string;
|
|
@@ -155,52 +210,77 @@ export declare const SpawnANTStateSchema: z.ZodObject<{
|
|
|
155
210
|
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
156
211
|
ttlSeconds: z.ZodNumber;
|
|
157
212
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
214
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
215
|
+
logo: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
216
|
+
description: z.ZodOptional<z.ZodString>;
|
|
217
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
158
218
|
}, "strip", z.ZodTypeAny, {
|
|
159
219
|
transactionId: string;
|
|
160
220
|
ttlSeconds: number;
|
|
221
|
+
description?: string | undefined;
|
|
161
222
|
priority?: number | undefined;
|
|
223
|
+
owner?: string | undefined;
|
|
224
|
+
displayName?: string | undefined;
|
|
225
|
+
logo?: string | undefined;
|
|
226
|
+
keywords?: string[] | undefined;
|
|
162
227
|
}, {
|
|
163
228
|
transactionId: string;
|
|
164
229
|
ttlSeconds: number;
|
|
230
|
+
description?: string | undefined;
|
|
165
231
|
priority?: number | undefined;
|
|
232
|
+
owner?: string | undefined;
|
|
233
|
+
displayName?: string | undefined;
|
|
234
|
+
logo?: string | undefined;
|
|
235
|
+
keywords?: string[] | undefined;
|
|
166
236
|
}>>;
|
|
167
237
|
balances: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
168
238
|
logo: z.ZodEffects<z.ZodString, string, string>;
|
|
169
239
|
}, "strip", z.ZodTypeAny, {
|
|
170
240
|
description: string;
|
|
241
|
+
owner: string;
|
|
242
|
+
logo: string;
|
|
243
|
+
keywords: string[];
|
|
171
244
|
name: string;
|
|
172
245
|
ticker: string;
|
|
173
|
-
keywords: string[];
|
|
174
|
-
owner: string;
|
|
175
246
|
controllers: string[];
|
|
176
247
|
records: Record<string, {
|
|
177
248
|
transactionId: string;
|
|
178
249
|
ttlSeconds: number;
|
|
250
|
+
description?: string | undefined;
|
|
179
251
|
priority?: number | undefined;
|
|
252
|
+
owner?: string | undefined;
|
|
253
|
+
displayName?: string | undefined;
|
|
254
|
+
logo?: string | undefined;
|
|
255
|
+
keywords?: string[] | undefined;
|
|
180
256
|
}>;
|
|
181
257
|
balances: Record<string, number>;
|
|
182
|
-
logo: string;
|
|
183
258
|
}, {
|
|
184
259
|
description: string;
|
|
260
|
+
owner: string;
|
|
261
|
+
logo: string;
|
|
262
|
+
keywords: string[];
|
|
185
263
|
name: string;
|
|
186
264
|
ticker: string;
|
|
187
|
-
keywords: string[];
|
|
188
|
-
owner: string;
|
|
189
265
|
controllers: string[];
|
|
190
266
|
records: Record<string, {
|
|
191
267
|
transactionId: string;
|
|
192
268
|
ttlSeconds: number;
|
|
269
|
+
description?: string | undefined;
|
|
193
270
|
priority?: number | undefined;
|
|
271
|
+
owner?: string | undefined;
|
|
272
|
+
displayName?: string | undefined;
|
|
273
|
+
logo?: string | undefined;
|
|
274
|
+
keywords?: string[] | undefined;
|
|
194
275
|
}>;
|
|
195
276
|
balances: Record<string, number>;
|
|
196
|
-
logo: string;
|
|
197
277
|
}>;
|
|
198
278
|
export type SpawnANTState = z.infer<typeof SpawnANTStateSchema>;
|
|
199
279
|
export declare const AntReadHandlers: readonly ["balance", "balances", "totalSupply", "info", "controllers", "record", "records", "state"];
|
|
200
280
|
export type AoANTReadHandler = (typeof AntReadHandlers)[number];
|
|
201
|
-
export declare const AntWriteHandlers: readonly ["_eval", "_default", "transfer", "addController", "removeController", "setRecord", "removeRecord", "setName", "setTicker", "setDescription", "setKeywords", "setLogo", "initializeState", "releaseName", "reassignName", "approvePrimaryName", "removePrimaryNames"];
|
|
281
|
+
export declare const AntWriteHandlers: readonly ["_eval", "_default", "transfer", "addController", "removeController", "setRecord", "removeRecord", "setName", "setTicker", "setDescription", "setKeywords", "setLogo", "initializeState", "releaseName", "reassignName", "approvePrimaryName", "removePrimaryNames", "transferRecordOwnership"];
|
|
202
282
|
export type AoANTWriteHandler = (typeof AntWriteHandlers)[number];
|
|
203
|
-
export declare const AntHandlerNames: ("controllers" | "records" | "balances" | "balance" | "totalSupply" | "info" | "record" | "state" | "_eval" | "_default" | "transfer" | "addController" | "removeController" | "setRecord" | "removeRecord" | "setName" | "setTicker" | "setDescription" | "setKeywords" | "setLogo" | "initializeState" | "releaseName" | "reassignName" | "approvePrimaryName" | "removePrimaryNames")[];
|
|
283
|
+
export declare const AntHandlerNames: ("controllers" | "records" | "balances" | "balance" | "totalSupply" | "info" | "record" | "state" | "_eval" | "_default" | "transfer" | "addController" | "removeController" | "setRecord" | "removeRecord" | "setName" | "setTicker" | "setDescription" | "setKeywords" | "setLogo" | "initializeState" | "releaseName" | "reassignName" | "approvePrimaryName" | "removePrimaryNames" | "transferRecordOwnership")[];
|
|
204
284
|
export type AoANTHandler = AoANTWriteHandler | AoANTReadHandler;
|
|
205
285
|
export declare const AntHandlersSchema: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
206
286
|
export declare const AntInfoSchema: z.ZodObject<{
|
|
@@ -353,11 +433,20 @@ export interface AoANTWrite extends AoANTRead {
|
|
|
353
433
|
error: Error;
|
|
354
434
|
}>;
|
|
355
435
|
}>;
|
|
436
|
+
transferRecord: AoWriteAction<{
|
|
437
|
+
undername: string;
|
|
438
|
+
recipient: string;
|
|
439
|
+
}>;
|
|
356
440
|
}
|
|
357
441
|
export type AoANTSetBaseNameRecordParams = {
|
|
358
442
|
transactionId: string;
|
|
359
443
|
ttlSeconds: number;
|
|
360
444
|
priority?: number;
|
|
445
|
+
owner?: string;
|
|
446
|
+
displayName?: string;
|
|
447
|
+
logo?: string;
|
|
448
|
+
description?: string;
|
|
449
|
+
keywords?: string[];
|
|
361
450
|
};
|
|
362
451
|
export type AoANTSetUndernameRecordParams = AoANTSetBaseNameRecordParams & {
|
|
363
452
|
undername: string;
|
|
@@ -3,7 +3,7 @@ import { ILogger } from '../common/logger.js';
|
|
|
3
3
|
import { AoANTRegistryRead } from '../types/ant-registry.js';
|
|
4
4
|
import { AoARIORead, AoArNSNameData, AoClient, ProcessId, WalletAddress } from '../types/index.js';
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @deprecated Use getArNSRecordsForAddress instead
|
|
7
7
|
*/
|
|
8
8
|
export declare const getANTProcessesOwnedByWallet: ({ address, registry, }: {
|
|
9
9
|
address: WalletAddress;
|
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
|
+
"version": "3.20.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -81,7 +81,8 @@
|
|
|
81
81
|
"example:esm": "cd examples/esm && yarn && node index.mjs",
|
|
82
82
|
"example:cjs": "yarn build:cjs && yarn link && cd examples/cjs && yarn && node index.cjs",
|
|
83
83
|
"example:web": "yarn build:web && http-server --port 8080 --host -o examples/web",
|
|
84
|
-
"example:vite": "yarn build:esm && yarn link && cd examples/vite && yarn && yarn start"
|
|
84
|
+
"example:vite": "yarn build:esm && yarn link && cd examples/vite && yarn && yarn start",
|
|
85
|
+
"cli:local": "node lib/esm/cli/cli.js"
|
|
85
86
|
},
|
|
86
87
|
"devDependencies": {
|
|
87
88
|
"@commitlint/cli": "^17.1.2",
|