@ardrive/turbo-sdk 1.42.0 → 1.43.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.
Files changed (99) hide show
  1. package/lib/cjs/cli/cli.js +97 -0
  2. package/lib/cjs/cli/commands/arns.js +475 -0
  3. package/lib/cjs/cli/commands/freeStatus.js +47 -0
  4. package/lib/cjs/cli/commands/index.js +3 -0
  5. package/lib/cjs/cli/commands/paymentHistory.js +25 -0
  6. package/lib/cjs/cli/options.js +202 -1
  7. package/lib/cjs/common/arnsActions.js +125 -0
  8. package/lib/cjs/common/chunked.js +51 -1
  9. package/lib/cjs/common/folderIndex.js +401 -0
  10. package/lib/cjs/common/http.js +40 -6
  11. package/lib/cjs/common/index.js +7 -0
  12. package/lib/cjs/common/payment.js +548 -2
  13. package/lib/cjs/common/signer.js +27 -6
  14. package/lib/cjs/common/token/index.js +0 -11
  15. package/lib/cjs/common/turbo.js +162 -0
  16. package/lib/cjs/common/upload.js +314 -31
  17. package/lib/cjs/node/folderIndex.js +132 -0
  18. package/lib/cjs/node/index.js +1 -0
  19. package/lib/cjs/node/upload.js +7 -0
  20. package/lib/cjs/types.js +53 -3
  21. package/lib/cjs/utils/common.js +0 -4
  22. package/lib/cjs/utils/errors.js +38 -1
  23. package/lib/cjs/utils/folderIndex.js +88 -0
  24. package/lib/cjs/utils/uuid.js +31 -0
  25. package/lib/cjs/web/signer.js +4 -2
  26. package/lib/esm/cli/cli.js +99 -2
  27. package/lib/esm/cli/commands/arns.js +450 -0
  28. package/lib/esm/cli/commands/freeStatus.js +44 -0
  29. package/lib/esm/cli/commands/index.js +3 -0
  30. package/lib/esm/cli/commands/paymentHistory.js +22 -0
  31. package/lib/esm/cli/options.js +201 -0
  32. package/lib/esm/common/arnsActions.js +114 -0
  33. package/lib/esm/common/chunked.js +51 -1
  34. package/lib/esm/common/folderIndex.js +396 -0
  35. package/lib/esm/common/http.js +39 -5
  36. package/lib/esm/common/index.js +7 -0
  37. package/lib/esm/common/payment.js +548 -2
  38. package/lib/esm/common/signer.js +28 -7
  39. package/lib/esm/common/token/index.js +1 -12
  40. package/lib/esm/common/turbo.js +162 -0
  41. package/lib/esm/common/upload.js +316 -33
  42. package/lib/esm/node/folderIndex.js +129 -0
  43. package/lib/esm/node/index.js +1 -0
  44. package/lib/esm/node/upload.js +7 -0
  45. package/lib/esm/types.js +52 -2
  46. package/lib/esm/utils/common.js +0 -4
  47. package/lib/esm/utils/errors.js +35 -0
  48. package/lib/esm/utils/folderIndex.js +81 -0
  49. package/lib/esm/utils/uuid.js +28 -0
  50. package/lib/esm/web/signer.js +4 -2
  51. package/lib/types/cli/commands/arns.d.ts +147 -0
  52. package/lib/types/cli/commands/arns.d.ts.map +1 -0
  53. package/lib/types/cli/commands/freeStatus.d.ts +3 -0
  54. package/lib/types/cli/commands/freeStatus.d.ts.map +1 -0
  55. package/lib/types/cli/commands/index.d.ts +3 -0
  56. package/lib/types/cli/commands/index.d.ts.map +1 -1
  57. package/lib/types/cli/commands/paymentHistory.d.ts +18 -0
  58. package/lib/types/cli/commands/paymentHistory.d.ts.map +1 -0
  59. package/lib/types/cli/options.d.ts +423 -0
  60. package/lib/types/cli/options.d.ts.map +1 -1
  61. package/lib/types/cli/types.d.ts +78 -0
  62. package/lib/types/cli/types.d.ts.map +1 -1
  63. package/lib/types/common/arnsActions.d.ts +58 -0
  64. package/lib/types/common/arnsActions.d.ts.map +1 -0
  65. package/lib/types/common/chunked.d.ts +47 -2
  66. package/lib/types/common/chunked.d.ts.map +1 -1
  67. package/lib/types/common/folderIndex.d.ts +54 -0
  68. package/lib/types/common/folderIndex.d.ts.map +1 -0
  69. package/lib/types/common/http.d.ts +25 -2
  70. package/lib/types/common/http.d.ts.map +1 -1
  71. package/lib/types/common/index.d.ts +3 -0
  72. package/lib/types/common/index.d.ts.map +1 -1
  73. package/lib/types/common/payment.d.ts +291 -1
  74. package/lib/types/common/payment.d.ts.map +1 -1
  75. package/lib/types/common/signer.d.ts +12 -6
  76. package/lib/types/common/signer.d.ts.map +1 -1
  77. package/lib/types/common/token/index.d.ts.map +1 -1
  78. package/lib/types/common/turbo.d.ts +183 -1
  79. package/lib/types/common/turbo.d.ts.map +1 -1
  80. package/lib/types/common/upload.d.ts +41 -0
  81. package/lib/types/common/upload.d.ts.map +1 -1
  82. package/lib/types/node/folderIndex.d.ts +28 -0
  83. package/lib/types/node/folderIndex.d.ts.map +1 -0
  84. package/lib/types/node/index.d.ts +1 -0
  85. package/lib/types/node/index.d.ts.map +1 -1
  86. package/lib/types/node/upload.d.ts +1 -0
  87. package/lib/types/node/upload.d.ts.map +1 -1
  88. package/lib/types/types.d.ts +694 -3
  89. package/lib/types/types.d.ts.map +1 -1
  90. package/lib/types/utils/common.d.ts.map +1 -1
  91. package/lib/types/utils/errors.d.ts +29 -0
  92. package/lib/types/utils/errors.d.ts.map +1 -1
  93. package/lib/types/utils/folderIndex.d.ts +47 -0
  94. package/lib/types/utils/folderIndex.d.ts.map +1 -0
  95. package/lib/types/utils/uuid.d.ts +7 -0
  96. package/lib/types/utils/uuid.d.ts.map +1 -0
  97. package/lib/types/web/signer.d.ts +1 -1
  98. package/lib/types/web/signer.d.ts.map +1 -1
  99. package/package.json +1 -1
package/lib/esm/types.js CHANGED
@@ -17,7 +17,6 @@ export function isCurrency(currency) {
17
17
  export const tokenTypes = [
18
18
  'arweave',
19
19
  'ario',
20
- 'base-ario',
21
20
  'solana',
22
21
  'ethereum',
23
22
  'kyve',
@@ -36,7 +35,6 @@ export const supportedEvmSignerTokens = new Set([
36
35
  'polygon-usdc',
37
36
  'usdc',
38
37
  'base-usdc',
39
- 'base-ario',
40
38
  ]);
41
39
  export class ExistingBalanceFunding {
42
40
  }
@@ -94,3 +92,55 @@ export function isEthereumWalletAdapter(walletAdapter) {
94
92
  return 'getSigner' in walletAdapter;
95
93
  }
96
94
  export const validChunkingModes = ['force', 'disabled', 'auto'];
95
+ // ===== ArNS purchases paid with Turbo credits (via the bundler REST API) =====
96
+ export const arNSPurchaseIntents = [
97
+ 'Buy-Name',
98
+ 'Extend-Lease',
99
+ 'Increase-Undername-Limit',
100
+ 'Upgrade-Name',
101
+ ];
102
+ // ===== ArNS actions (sponsored — the current bundler surface) =====
103
+ /**
104
+ * The twelve sponsored ArNS actions.
105
+ *
106
+ * Sponsorship covers these twelve and NOTHING else. Everything else in the
107
+ * ArNS, ANT and core programs stays on the direct-signer path and costs the
108
+ * user SOL — notably `BuyReturnedName` (auctions, deliberately excluded: the
109
+ * premium is unbounded), `ClaimReservedName`, the primary-name flow (which
110
+ * lives in the ario core program), release/reassign, and ANT-LEVEL metadata.
111
+ * Note ANT-level metadata is distinct from RECORD-level metadata, which
112
+ * `set-record-metadata` does sponsor.
113
+ */
114
+ export const arNSActions = [
115
+ 'buy-name',
116
+ 'extend-lease',
117
+ 'upgrade-name',
118
+ 'increase-undername-limit',
119
+ 'set-record',
120
+ 'remove-record',
121
+ 'add-controller',
122
+ 'remove-controller',
123
+ 'transfer',
124
+ // Record-scoped. Owner-or-controller on chain, so these follow set-record's
125
+ // degrade-on-revoke shape rather than needing a signature every time.
126
+ 'set-record-metadata',
127
+ 'remove-record-metadata',
128
+ 'transfer-record',
129
+ ];
130
+ // ===== ArNS purchases paid with fiat (Stripe) — no Turbo Credits in between ====
131
+ /**
132
+ * Stripe integration mode for a fiat ArNS purchase quote.
133
+ *
134
+ * - `payment-intent` — returns a Stripe PaymentIntent. Confirm it client-side
135
+ * with `stripe.confirmCardPayment(paymentSession.client_secret, ...)`.
136
+ * - `checkout-session` — returns a Stripe Checkout Session to redirect to
137
+ * (`uiMode: 'hosted'`) or embed (`uiMode: 'embedded'`).
138
+ *
139
+ * Widened with `string & Record<never, never>` so a method added service-side is
140
+ * still callable without an SDK bump, while the known values keep autocomplete.
141
+ * (`string & {}` is the usual idiom but trips the `ban-types` lint rule.)
142
+ */
143
+ export const arNSFiatPurchaseMethods = [
144
+ 'payment-intent',
145
+ 'checkout-session',
146
+ ];
@@ -35,7 +35,6 @@ const baseMainnetRpc = 'https://mainnet.base.org';
35
35
  export const tokenToDevGatewayMap = {
36
36
  arweave: 'https://turbo-gateway.com', // No arweave test net
37
37
  ario: 'https://api.devnet.solana.com',
38
- 'base-ario': baseMainnetRpc, // No base-ario test net contract deployed
39
38
  solana: 'https://api.devnet.solana.com',
40
39
  ethereum: ethTestnetRpc,
41
40
  'base-eth': baseTestnetRpc,
@@ -49,7 +48,6 @@ export const tokenToDevGatewayMap = {
49
48
  export const defaultProdGatewayUrls = {
50
49
  arweave: 'https://turbo-gateway.com',
51
50
  ario: 'https://api.mainnet-beta.solana.com',
52
- 'base-ario': baseMainnetRpc,
53
51
  solana: 'https://api.mainnet-beta.solana.com',
54
52
  ethereum: 'https://cloudflare-eth.com/',
55
53
  'base-eth': baseMainnetRpc,
@@ -87,7 +85,6 @@ export function createTurboSigner({ signer: clientProvidedSigner, privateKey: cl
87
85
  case 'base-eth':
88
86
  case 'usdc':
89
87
  case 'base-usdc':
90
- case 'base-ario':
91
88
  case 'polygon-usdc':
92
89
  if (!isEthPrivateKey(clientProvidedPrivateKey)) {
93
90
  throw new Error('A valid Ethereum private key must be provided for EthereumSigner.');
@@ -152,7 +149,6 @@ export function isValidUserAddress(address, type) {
152
149
  case 'matic':
153
150
  case 'pol':
154
151
  case 'base-usdc':
155
- case 'base-ario':
156
152
  case 'usdc':
157
153
  case 'polygon-usdc':
158
154
  return isValidECDSAAddress(address);
@@ -35,6 +35,41 @@ 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
+ }
55
+ /**
56
+ * Raised when the payment service has fiat (Stripe) payments switched off, which
57
+ * it signals with `503` and the body "Fiat (Stripe) ArNS payments are disabled".
58
+ * This is a normal state in the testnet sandbox, not an outage.
59
+ *
60
+ * Distinguished from a generic `503` deliberately: the same status is also used
61
+ * for internal errors (body "Internal Server Error: ..."), so status alone is
62
+ * ambiguous. Recovery: fall back to the credit-paid path (`buyArNSName` and
63
+ * friends), or surface fiat checkout as unavailable.
64
+ */
65
+ export class FiatPaymentsDisabledError extends BaseError {
66
+ constructor(message) {
67
+ super(message ??
68
+ 'Fiat (Stripe) payments are disabled on this payment service. Use the credit-paid purchase path instead.');
69
+ /** Always the HTTP status that produced this error. */
70
+ this.status = 503;
71
+ }
72
+ }
38
73
  export class AbortError extends BaseError {
39
74
  constructor(message = 'Request was aborted') {
40
75
  super(message);
@@ -0,0 +1,81 @@
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
+ /**
17
+ * Internals shared by the folder index layers and by `uploadFolder`. Not part
18
+ * of the package's public surface.
19
+ */
20
+ /** Tag carrying the sha-256 of a file's own bytes, as lowercase hex. */
21
+ export const contentHashTagName = 'File-SHA256';
22
+ const contentHashRegex = /^[0-9a-f]{64}$/;
23
+ const folderIndexKeyRegex = /^[0-9a-f]{64}\.[0-9a-f]{64}$/;
24
+ /** True for a lowercase hex sha-256 digest of a file's bytes. */
25
+ export function isValidContentHash(hash) {
26
+ return hash !== undefined && contentHashRegex.test(hash);
27
+ }
28
+ /**
29
+ * A folder index key is `<sha-256 of the bytes>.<sha-256 of the tags>`.
30
+ *
31
+ * Both halves matter. Keying on the bytes alone would reuse an item whose tags
32
+ * are not the ones the caller asked for: an empty `a.css` and an empty `b.js`
33
+ * hash identically, and reusing one for the other would serve JavaScript as
34
+ * `text/css`. Keying on the tags as well means a reused data item is always
35
+ * exactly the data item this call would otherwise have created.
36
+ *
37
+ * The bytes half is kept in the clear so a layer that queries a gateway can
38
+ * recover it and filter on the `File-SHA256` tag.
39
+ */
40
+ export function isValidFolderIndexKey(key) {
41
+ return key !== undefined && folderIndexKeyRegex.test(key);
42
+ }
43
+ /** The bytes half of a folder index key. */
44
+ export function contentHashFromFolderIndexKey(key) {
45
+ return key.slice(0, 64);
46
+ }
47
+ async function sha256Hex(data) {
48
+ const digest = await crypto.subtle.digest('SHA-256', data);
49
+ return Buffer.from(digest).toString('hex');
50
+ }
51
+ /**
52
+ * Canonical encoding of a tag set: the same tags in a different order encode
53
+ * identically, because two data items that differ only in tag order are the
54
+ * same item as far as reuse goes.
55
+ *
56
+ * The sort compares code units rather than using `localeCompare`, which is not
57
+ * a total order over distinct strings and depends on the host's ICU data --
58
+ * NFC and NFD spellings of the same word compare equal without being equal, and
59
+ * two locales disagree on where an accented letter sorts. Either would let one
60
+ * tag set hash differently on two machines, which costs a reuse.
61
+ *
62
+ * The encoding has to be injective, not merely stable. An ANS-104 tag name and
63
+ * value are arbitrary byte arrays, so a delimiter-joined string collides: with
64
+ * a 0x00/0x01 join, a single tag whose value embeds both delimiters encodes
65
+ * exactly like two separate tags. A collision here is a wrong reuse, which is
66
+ * the one failure the composite key exists to make impossible. JSON escapes
67
+ * the delimiters, so no value can forge a record boundary.
68
+ */
69
+ function canonicalTags(tags) {
70
+ const pairs = tags
71
+ .map((tag) => [tag.name, tag.value])
72
+ .sort(([aName, aValue], [bName, bValue]) => {
73
+ const [a, b] = aName === bName ? [aValue, bValue] : [aName, bName];
74
+ return a < b ? -1 : a > b ? 1 : 0;
75
+ });
76
+ return new TextEncoder().encode(JSON.stringify(pairs));
77
+ }
78
+ /** The folder index key for a file with these bytes and these final tags. */
79
+ export async function folderIndexKey({ contentHash, tags, }) {
80
+ return `${contentHash}.${await sha256Hex(canonicalTags(tags))}`;
81
+ }
@@ -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,147 @@
1
+ import { ArNSAction, ArNSActionPriceResponse, ArNSFiatPurchaseQuoteParams, ArNSFiatPurchaseQuoteResponse, ArNSNameType, ArNSPriceParams, ArNSPriceResponse, ArNSPurchaseStatusResponse } from '../../types.js';
2
+ import { ArNSActionCompleted, ArNSActionResult, ArNSOwnerSigner } from '../../types.js';
3
+ import { AddArNSControllerOptions, ArNSActionPriceOptions, ArNSActionStatusOptions, ArNSFiatQuoteOptions, ArNSPriceOptions, ArNSPurchaseOptions, ArNSPurchaseStatusOptions, RemoveArNSControllerOptions, RemoveArNSRecordMetadataOptions, RemoveArNSRecordOptions, SetArNSRecordMetadataOptions, SetArNSRecordOptions, TransferArNSAntOptions, TransferArNSRecordOptions } from '../types.js';
4
+ export type ArNSPriceClient = {
5
+ getArNSPriceForName(params: ArNSPriceParams): Promise<ArNSPriceResponse>;
6
+ };
7
+ export type ArNSStatusClient = {
8
+ getArNSPurchaseStatus(p: {
9
+ nonce: string;
10
+ }): Promise<ArNSPurchaseStatusResponse>;
11
+ };
12
+ export type ArNSActionStatusClient = {
13
+ getArNSActionStatus(nonce: string): Promise<ArNSActionResult & {
14
+ failedDate?: string;
15
+ }>;
16
+ };
17
+ export type ArNSPurchaseClient = {
18
+ buyArNSName(params: {
19
+ name: string;
20
+ owner: ArNSOwnerSigner;
21
+ type?: ArNSNameType;
22
+ years?: number;
23
+ paidBy?: string[];
24
+ }): Promise<ArNSActionCompleted>;
25
+ extendArNSLease(params: {
26
+ name: string;
27
+ years: number;
28
+ paidBy?: string[];
29
+ }): Promise<ArNSActionCompleted>;
30
+ increaseArNSUndernameLimit(params: {
31
+ name: string;
32
+ increaseQty: number;
33
+ paidBy?: string[];
34
+ }): Promise<ArNSActionCompleted>;
35
+ upgradeArNSName(params: {
36
+ name: string;
37
+ paidBy?: string[];
38
+ }): Promise<ArNSActionCompleted>;
39
+ };
40
+ export type ArNSCustodyClient = {
41
+ transferArNSAnt(params: {
42
+ antId: string;
43
+ owner: ArNSOwnerSigner;
44
+ target: string;
45
+ }): Promise<ArNSActionCompleted>;
46
+ setArNSRecord(params: {
47
+ antId: string;
48
+ owner: ArNSOwnerSigner;
49
+ transactionId: string;
50
+ undername?: string;
51
+ ttlSeconds?: number;
52
+ }): Promise<ArNSActionCompleted>;
53
+ removeArNSRecord(params: {
54
+ antId: string;
55
+ owner: ArNSOwnerSigner;
56
+ undername: string;
57
+ }): Promise<ArNSActionCompleted>;
58
+ addArNSController(params: {
59
+ antId: string;
60
+ owner: ArNSOwnerSigner;
61
+ target?: string;
62
+ }): Promise<ArNSActionCompleted>;
63
+ removeArNSController(params: {
64
+ antId: string;
65
+ owner: ArNSOwnerSigner;
66
+ target?: string;
67
+ }): Promise<ArNSActionCompleted>;
68
+ setArNSRecordMetadata(params: {
69
+ antId: string;
70
+ owner: ArNSOwnerSigner;
71
+ undername?: string;
72
+ displayName?: string | null;
73
+ recordLogo?: string | null;
74
+ recordDescription?: string | null;
75
+ recordKeywords?: string[] | null;
76
+ }): Promise<ArNSActionCompleted>;
77
+ removeArNSRecordMetadata(params: {
78
+ antId: string;
79
+ owner: ArNSOwnerSigner;
80
+ undername: string;
81
+ }): Promise<ArNSActionCompleted>;
82
+ transferArNSRecord(params: {
83
+ antId: string;
84
+ owner: ArNSOwnerSigner;
85
+ undername: string;
86
+ target: string;
87
+ }): Promise<ArNSActionCompleted>;
88
+ };
89
+ export type ArNSActionPriceClient = {
90
+ getArNSActionPrice(action: ArNSAction): Promise<ArNSActionPriceResponse>;
91
+ };
92
+ export declare function requiredNameFromOptions(options: {
93
+ name?: string;
94
+ }): string;
95
+ export declare function positiveIntFromOption(value: string | undefined, flag: string): number;
96
+ export declare function typeFromOptions(value: string | undefined): ArNSNameType;
97
+ /** Parses `--action` for `arns-action-price`, rejecting the four purchase actions. */
98
+ export declare function actionFromOptions(options: {
99
+ action?: string;
100
+ }): ArNSAction;
101
+ export declare function paidByFromArNSOptions(paidBy: string[] | undefined): string[] | undefined;
102
+ /**
103
+ * Infer the ArNS pricing intent from the provided flags:
104
+ * - `--type` present -> Buy-Name (lease needs --years; --process-id optional for pricing)
105
+ * - `--increase-qty` present -> Increase-Undername-Limit
106
+ * - `--years` present (no type) -> Extend-Lease
107
+ * - otherwise -> Upgrade-Name
108
+ */
109
+ export declare function arnsPriceParamsFromOptions(options: ArNSPriceOptions): ArNSPriceParams;
110
+ export declare function arnsPrice(options: ArNSPriceOptions, turbo?: ArNSPriceClient): Promise<void>;
111
+ /**
112
+ * Fiat (Stripe) quote for an ArNS purchase. Read-only from the CLI's point of
113
+ * view: it records a quote and returns a Stripe session to complete elsewhere,
114
+ * so nothing is charged here.
115
+ */
116
+ export type ArNSFiatQuoteClient = {
117
+ getArNSFiatPurchaseQuote(params: ArNSFiatPurchaseQuoteParams): Promise<ArNSFiatPurchaseQuoteResponse>;
118
+ };
119
+ export declare function arnsFiatQuote(options: ArNSFiatQuoteOptions, turbo?: ArNSFiatQuoteClient): Promise<void>;
120
+ export declare function buyArNSName(options: ArNSPurchaseOptions, turbo?: ArNSPurchaseClient): Promise<void>;
121
+ export declare function extendArNSLease(options: ArNSPurchaseOptions, turbo?: ArNSPurchaseClient): Promise<void>;
122
+ export declare function increaseArNSUndernames(options: ArNSPurchaseOptions, turbo?: ArNSPurchaseClient): Promise<void>;
123
+ export declare function upgradeArNSName(options: ArNSPurchaseOptions, turbo?: ArNSPurchaseClient): Promise<void>;
124
+ export declare function arnsPurchaseStatus(options: ArNSPurchaseStatusOptions, turbo?: ArNSStatusClient): Promise<void>;
125
+ /**
126
+ * Status of a credit-paid ArNS action (buy, extend, upgrade, increase, and the
127
+ * eight non-purchase actions). Distinct from `arns-purchase-status`, which
128
+ * reads the `/arns/purchase/` namespace that fiat quotes land in.
129
+ *
130
+ * Authenticated because `getArNSActionStatus` lives on the authenticated
131
+ * client, though the route itself needs no signature.
132
+ */
133
+ export declare function arnsActionStatus(options: ArNSActionStatusOptions, turbo?: ArNSActionStatusClient): Promise<void>;
134
+ export declare function transferArNSAnt(options: TransferArNSAntOptions, turbo?: ArNSCustodyClient): Promise<void>;
135
+ export declare function setArNSRecord(options: SetArNSRecordOptions, turbo?: ArNSCustodyClient): Promise<void>;
136
+ export declare function removeArNSRecord(options: RemoveArNSRecordOptions, turbo?: ArNSCustodyClient): Promise<void>;
137
+ export declare function addArNSController(options: AddArNSControllerOptions, turbo?: ArNSCustodyClient): Promise<void>;
138
+ export declare function removeArNSController(options: RemoveArNSControllerOptions, turbo?: ArNSCustodyClient): Promise<void>;
139
+ export declare function transferArNSRecord(options: TransferArNSRecordOptions, turbo?: ArNSCustodyClient): Promise<void>;
140
+ export declare function setArNSRecordMetadata(options: SetArNSRecordMetadataOptions, turbo?: ArNSCustodyClient): Promise<void>;
141
+ export declare function removeArNSRecordMetadata(options: RemoveArNSRecordMetadataOptions, turbo?: ArNSCustodyClient): Promise<void>;
142
+ /**
143
+ * Preview what one of the eight non-purchase actions will debit, without
144
+ * creating it.
145
+ */
146
+ export declare function arnsActionPrice(options: ArNSActionPriceOptions, turbo?: ArNSActionPriceClient): Promise<void>;
147
+ //# sourceMappingURL=arns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arns.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/arns.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAG3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EAChB,MAA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,CAAC,EAAE,sBAAsB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,EAC/B,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,EAChC,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,EACjC,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,2BAA2B,EACpC,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,EAClC,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,4BAA4B,EACrC,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAyCf;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,+BAA+B,EACxC,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,EAC/B,KAAK,CAAC,EAAE,qBAAqB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAaf"}
@@ -0,0 +1,3 @@
1
+ import { AddressOptions } from '../types.js';
2
+ export declare function freeStatus(options: AddressOptions): Promise<void>;
3
+ //# sourceMappingURL=freeStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"freeStatus.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/freeStatus.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,iBA8BvD"}
@@ -13,8 +13,11 @@
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';
19
+ export * from './freeStatus.js';
20
+ export * from './paymentHistory.js';
18
21
  export * from './price.js';
19
22
  export * from './topUp.js';
20
23
  export * from './uploadFile.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,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,18 @@
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 { PaymentHistoryOptions } from '../types.js';
17
+ export declare function paymentHistory(options: PaymentHistoryOptions): Promise<void>;
18
+ //# sourceMappingURL=paymentHistory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentHistory.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/paymentHistory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,iBA4BlE"}