@ar.io/sdk 3.3.1 → 3.4.0-alpha.2

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.
@@ -13,11 +13,14 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { TransferCLIOptions } from '../types.js';
17
- export declare function transfer(options: TransferCLIOptions): Promise<{
16
+ import { AoRevokeVaultParams, AoVaultedTransferParams } from '../../types/io.js';
17
+ import { CLIWriteOptionsFromAoParams, JsonSerializable, TransferCLIOptions } from '../types.js';
18
+ export declare function transferCLICommand(options: TransferCLIOptions): Promise<{
18
19
  senderAddress: string;
19
20
  transferResult: import("../../types/common.js").AoMessageResult;
20
21
  message: string;
21
22
  } | {
22
23
  message: string;
23
24
  }>;
25
+ export declare function vaultedTransferCLICommand(o: CLIWriteOptionsFromAoParams<AoVaultedTransferParams>): Promise<JsonSerializable>;
26
+ export declare function revokeVaultCLICommand(o: CLIWriteOptionsFromAoParams<AoRevokeVaultParams>): Promise<JsonSerializable>;
@@ -234,6 +234,19 @@ export declare const optionMap: {
234
234
  alias: string;
235
235
  description: string;
236
236
  };
237
+ revokable: {
238
+ alias: string;
239
+ description: string;
240
+ type: string;
241
+ };
242
+ lockLengthMs: {
243
+ alias: string;
244
+ description: string;
245
+ };
246
+ recipient: {
247
+ alias: string;
248
+ description: string;
249
+ };
237
250
  };
238
251
  export declare const walletOptions: {
239
252
  alias: string;
@@ -284,6 +297,10 @@ export declare const transferOptions: {
284
297
  alias: string;
285
298
  description: string;
286
299
  }[];
300
+ export declare const vaultedTransferOptions: {
301
+ alias: string;
302
+ description: string;
303
+ }[];
287
304
  export declare const operatorStakeOptions: {
288
305
  alias: string;
289
306
  description: string;
@@ -68,6 +68,7 @@ export declare function assertConfirmationPrompt<O extends {
68
68
  export declare function requiredProcessIdFromOptions<O extends ProcessIdCLIOptions>(o: O): string;
69
69
  export declare function readANTFromOptions(options: ProcessIdCLIOptions): AoANTRead;
70
70
  export declare function writeANTFromOptions(options: ProcessIdCLIOptions, signer?: ContractSigner): AoANTWrite;
71
+ export declare function booleanFromOptions<O extends GlobalCLIOptions>(options: O, key: string): boolean;
71
72
  export declare function requiredStringFromOptions<O extends GlobalCLIOptions>(options: O, key: string): string;
72
73
  export declare function requiredStringArrayFromOptions<O extends GlobalCLIOptions>(options: O, key: string): string[];
73
74
  export declare function positiveIntegerFromOptions<O extends GlobalCLIOptions>(options: O, key: string): number | undefined;
@@ -147,6 +147,9 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
147
147
  controller: string;
148
148
  }, options?: WriteOptions): Promise<AoMessageResult>;
149
149
  /**
150
+ * Sets the transactionId and ttlSeconds of a record (for updating the top level name, use undername "@".)
151
+ *
152
+ * @deprecated Use setUndernameRecord instead for undernames, and setBaseNameRecord instead for the top level name (e.g. "@")
150
153
  * @param undername @type {string} The record you want to set the transactionId and ttlSeconds of.
151
154
  * @param transactionId @type {string} The transactionId of the record.
152
155
  * @param ttlSeconds @type {number} The time to live of the record.
@@ -162,17 +165,67 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
162
165
  ttlSeconds: number;
163
166
  }, options?: WriteOptions): Promise<AoMessageResult>;
164
167
  /**
168
+ * 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)
169
+ *
170
+ * @param transactionId @type {string} The transactionId of the record.
171
+ * @param ttlSeconds @type {number} The time to live of the record.
172
+ * @returns {Promise<AoMessageResult>} The result of the interaction.
173
+ * @example
174
+ * ```ts
175
+ * 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
176
+ * ```
177
+ */
178
+ setBaseNameRecord({ transactionId, ttlSeconds, }: {
179
+ transactionId: string;
180
+ ttlSeconds: number;
181
+ }): Promise<AoMessageResult>;
182
+ /**
183
+ * 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)
184
+ *
185
+ * @param undername @type {string} The undername of the ANT.
186
+ * @param transactionId @type {string} The transactionId of the record.
187
+ * @param ttlSeconds @type {number} The time to live of the record.
188
+ * @returns {Promise<AoMessageResult>} The result of the interaction.
189
+ * @example
190
+ * ```ts
191
+ * 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
192
+ * ```
193
+ */
194
+ setUndernameRecord({ undername, transactionId, ttlSeconds, }: {
195
+ undername: string;
196
+ transactionId: string;
197
+ ttlSeconds: number;
198
+ }): Promise<AoMessageResult>;
199
+ /**
200
+ * Removes an undername from the ANT. This will remove the undername from the ANT.
201
+ *
202
+ * @param undername @type {string} The undername you want to remove.
203
+ * @returns {Promise<AoMessageResult>} The result of the interaction.
204
+ * @example
205
+ * ```ts
206
+ * ant.removeUndernameRecord({ undername: "dapp" }); // removes dapp_ardrive.ar.io
207
+ * ```
208
+ */
209
+ removeUndernameRecord({ undername, }: {
210
+ undername: string;
211
+ }): Promise<AoMessageResult>;
212
+ /**
213
+ * Removes a record from the ANT. This will remove the record from the ANT. If '@' is provided, the top level name will be removed.
214
+ *
215
+ * @deprecated Use removeUndernameRecord instead.
165
216
  * @param undername @type {string} The record you want to remove.
166
217
  * @returns {Promise<AoMessageResult>} The result of the interaction.
167
218
  * @example
168
219
  * ```ts
169
- * ant.removeRecord({ subDomain: "shorts" });
220
+ * ant.removeRecord({ undername: "dapp" }); // removes dapp_ardrive.ar.io
170
221
  * ```
171
222
  */
172
223
  removeRecord({ undername, }: {
173
224
  undername: string;
174
225
  }, options?: WriteOptions): Promise<AoMessageResult>;
175
226
  /**
227
+ * Sets the ticker of the ANT. This is the abbreviation displayed in ecosystem apps.
228
+ *
176
229
  * @param ticker @type {string} Sets the ANT Ticker.
177
230
  * @returns {Promise<AoMessageResult>} The result of the interaction.
178
231
  * @example
@@ -184,6 +237,8 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
184
237
  ticker: string;
185
238
  }, options?: WriteOptions): Promise<AoMessageResult>;
186
239
  /**
240
+ * Sets the name of the ANT. This is the display name of the ANT. This is NOT the base name record.
241
+ *
187
242
  * @param name @type {string} Sets the Name of the ANT.
188
243
  * @returns {Promise<AoMessageResult>} The result of the interaction.
189
244
  * @example
@@ -195,6 +250,8 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
195
250
  name: string;
196
251
  }, options?: WriteOptions): Promise<AoMessageResult>;
197
252
  /**
253
+ * Sets the description of the ANT. This is the description of the ANT displayed in ecosystem apps.
254
+ *
198
255
  * @param description @type {string} Sets the ANT Description.
199
256
  * @returns {Promise<AoMessageResult>} The result of the interaction.
200
257
  * @example
@@ -206,6 +263,8 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
206
263
  description: string;
207
264
  }, options?: WriteOptions): Promise<AoMessageResult>;
208
265
  /**
266
+ * Sets the keywords of the ANT. This is the keywords of the ANT displayed in ecosystem apps.
267
+ *
209
268
  * @param keywords @type {string[]} Sets the ANT Keywords.
210
269
  * @returns {Promise<AoMessageResult>} The result of the interaction.
211
270
  * @example
@@ -217,6 +276,8 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
217
276
  keywords: string[];
218
277
  }, options?: WriteOptions): Promise<AoMessageResult>;
219
278
  /**
279
+ * Sets the logo of the ANT. This is the logo of the ANT displayed in ecosystem apps. Additionally, this logo is displayed for any primary names affiliated with the ANT.
280
+ *
220
281
  * @param txId @type {string} - Arweave transaction id of the logo we want to set
221
282
  * @param options @type {WriteOptions} - additional options to add to the write interaction (optional)
222
283
  * @returns {Promise<AoMessageResult>} The result of the interaction.
@@ -229,6 +290,9 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
229
290
  txId: string;
230
291
  }, options?: WriteOptions): Promise<AoMessageResult>;
231
292
  /**
293
+ * Releases an ArNS name associated with the ANT. This will release the name to the public and allow anyone to register it. All primary names must be removed before the name can be released.
294
+ *
295
+ *
232
296
  * @param name @type {string} The name you want to release. The name will be put up for as a recently returned name on the ARIO contract. 50% of the winning bid will be distributed to the ANT owner at the time of purchase. If no purchase in the recently returned name period (14 epochs), the name will be released and can be reregistered by anyone.
233
297
  * @param arioProcessId @type {string} The processId of the ARIO contract. This is where the ANT will send the message to release the name.
234
298
  * @returns {Promise<AoMessageResult>} The result of the interaction.
@@ -242,7 +306,8 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
242
306
  arioProcessId: string;
243
307
  }, options?: WriteOptions): Promise<AoMessageResult>;
244
308
  /**
245
- * Sends a message to the ARIO contract to reassign the name to a new ANT. This can only be done by the current owner of the ANT.
309
+ * Sends a message to the ARIO contract to reassign the the base ArNS name to a new ANT. This can only be done by the current owner of the ANT.
310
+ *
246
311
  * @param name @type {string} The name you want to reassign.
247
312
  * @param arioProcessId @type {string} The processId of the ARIO contract.
248
313
  * @param antProcessId @type {string} The processId of the ANT contract.
@@ -259,12 +324,33 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
259
324
  }, options?: WriteOptions): Promise<AoMessageResult>;
260
325
  /**
261
326
  * Approves a primary name request for a given name or address.
327
+ *
328
+ * @param name @type {string} The name you want to approve.
329
+ * @param address @type {WalletAddress} The address you want to approve.
330
+ * @param arioProcessId @type {string} The processId of the ARIO contract.
331
+ * @returns {Promise<AoMessageResult>} The result of the interaction.
332
+ * @example
333
+ * ```ts
334
+ * ant.approvePrimaryNameRequest({ name: "ardrive", address: "U7RXcpaVShG4u9nIcPVmm2FJSM5Gru9gQCIiRaIPV7f", arioProcessId: ARIO_TESTNET_PROCESS_ID }); // approves the request for ardrive.ar.io to be registered by the address
335
+ * ```
262
336
  */
263
337
  approvePrimaryNameRequest({ name, address, arioProcessId, }: {
264
338
  name: string;
265
339
  address: WalletAddress;
266
340
  arioProcessId: string;
267
341
  }, options?: WriteOptions): Promise<AoMessageResult>;
342
+ /**
343
+ * Removes primary names from the ANT. This will remove the primary names associated with the base ArNS name controlled by this ANT. All primary names must be removed before the name can be released.
344
+ *
345
+ * @param names @type {string[]} The names you want to remove.
346
+ * @param arioProcessId @type {string} The processId of the ARIO contract.
347
+ * @param notifyOwners @type {boolean} Whether to notify the owners of the primary names.
348
+ * @returns {Promise<AoMessageResult>} The result of the interaction.
349
+ * @example
350
+ * ```ts
351
+ * ant.removePrimaryNames({ names: ["ardrive", "dapp_ardrive"], arioProcessId: ARIO_TESTNET_PROCESS_ID, notifyOwners: true }); // removes the primary names and associated wallet addresses assigned to "ardrive" and "dapp_ardrive"
352
+ * ```
353
+ */
268
354
  removePrimaryNames({ names, arioProcessId, notifyOwners, }: {
269
355
  names: string[];
270
356
  arioProcessId: string;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import Arweave from 'arweave';
17
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
- import { AoARIORead, AoARIOWrite, AoAllDelegates, AoAllGatewayVaults, 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';
18
+ import { AoARIORead, AoARIOWrite, AoAllDelegates, AoAllGatewayVaults, AoArNSNameData, AoArNSPurchaseParams, AoArNSReservedNameDataWithName, AoBuyRecordParams, AoDelegation, AoEpochData, AoEpochSettings, AoExtendLeaseParams, AoGateway, AoGatewayDelegateWithAddress, AoGatewayRegistrySettings, AoGatewayVault, AoGetCostDetailsParams, AoIncreaseUndernameLimitParams, AoPaginatedAddressParams, AoRegistrationFees, AoRevokeVaultParams, AoVaultData, AoVaultedTransferParams, 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
21
  type ARIOConfigNoSigner = OptionalArweave<ProcessConfiguration>;
@@ -147,6 +147,8 @@ export declare class ARIOWriteable extends ARIOReadable implements AoARIOWrite {
147
147
  target: string;
148
148
  qty: number | mARIOToken;
149
149
  }, options?: WriteOptions): Promise<AoMessageResult>;
150
+ vaultedTransfer({ recipient, quantity, lockLengthMs, revokable, }: AoVaultedTransferParams, options?: WriteOptions): Promise<AoMessageResult>;
151
+ revokeVault({ vaultId, recipient }: AoRevokeVaultParams, options?: WriteOptions): Promise<AoMessageResult>;
150
152
  joinNetwork({ operatorStake, allowDelegatedStaking, allowedDelegates, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: AoJoinNetworkParams, options?: WriteOptions): Promise<AoMessageResult>;
151
153
  leaveNetwork(options?: WriteOptions): Promise<AoMessageResult>;
152
154
  updateGatewaySettings({ allowDelegatedStaking, allowedDelegates, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: AoUpdateGatewaySettingsParams, options?: WriteOptions): Promise<AoMessageResult>;
@@ -196,6 +196,18 @@ export interface AoANTWrite extends AoANTRead {
196
196
  removeRecord({ undername }: {
197
197
  undername: string;
198
198
  }, options?: WriteOptions): Promise<AoMessageResult>;
199
+ setBaseNameRecord({ transactionId, ttlSeconds, }: {
200
+ transactionId: string;
201
+ ttlSeconds: number;
202
+ }): Promise<AoMessageResult>;
203
+ setUndernameRecord({ undername, transactionId, ttlSeconds, }: {
204
+ undername: string;
205
+ transactionId: string;
206
+ ttlSeconds: number;
207
+ }): Promise<AoMessageResult>;
208
+ removeUndernameRecord({ undername, }: {
209
+ undername: string;
210
+ }): Promise<AoMessageResult>;
199
211
  setTicker({ ticker }: {
200
212
  ticker: string;
201
213
  }, options?: WriteOptions): Promise<AoMessageResult>;
@@ -335,6 +335,16 @@ export type AoExtendLeaseParams = AoArNSPurchaseParams & {
335
335
  export type AoIncreaseUndernameLimitParams = AoArNSPurchaseParams & {
336
336
  increaseCount: number;
337
337
  };
338
+ export type AoVaultedTransferParams = {
339
+ recipient: WalletAddress;
340
+ quantity: mARIOToken | number;
341
+ lockLengthMs: number;
342
+ revokable?: boolean;
343
+ };
344
+ export type AoRevokeVaultParams = {
345
+ vaultId: TransactionId;
346
+ recipient: WalletAddress;
347
+ };
338
348
  export type AoGatewayRegistrySettings = {
339
349
  delegates: {
340
350
  minStake: number;
@@ -439,6 +449,8 @@ export interface AoARIOWrite extends AoARIORead {
439
449
  target: WalletAddress;
440
450
  qty: number;
441
451
  }, options?: WriteOptions): Promise<AoMessageResult>;
452
+ vaultedTransfer({ recipient, quantity, lockLengthMs, revokable }: AoVaultedTransferParams, options?: WriteOptions): Promise<AoMessageResult>;
453
+ revokeVault({ vaultId, recipient }: AoRevokeVaultParams, options?: WriteOptions): Promise<AoMessageResult>;
442
454
  joinNetwork(params: AoJoinNetworkParams, options?: WriteOptions): Promise<AoMessageResult>;
443
455
  leaveNetwork(options?: WriteOptions): Promise<AoMessageResult>;
444
456
  updateGatewaySettings(params: AoUpdateGatewaySettingsParams, options?: WriteOptions): Promise<AoMessageResult>;
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "3.3.1-alpha.4";
16
+ export declare const version = "3.4.0-alpha.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "3.3.1",
3
+ "version": "3.4.0-alpha.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"