@ardrive/turbo-sdk 1.42.0-alpha.1 → 1.42.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.
Files changed (53) hide show
  1. package/lib/cjs/cli/cli.js +46 -0
  2. package/lib/cjs/cli/commands/arns.js +249 -0
  3. package/lib/cjs/cli/commands/index.js +1 -0
  4. package/lib/cjs/cli/options.js +97 -1
  5. package/lib/cjs/common/http.js +4 -3
  6. package/lib/cjs/common/index.js +3 -0
  7. package/lib/cjs/common/payment.js +199 -0
  8. package/lib/cjs/common/signer.js +15 -3
  9. package/lib/cjs/common/turbo.js +44 -0
  10. package/lib/cjs/types.js +8 -1
  11. package/lib/cjs/utils/errors.js +19 -1
  12. package/lib/cjs/utils/uuid.js +31 -0
  13. package/lib/cjs/web/signer.js +4 -2
  14. package/lib/esm/cli/cli.js +47 -1
  15. package/lib/esm/cli/commands/arns.js +233 -0
  16. package/lib/esm/cli/commands/index.js +1 -0
  17. package/lib/esm/cli/options.js +96 -0
  18. package/lib/esm/common/http.js +4 -3
  19. package/lib/esm/common/index.js +3 -0
  20. package/lib/esm/common/payment.js +199 -0
  21. package/lib/esm/common/signer.js +15 -3
  22. package/lib/esm/common/turbo.js +44 -0
  23. package/lib/esm/types.js +7 -0
  24. package/lib/esm/utils/errors.js +17 -0
  25. package/lib/esm/utils/uuid.js +28 -0
  26. package/lib/esm/web/signer.js +4 -2
  27. package/lib/types/cli/commands/arns.d.ts +88 -0
  28. package/lib/types/cli/commands/arns.d.ts.map +1 -0
  29. package/lib/types/cli/commands/index.d.ts +1 -0
  30. package/lib/types/cli/commands/index.d.ts.map +1 -1
  31. package/lib/types/cli/options.d.ts +201 -0
  32. package/lib/types/cli/options.d.ts.map +1 -1
  33. package/lib/types/cli/types.d.ts +27 -0
  34. package/lib/types/cli/types.d.ts.map +1 -1
  35. package/lib/types/common/http.d.ts +2 -1
  36. package/lib/types/common/http.d.ts.map +1 -1
  37. package/lib/types/common/index.d.ts +1 -0
  38. package/lib/types/common/index.d.ts.map +1 -1
  39. package/lib/types/common/payment.d.ts +64 -1
  40. package/lib/types/common/payment.d.ts.map +1 -1
  41. package/lib/types/common/signer.d.ts +2 -6
  42. package/lib/types/common/signer.d.ts.map +1 -1
  43. package/lib/types/common/turbo.d.ts +53 -1
  44. package/lib/types/common/turbo.d.ts.map +1 -1
  45. package/lib/types/types.d.ts +136 -2
  46. package/lib/types/types.d.ts.map +1 -1
  47. package/lib/types/utils/errors.d.ts +14 -0
  48. package/lib/types/utils/errors.d.ts.map +1 -1
  49. package/lib/types/utils/uuid.d.ts +7 -0
  50. package/lib/types/utils/uuid.d.ts.map +1 -0
  51. package/lib/types/web/signer.d.ts +1 -1
  52. package/lib/types/web/signer.d.ts.map +1 -1
  53. package/package.json +2 -2
@@ -51,6 +51,18 @@ export class TurboUnauthenticatedClient {
51
51
  getBalance(address) {
52
52
  return this.paymentService.getBalance(address);
53
53
  }
54
+ /**
55
+ * Returns the price in 'winc' (and mARIO) to buy/extend/upgrade an ArNS name.
56
+ */
57
+ getArNSPriceForName(params) {
58
+ return this.paymentService.getArNSPriceForName(params);
59
+ }
60
+ /**
61
+ * Returns the status of an ArNS purchase by its nonce.
62
+ */
63
+ getArNSPurchaseStatus(p) {
64
+ return this.paymentService.getArNSPurchaseStatus(p);
65
+ }
54
66
  /**
55
67
  * Returns a list of all supported fiat currencies.
56
68
  */
@@ -155,6 +167,38 @@ export class TurboAuthenticatedClient extends TurboUnauthenticatedClient {
155
167
  getBalance(userAddress) {
156
168
  return this.paymentService.getBalance(userAddress);
157
169
  }
170
+ /**
171
+ * Buys, extends, or upgrades an ArNS name, paying with the signer's Turbo
172
+ * credit balance. Poll {@link getArNSPurchaseStatus} with the returned nonce.
173
+ */
174
+ purchaseArNSName(params) {
175
+ return this.paymentService.purchaseArNSName(params);
176
+ }
177
+ /** Buys a new ArNS name (lease or permabuy). */
178
+ buyArNSName(params) {
179
+ return this.paymentService.buyArNSName(params);
180
+ }
181
+ /** Extends the lease on an existing ArNS name. */
182
+ extendArNSLease(params) {
183
+ return this.paymentService.extendArNSLease(params);
184
+ }
185
+ /** Increases the undername limit on an existing ArNS name. */
186
+ increaseArNSUndernameLimit(params) {
187
+ return this.paymentService.increaseArNSUndernameLimit(params);
188
+ }
189
+ /** Upgrades an ArNS lease to a permabuy. */
190
+ upgradeArNSName(params) {
191
+ return this.paymentService.upgradeArNSName(params);
192
+ }
193
+ transferArNSAnt(params) {
194
+ return this.paymentService.transferArNSAnt(params);
195
+ }
196
+ setArNSRecord(params) {
197
+ return this.paymentService.setArNSRecord(params);
198
+ }
199
+ removeArNSRecord(params) {
200
+ return this.paymentService.removeArNSRecord(params);
201
+ }
158
202
  /**
159
203
  * Returns a list of all credit share approvals for the user.
160
204
  */
package/lib/esm/types.js CHANGED
@@ -94,3 +94,10 @@ export function isEthereumWalletAdapter(walletAdapter) {
94
94
  return 'getSigner' in walletAdapter;
95
95
  }
96
96
  export const validChunkingModes = ['force', 'disabled', 'auto'];
97
+ // ===== ArNS purchases paid with Turbo credits (via the bundler REST API) =====
98
+ export const arNSPurchaseIntents = [
99
+ 'Buy-Name',
100
+ 'Extend-Lease',
101
+ 'Increase-Undername-Limit',
102
+ 'Upgrade-Name',
103
+ ];
@@ -35,6 +35,23 @@ export class ProvidedInputError extends BaseError {
35
35
  super(message ?? `User has provided an invalid input`);
36
36
  }
37
37
  }
38
+ /**
39
+ * Raised when a credit-paid operation (e.g. an ArNS purchase) is rejected by the
40
+ * service because the paying wallet does not hold enough Turbo credits. Maps the
41
+ * bundler's HTTP `402 Payment Required` response to a typed, catchable error so
42
+ * callers can prompt a top-up without string-matching on messages.
43
+ *
44
+ * Recovery: top up the balance, then retry the SAME operation reusing the
45
+ * captured `nonce` (the nonce is the idempotency key), or mint a fresh request.
46
+ */
47
+ export class InsufficientCreditsError extends BaseError {
48
+ constructor(message) {
49
+ super(message ??
50
+ 'Insufficient Turbo credits to complete this purchase. Top up your balance and retry.');
51
+ /** Always the HTTP status that produced this error. */
52
+ this.status = 402;
53
+ }
54
+ }
38
55
  export class AbortError extends BaseError {
39
56
  constructor(message = 'Request was aborted') {
40
57
  super(message);
@@ -0,0 +1,28 @@
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 { randomBytes } from 'crypto';
17
+ /**
18
+ * RFC 4122 version 4 UUID, derived from `randomBytes` (already used across the
19
+ * SDK in both the node and web builds). Avoids depending on
20
+ * `crypto.randomUUID`, whose availability varies by runtime/polyfill.
21
+ */
22
+ export function uuidV4() {
23
+ const bytes = randomBytes(16);
24
+ bytes[6] = (bytes[6] & 0x0f) | 0x40; // version 4
25
+ bytes[8] = (bytes[8] & 0x3f) | 0x80; // RFC 4122 variant
26
+ const hex = bytes.toString('hex');
27
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
28
+ }
@@ -59,9 +59,11 @@ export class TurboWebArweaveSigner extends TurboDataItemAbstractSigner {
59
59
  dataItemSizeFactory: () => signedDataItemSize,
60
60
  };
61
61
  }
62
- async generateSignedRequestHeaders() {
62
+ async generateSignedRequestHeaders(nonce, additionalData) {
63
63
  await this.setPublicKey();
64
- return super.generateSignedRequestHeaders();
64
+ // Pass through the caller's nonce + action-binding data (previously dropped,
65
+ // which would override a route-required UUID nonce and the H-2 binding).
66
+ return super.generateSignedRequestHeaders(nonce, additionalData);
65
67
  }
66
68
  async signData(dataToSign) {
67
69
  await this.setPublicKey();
@@ -0,0 +1,88 @@
1
+ import { ArNSNameType, ArNSPriceParams, ArNSPriceResponse, ArNSPurchaseResponse, ArNSPurchaseStatusResponse } from '../../types.js';
2
+ import { ArNSPriceOptions, ArNSPurchaseOptions, ArNSPurchaseStatusOptions, RemoveArNSRecordOptions, SetArNSRecordOptions, TransferArNSAntOptions } from '../types.js';
3
+ export type ArNSPriceClient = {
4
+ getArNSPriceForName(params: ArNSPriceParams): Promise<ArNSPriceResponse>;
5
+ };
6
+ export type ArNSStatusClient = {
7
+ getArNSPurchaseStatus(p: {
8
+ nonce: string;
9
+ }): Promise<ArNSPurchaseStatusResponse>;
10
+ };
11
+ export type ArNSPurchaseClient = {
12
+ buyArNSName(params: {
13
+ name: string;
14
+ type: ArNSNameType;
15
+ years?: number;
16
+ processId?: string;
17
+ paidBy?: string[];
18
+ }): Promise<ArNSPurchaseResponse>;
19
+ extendArNSLease(params: {
20
+ name: string;
21
+ years: number;
22
+ paidBy?: string[];
23
+ }): Promise<ArNSPurchaseResponse>;
24
+ increaseArNSUndernameLimit(params: {
25
+ name: string;
26
+ increaseQty: number;
27
+ paidBy?: string[];
28
+ }): Promise<ArNSPurchaseResponse>;
29
+ upgradeArNSName(params: {
30
+ name: string;
31
+ paidBy?: string[];
32
+ }): Promise<ArNSPurchaseResponse>;
33
+ };
34
+ export type ArNSCustodyClient = {
35
+ transferArNSAnt(params: {
36
+ antId: string;
37
+ target: string;
38
+ }): Promise<{
39
+ antId: string;
40
+ target: string;
41
+ name?: string;
42
+ messageId: string;
43
+ }>;
44
+ setArNSRecord(params: {
45
+ antId: string;
46
+ undername?: string;
47
+ transactionId: string;
48
+ ttlSeconds: number;
49
+ }): Promise<{
50
+ antId: string;
51
+ undername: string;
52
+ transactionId: string;
53
+ ttlSeconds: number;
54
+ messageId: string;
55
+ }>;
56
+ removeArNSRecord(params: {
57
+ antId: string;
58
+ undername: string;
59
+ }): Promise<{
60
+ antId: string;
61
+ undername: string;
62
+ messageId: string;
63
+ }>;
64
+ };
65
+ export declare function requiredNameFromOptions(options: {
66
+ name?: string;
67
+ }): string;
68
+ export declare function positiveIntFromOption(value: string | undefined, flag: string): number;
69
+ export declare function typeFromOptions(value: string | undefined): ArNSNameType;
70
+ export declare function paidByFromArNSOptions(paidBy: string[] | undefined): string[] | undefined;
71
+ /**
72
+ * Infer the ArNS pricing intent from the provided flags:
73
+ * - `--type` present -> Buy-Name (lease needs --years; --process-id optional for pricing)
74
+ * - `--increase-qty` present -> Increase-Undername-Limit
75
+ * - `--years` present (no type) -> Extend-Lease
76
+ * - otherwise -> Upgrade-Name
77
+ */
78
+ export declare function arnsPriceParamsFromOptions(options: ArNSPriceOptions): ArNSPriceParams;
79
+ export declare function arnsPrice(options: ArNSPriceOptions, turbo?: ArNSPriceClient): Promise<void>;
80
+ export declare function buyArNSName(options: ArNSPurchaseOptions, turbo?: ArNSPurchaseClient): Promise<void>;
81
+ export declare function extendArNSLease(options: ArNSPurchaseOptions, turbo?: ArNSPurchaseClient): Promise<void>;
82
+ export declare function increaseArNSUndernames(options: ArNSPurchaseOptions, turbo?: ArNSPurchaseClient): Promise<void>;
83
+ export declare function upgradeArNSName(options: ArNSPurchaseOptions, turbo?: ArNSPurchaseClient): Promise<void>;
84
+ export declare function arnsPurchaseStatus(options: ArNSPurchaseStatusOptions, turbo?: ArNSStatusClient): Promise<void>;
85
+ export declare function transferArNSAnt(options: TransferArNSAntOptions, turbo?: ArNSCustodyClient): Promise<void>;
86
+ export declare function setArNSRecord(options: SetArNSRecordOptions, turbo?: ArNSCustodyClient): Promise<void>;
87
+ export declare function removeArNSRecord(options: RemoveArNSRecordOptions, turbo?: ArNSCustodyClient): Promise<void>;
88
+ //# sourceMappingURL=arns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arns.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/arns.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,iB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,EAAE,GAAG,SAAS,CAEtB;AASD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,gBAAgB,GACxB,eAAe,CAwCjB;AAuCD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,gBAAgB,EACzB,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,CAAC,EAAE,kBAAkB,GACzB,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,mBAAmB,EAC5B,KAAK,CAAC,EAAE,kBAAkB,GACzB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,mBAAmB,EAC5B,KAAK,CAAC,EAAE,kBAAkB,GACzB,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,mBAAmB,EAC5B,KAAK,CAAC,EAAE,kBAAkB,GACzB,OAAO,CAAC,IAAI,CAAC,CAUf;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,EAClC,KAAK,CAAC,EAAE,gBAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,EAC/B,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,EAChC,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAiBf"}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export * from './arns.js';
16
17
  export * from './balance.js';
17
18
  export * from './cryptoFund.js';
18
19
  export * from './price.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
@@ -186,6 +186,50 @@ export declare const optionMap: {
186
186
  readonly alias: "--max-crypto-top-up-value <maxCryptoTopUpValue>";
187
187
  readonly description: "Maximum crypto top-up value to use for the upload. Defaults to no limit.";
188
188
  };
189
+ readonly arnsName: {
190
+ readonly alias: "--name <name>";
191
+ readonly description: "ArNS name to price, buy, or manage";
192
+ };
193
+ readonly arnsType: {
194
+ readonly alias: "--type <type>";
195
+ readonly description: "ArNS purchase type for Buy-Name: 'lease' or 'permabuy'";
196
+ };
197
+ readonly arnsYears: {
198
+ readonly alias: "--years <years>";
199
+ readonly description: "Lease duration in years (Buy-Name lease / Extend-Lease)";
200
+ };
201
+ readonly arnsIncreaseQty: {
202
+ readonly alias: "--increase-qty <qty>";
203
+ readonly description: "Number of additional undernames (Increase-Undername-Limit)";
204
+ };
205
+ readonly arnsProcessId: {
206
+ readonly alias: "--process-id <processId>";
207
+ readonly description: "ANT process ID the ArNS name resolves to (Buy-Name). Optional: omit for Turbo custodial provisioning (Turbo owns the ANT); supply for a user-owned ANT";
208
+ };
209
+ readonly arnsNonce: {
210
+ readonly alias: "--nonce <nonce>";
211
+ readonly description: "ArNS purchase nonce to look up the status for";
212
+ };
213
+ readonly arnsAntId: {
214
+ readonly alias: "--ant-id <antId>";
215
+ readonly description: "ANT (Metaplex Core asset) ID to transfer or manage";
216
+ };
217
+ readonly arnsTarget: {
218
+ readonly alias: "--target <address>";
219
+ readonly description: "Target Solana pubkey to transfer the ANT to";
220
+ };
221
+ readonly arnsUndername: {
222
+ readonly alias: "--undername <undername>";
223
+ readonly description: "ArNS undername record to set or remove (defaults to '@')";
224
+ };
225
+ readonly arnsTransactionId: {
226
+ readonly alias: "--transaction-id <transactionId>";
227
+ readonly description: "Arweave transaction ID the ArNS record resolves to";
228
+ };
229
+ readonly arnsTtlSeconds: {
230
+ readonly alias: "--ttl-seconds <ttlSeconds>";
231
+ readonly description: "TTL in seconds for the ArNS record";
232
+ };
189
233
  };
190
234
  export declare const walletOptions: ({
191
235
  readonly alias: "-w, --wallet-file <filePath>";
@@ -469,4 +513,161 @@ export declare const listSharesOptions: ({
469
513
  readonly alias: "-p, --private-key <key>";
470
514
  readonly description: "Private key to use with the action";
471
515
  })[];
516
+ export declare const arnsPriceOptions: ({
517
+ readonly alias: "--name <name>";
518
+ readonly description: "ArNS name to price, buy, or manage";
519
+ } | {
520
+ readonly alias: "--type <type>";
521
+ readonly description: "ArNS purchase type for Buy-Name: 'lease' or 'permabuy'";
522
+ } | {
523
+ readonly alias: "--years <years>";
524
+ readonly description: "Lease duration in years (Buy-Name lease / Extend-Lease)";
525
+ } | {
526
+ readonly alias: "--increase-qty <qty>";
527
+ readonly description: "Number of additional undernames (Increase-Undername-Limit)";
528
+ } | {
529
+ readonly alias: "--process-id <processId>";
530
+ readonly description: "ANT process ID the ArNS name resolves to (Buy-Name). Optional: omit for Turbo custodial provisioning (Turbo owns the ANT); supply for a user-owned ANT";
531
+ })[];
532
+ export declare const buyArNSNameOptions: ({
533
+ readonly alias: "-w, --wallet-file <filePath>";
534
+ readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
535
+ } | {
536
+ readonly alias: "-m, --mnemonic <phrase>";
537
+ readonly description: "Mnemonic to use with the action";
538
+ } | {
539
+ readonly alias: "-p, --private-key <key>";
540
+ readonly description: "Private key to use with the action";
541
+ } | {
542
+ readonly alias: "--paid-by <paidBy...>";
543
+ readonly description: "Address to pay for the upload";
544
+ readonly type: "array";
545
+ } | {
546
+ readonly alias: "--name <name>";
547
+ readonly description: "ArNS name to price, buy, or manage";
548
+ } | {
549
+ readonly alias: "--type <type>";
550
+ readonly description: "ArNS purchase type for Buy-Name: 'lease' or 'permabuy'";
551
+ } | {
552
+ readonly alias: "--years <years>";
553
+ readonly description: "Lease duration in years (Buy-Name lease / Extend-Lease)";
554
+ } | {
555
+ readonly alias: "--process-id <processId>";
556
+ readonly description: "ANT process ID the ArNS name resolves to (Buy-Name). Optional: omit for Turbo custodial provisioning (Turbo owns the ANT); supply for a user-owned ANT";
557
+ })[];
558
+ export declare const extendArNSLeaseOptions: ({
559
+ readonly alias: "-w, --wallet-file <filePath>";
560
+ readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
561
+ } | {
562
+ readonly alias: "-m, --mnemonic <phrase>";
563
+ readonly description: "Mnemonic to use with the action";
564
+ } | {
565
+ readonly alias: "-p, --private-key <key>";
566
+ readonly description: "Private key to use with the action";
567
+ } | {
568
+ readonly alias: "--paid-by <paidBy...>";
569
+ readonly description: "Address to pay for the upload";
570
+ readonly type: "array";
571
+ } | {
572
+ readonly alias: "--name <name>";
573
+ readonly description: "ArNS name to price, buy, or manage";
574
+ } | {
575
+ readonly alias: "--years <years>";
576
+ readonly description: "Lease duration in years (Buy-Name lease / Extend-Lease)";
577
+ })[];
578
+ export declare const increaseArNSUndernamesOptions: ({
579
+ readonly alias: "-w, --wallet-file <filePath>";
580
+ readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
581
+ } | {
582
+ readonly alias: "-m, --mnemonic <phrase>";
583
+ readonly description: "Mnemonic to use with the action";
584
+ } | {
585
+ readonly alias: "-p, --private-key <key>";
586
+ readonly description: "Private key to use with the action";
587
+ } | {
588
+ readonly alias: "--paid-by <paidBy...>";
589
+ readonly description: "Address to pay for the upload";
590
+ readonly type: "array";
591
+ } | {
592
+ readonly alias: "--name <name>";
593
+ readonly description: "ArNS name to price, buy, or manage";
594
+ } | {
595
+ readonly alias: "--increase-qty <qty>";
596
+ readonly description: "Number of additional undernames (Increase-Undername-Limit)";
597
+ })[];
598
+ export declare const upgradeArNSNameOptions: ({
599
+ readonly alias: "-w, --wallet-file <filePath>";
600
+ readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
601
+ } | {
602
+ readonly alias: "-m, --mnemonic <phrase>";
603
+ readonly description: "Mnemonic to use with the action";
604
+ } | {
605
+ readonly alias: "-p, --private-key <key>";
606
+ readonly description: "Private key to use with the action";
607
+ } | {
608
+ readonly alias: "--paid-by <paidBy...>";
609
+ readonly description: "Address to pay for the upload";
610
+ readonly type: "array";
611
+ } | {
612
+ readonly alias: "--name <name>";
613
+ readonly description: "ArNS name to price, buy, or manage";
614
+ })[];
615
+ export declare const arnsPurchaseStatusOptions: {
616
+ readonly alias: "--nonce <nonce>";
617
+ readonly description: "ArNS purchase nonce to look up the status for";
618
+ }[];
619
+ export declare const transferArNSAntOptions: ({
620
+ readonly alias: "-w, --wallet-file <filePath>";
621
+ readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
622
+ } | {
623
+ readonly alias: "-m, --mnemonic <phrase>";
624
+ readonly description: "Mnemonic to use with the action";
625
+ } | {
626
+ readonly alias: "-p, --private-key <key>";
627
+ readonly description: "Private key to use with the action";
628
+ } | {
629
+ readonly alias: "--ant-id <antId>";
630
+ readonly description: "ANT (Metaplex Core asset) ID to transfer or manage";
631
+ } | {
632
+ readonly alias: "--target <address>";
633
+ readonly description: "Target Solana pubkey to transfer the ANT to";
634
+ })[];
635
+ export declare const setArNSRecordOptions: ({
636
+ readonly alias: "-w, --wallet-file <filePath>";
637
+ readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
638
+ } | {
639
+ readonly alias: "-m, --mnemonic <phrase>";
640
+ readonly description: "Mnemonic to use with the action";
641
+ } | {
642
+ readonly alias: "-p, --private-key <key>";
643
+ readonly description: "Private key to use with the action";
644
+ } | {
645
+ readonly alias: "--ant-id <antId>";
646
+ readonly description: "ANT (Metaplex Core asset) ID to transfer or manage";
647
+ } | {
648
+ readonly alias: "--undername <undername>";
649
+ readonly description: "ArNS undername record to set or remove (defaults to '@')";
650
+ } | {
651
+ readonly alias: "--transaction-id <transactionId>";
652
+ readonly description: "Arweave transaction ID the ArNS record resolves to";
653
+ } | {
654
+ readonly alias: "--ttl-seconds <ttlSeconds>";
655
+ readonly description: "TTL in seconds for the ArNS record";
656
+ })[];
657
+ export declare const removeArNSRecordOptions: ({
658
+ readonly alias: "-w, --wallet-file <filePath>";
659
+ readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
660
+ } | {
661
+ readonly alias: "-m, --mnemonic <phrase>";
662
+ readonly description: "Mnemonic to use with the action";
663
+ } | {
664
+ readonly alias: "-p, --private-key <key>";
665
+ readonly description: "Private key to use with the action";
666
+ } | {
667
+ readonly alias: "--ant-id <antId>";
668
+ readonly description: "ANT (Metaplex Core asset) ID to transfer or manage";
669
+ } | {
670
+ readonly alias: "--undername <undername>";
671
+ readonly description: "ArNS undername record to set or remove (defaults to '@')";
672
+ })[];
472
673
  //# sourceMappingURL=options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/cli/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0LZ,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;IAIzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUzB,CAAC;AASF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYzB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAO/B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAyC,CAAC;AAExE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;IAK/B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;IAAwC,CAAC;AAE1E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;IAAuB,CAAC"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/cli/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;IAMhC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;IAInC,CAAC"}
@@ -89,4 +89,31 @@ export type RevokeCreditsOptions = WalletOptions & {
89
89
  address: string | undefined;
90
90
  };
91
91
  export type ListSharesOptions = RevokeCreditsOptions;
92
+ export type ArNSPriceOptions = GlobalOptions & {
93
+ name: string | undefined;
94
+ type: string | undefined;
95
+ years: string | undefined;
96
+ increaseQty: string | undefined;
97
+ processId: string | undefined;
98
+ };
99
+ export type ArNSPurchaseOptions = WalletOptions & ArNSPriceOptions & {
100
+ paidBy: string[] | undefined;
101
+ };
102
+ export type ArNSPurchaseStatusOptions = GlobalOptions & {
103
+ nonce: string | undefined;
104
+ };
105
+ export type TransferArNSAntOptions = WalletOptions & {
106
+ antId: string | undefined;
107
+ target: string | undefined;
108
+ };
109
+ export type SetArNSRecordOptions = WalletOptions & {
110
+ antId: string | undefined;
111
+ undername: string | undefined;
112
+ transactionId: string | undefined;
113
+ ttlSeconds: string | undefined;
114
+ };
115
+ export type RemoveArNSRecordOptions = WalletOptions & {
116
+ antId: string | undefined;
117
+ undername: string | undefined;
118
+ };
92
119
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,EAAE,MAAM,G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,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC"}
@@ -36,13 +36,14 @@ export declare class TurboHTTPService implements TurboHTTPServiceInterface {
36
36
  allowedStatuses?: number[];
37
37
  headers?: Partial<TurboSignedRequestHeaders> & Record<string, string>;
38
38
  }): Promise<T>;
39
- post<T>({ endpoint, signal, allowedStatuses, headers, data, x402Options, }: {
39
+ post<T>({ endpoint, signal, allowedStatuses, headers, data, x402Options, retry, }: {
40
40
  endpoint: `/${string}`;
41
41
  signal?: AbortSignal;
42
42
  allowedStatuses?: number[];
43
43
  headers?: Partial<TurboSignedRequestHeaders> & Record<string, string>;
44
44
  data: Readable | Buffer | ReadableStream | Uint8Array;
45
45
  x402Options?: X402RequestCredentials;
46
+ retry?: boolean;
46
47
  }): Promise<T>;
47
48
  private tryRequest;
48
49
  private withRetry;
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/common/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAMrB,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACvD;AAED,eAAO,MAAM,kBAAkB,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,WAQzD,CAAC;AAOH,qBAAa,gBAAiB,YAAW,yBAAyB;IAChE,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SA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E,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAAC;QACtD,WAAW,CAAC,EAAE,sBAAsB,CAAC;QAIrC,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,GAAG,OAAO,CAAC,CAAC,CAAC;YAmCA,UAAU;YA6BV,SAAS;YAsCT,QAAQ;CA8CvB"}
@@ -18,4 +18,5 @@ export * from './payment.js';
18
18
  export * from './turbo.js';
19
19
  export * from './currency.js';
20
20
  export * from './token/index.js';
21
+ export * from '../utils/errors.js';
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Currency, GetCreditShareApprovalsResponse, TokenTools, TokenType, TurboAuthenticatedPaymentServiceConfiguration, TurboAuthenticatedPaymentServiceInterface, TurboBalanceResponse, TurboCheckoutSessionParams, TurboCheckoutSessionResponse, TurboCountriesResponse, TurboCryptoFundResponse, TurboCurrenciesResponse, TurboDataItemSigner, TurboFiatEstimateForBytesResponse, TurboFiatToArResponse, TurboFundWithTokensParams, TurboLogger, TurboPaymentIntentParams, TurboPaymentIntentResponse, TurboPriceResponse, TurboRatesResponse, TurboSignedRequestHeaders, TurboSubmitFundTxResponse, TurboTokenPriceForBytesResponse, TurboUnauthenticatedPaymentServiceConfiguration, TurboUnauthenticatedPaymentServiceInterface, TurboWincForFiatParams, TurboWincForFiatResponse, TurboWincForTokenParams, TurboWincForTokenResponse, UserAddress } from '../types.js';
1
+ import { ArNSBuyNameArgs, ArNSExtendLeaseParams, ArNSIncreaseUndernameLimitParams, ArNSPaidByParams, ArNSPriceParams, ArNSPriceResponse, ArNSPurchaseParams, ArNSPurchaseResponse, ArNSPurchaseStatusResponse, ArNSUpgradeNameParams, Currency, GetCreditShareApprovalsResponse, TokenTools, TokenType, TurboAuthenticatedPaymentServiceConfiguration, TurboAuthenticatedPaymentServiceInterface, TurboBalanceResponse, TurboCheckoutSessionParams, TurboCheckoutSessionResponse, TurboCountriesResponse, TurboCryptoFundResponse, TurboCurrenciesResponse, TurboDataItemSigner, TurboFiatEstimateForBytesResponse, TurboFiatToArResponse, TurboFundWithTokensParams, TurboLogger, TurboPaymentIntentParams, TurboPaymentIntentResponse, TurboPriceResponse, TurboRatesResponse, TurboSignedRequestHeaders, TurboSubmitFundTxResponse, TurboTokenPriceForBytesResponse, TurboUnauthenticatedPaymentServiceConfiguration, TurboUnauthenticatedPaymentServiceInterface, TurboWincForFiatParams, TurboWincForFiatResponse, TurboWincForTokenParams, TurboWincForTokenResponse, UserAddress } from '../types.js';
2
2
  import { TurboHTTPService } from './http.js';
3
3
  export declare const developmentPaymentServiceURL = "https://payment.ardrive.dev";
4
4
  export declare const defaultPaymentServiceURL = "https://payment.ardrive.io";
@@ -20,6 +20,23 @@ export declare class TurboUnauthenticatedPaymentService implements TurboUnauthen
20
20
  }): Promise<TurboPriceResponse[]>;
21
21
  getWincForFiat({ amount, promoCodes, nativeAddress, }: TurboWincForFiatParams): Promise<TurboWincForFiatResponse>;
22
22
  getWincForToken({ tokenAmount, }: TurboWincForTokenParams): Promise<TurboWincForTokenResponse>;
23
+ getArNSPriceForName(params: ArNSPriceParams): Promise<ArNSPriceResponse>;
24
+ /**
25
+ * Fail fast (client-side) on malformed ArNS requests so JS callers that bypass
26
+ * the compile-time intent unions get a clear `ProvidedInputError` instead of an
27
+ * opaque service 4xx. Enforces the required fields per intent:
28
+ * - `Buy-Name`: `type` ('lease' | 'permabuy'); leases also need `years`.
29
+ * `processId` is OPTIONAL — omit it to have the bundler custodially
30
+ * provision the ANT (Turbo owns it), supply it for a user-owned ANT.
31
+ * - `Extend-Lease`: positive `years`
32
+ * - `Increase-Undername-Limit`: positive `increaseQty`
33
+ * - `Upgrade-Name`: just `name`
34
+ */
35
+ protected validateArNSPurchaseParams(params: ArNSPriceParams): void;
36
+ getArNSPurchaseStatus({ nonce, }: {
37
+ nonce: string;
38
+ }): Promise<ArNSPurchaseStatusResponse>;
39
+ protected buildArNSPurchaseQuery(input: ArNSPurchaseParams): string;
23
40
  protected appendPromoCodesToQuery(promoCodes: string[]): string;
24
41
  getTurboCryptoWallets(): Promise<Record<TokenType, string>>;
25
42
  protected getCheckout({ amount, owner, promoCodes, uiMode, ...callbackUrls }: TurboCheckoutSessionParams, type?: 'checkout-session' | 'payment-intent', headers?: TurboSignedRequestHeaders): Promise<TurboCheckoutSessionResponse>;
@@ -44,6 +61,52 @@ export declare class TurboAuthenticatedPaymentService extends TurboUnauthenticat
44
61
  protected readonly tokenTools: TokenTools | undefined;
45
62
  constructor({ url, retryConfig, signer, logger, token, tokenTools, }: TurboAuthenticatedPaymentServiceConfiguration);
46
63
  getBalance(userAddress?: string): Promise<TurboBalanceResponse>;
64
+ /**
65
+ * Buy / extend / upgrade an ArNS name, paying with the signer's Turbo credit
66
+ * balance. The bundler performs the on-chain ARIO purchase and debits credits;
67
+ * a `402` (FailedRequestError.status === 402) indicates insufficient credits.
68
+ */
69
+ purchaseArNSName(params: ArNSPurchaseParams): Promise<ArNSPurchaseResponse>;
70
+ buyArNSName(params: ArNSBuyNameArgs): Promise<ArNSPurchaseResponse>;
71
+ extendArNSLease(params: Omit<ArNSExtendLeaseParams, 'intent'> & ArNSPaidByParams): Promise<ArNSPurchaseResponse>;
72
+ increaseArNSUndernameLimit(params: Omit<ArNSIncreaseUndernameLimitParams, 'intent'> & ArNSPaidByParams): Promise<ArNSPurchaseResponse>;
73
+ upgradeArNSName(params: Omit<ArNSUpgradeNameParams, 'intent'> & ArNSPaidByParams): Promise<ArNSPurchaseResponse>;
74
+ private buildArNSCustodyMessage;
75
+ /**
76
+ * Self-custody exit: move a Turbo-custodied ANT to a Solana pubkey you control.
77
+ * Authenticated with an action-bound, single-use signature.
78
+ */
79
+ transferArNSAnt({ antId, target, }: {
80
+ antId: string;
81
+ target: string;
82
+ }): Promise<{
83
+ antId: string;
84
+ target: string;
85
+ name?: string;
86
+ messageId: string;
87
+ }>;
88
+ /** Set a resolution record on a custodied ANT (undername defaults to '@'). */
89
+ setArNSRecord({ antId, undername, transactionId, ttlSeconds, }: {
90
+ antId: string;
91
+ undername?: string;
92
+ transactionId: string;
93
+ ttlSeconds: number;
94
+ }): Promise<{
95
+ antId: string;
96
+ undername: string;
97
+ transactionId: string;
98
+ ttlSeconds: number;
99
+ messageId: string;
100
+ }>;
101
+ /** Remove a resolution record (an undername) from a custodied ANT. */
102
+ removeArNSRecord({ antId, undername, }: {
103
+ antId: string;
104
+ undername: string;
105
+ }): Promise<{
106
+ antId: string;
107
+ undername: string;
108
+ messageId: string;
109
+ }>;
47
110
  getCreditShareApprovals({ userAddress, }: {
48
111
  userAddress?: string;
49
112
  }): Promise<GetCreditShareApprovalsResponse>;