@ardrive/turbo-sdk 1.41.3 → 1.42.0-alpha.10
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/lib/cjs/cli/cli.js +61 -0
- package/lib/cjs/cli/commands/arns.js +317 -0
- package/lib/cjs/cli/commands/freeStatus.js +47 -0
- package/lib/cjs/cli/commands/index.js +3 -0
- package/lib/cjs/cli/commands/paymentHistory.js +25 -0
- package/lib/cjs/cli/options.js +124 -11
- package/lib/cjs/cli/utils.js +3 -19
- package/lib/cjs/common/arnsActions.js +102 -0
- package/lib/cjs/common/factory.js +1 -3
- package/lib/cjs/common/http.js +20 -5
- package/lib/cjs/common/index.js +6 -0
- package/lib/cjs/common/payment.js +482 -3
- package/lib/cjs/common/signer.js +27 -6
- package/lib/cjs/common/token/ario.js +104 -83
- package/lib/cjs/common/token/index.js +0 -11
- package/lib/cjs/common/token/solana.js +1 -0
- package/lib/cjs/common/turbo.js +131 -0
- package/lib/cjs/common/upload.js +3 -2
- package/lib/cjs/node/factory.js +1 -3
- package/lib/cjs/types.js +44 -3
- package/lib/cjs/utils/common.js +5 -21
- package/lib/cjs/utils/errors.js +38 -1
- package/lib/cjs/utils/uuid.js +31 -0
- package/lib/cjs/web/factory.js +1 -3
- package/lib/cjs/web/signer.js +4 -2
- package/lib/esm/cli/cli.js +63 -2
- package/lib/esm/cli/commands/arns.js +300 -0
- package/lib/esm/cli/commands/freeStatus.js +44 -0
- package/lib/esm/cli/commands/index.js +3 -0
- package/lib/esm/cli/commands/paymentHistory.js +22 -0
- package/lib/esm/cli/options.js +123 -10
- package/lib/esm/cli/utils.js +4 -20
- package/lib/esm/common/arnsActions.js +93 -0
- package/lib/esm/common/factory.js +1 -3
- package/lib/esm/common/http.js +19 -4
- package/lib/esm/common/index.js +6 -0
- package/lib/esm/common/payment.js +482 -3
- package/lib/esm/common/signer.js +28 -7
- package/lib/esm/common/token/ario.js +102 -84
- package/lib/esm/common/token/index.js +1 -12
- package/lib/esm/common/token/solana.js +1 -0
- package/lib/esm/common/turbo.js +131 -0
- package/lib/esm/common/upload.js +4 -3
- package/lib/esm/node/factory.js +1 -3
- package/lib/esm/types.js +43 -2
- package/lib/esm/utils/common.js +4 -20
- package/lib/esm/utils/errors.js +35 -0
- package/lib/esm/utils/uuid.js +28 -0
- package/lib/esm/web/factory.js +1 -3
- package/lib/esm/web/signer.js +4 -2
- package/lib/types/cli/commands/arns.d.ts +86 -0
- package/lib/types/cli/commands/arns.d.ts.map +1 -0
- package/lib/types/cli/commands/freeStatus.d.ts +3 -0
- package/lib/types/cli/commands/freeStatus.d.ts.map +1 -0
- package/lib/types/cli/commands/index.d.ts +3 -0
- package/lib/types/cli/commands/index.d.ts.map +1 -1
- package/lib/types/cli/commands/paymentHistory.d.ts +18 -0
- package/lib/types/cli/commands/paymentHistory.d.ts.map +1 -0
- package/lib/types/cli/options.d.ts +238 -10
- package/lib/types/cli/options.d.ts.map +1 -1
- package/lib/types/cli/types.d.ts +41 -2
- package/lib/types/cli/types.d.ts.map +1 -1
- package/lib/types/cli/utils.d.ts.map +1 -1
- package/lib/types/common/arnsActions.d.ts +43 -0
- package/lib/types/common/arnsActions.d.ts.map +1 -0
- package/lib/types/common/factory.d.ts +1 -1
- package/lib/types/common/factory.d.ts.map +1 -1
- package/lib/types/common/http.d.ts +14 -1
- package/lib/types/common/http.d.ts.map +1 -1
- package/lib/types/common/index.d.ts +2 -0
- package/lib/types/common/index.d.ts.map +1 -1
- package/lib/types/common/payment.d.ts +230 -1
- package/lib/types/common/payment.d.ts.map +1 -1
- package/lib/types/common/signer.d.ts +12 -6
- package/lib/types/common/signer.d.ts.map +1 -1
- package/lib/types/common/token/ario.d.ts +13 -9
- package/lib/types/common/token/ario.d.ts.map +1 -1
- package/lib/types/common/token/index.d.ts.map +1 -1
- package/lib/types/common/token/solana.d.ts.map +1 -1
- package/lib/types/common/turbo.d.ts +140 -1
- package/lib/types/common/turbo.d.ts.map +1 -1
- package/lib/types/common/upload.d.ts.map +1 -1
- package/lib/types/node/factory.d.ts +1 -1
- package/lib/types/node/factory.d.ts.map +1 -1
- package/lib/types/types.d.ts +483 -7
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/utils/common.d.ts +0 -12
- package/lib/types/utils/common.d.ts.map +1 -1
- package/lib/types/utils/errors.d.ts +29 -0
- package/lib/types/utils/errors.d.ts.map +1 -1
- package/lib/types/utils/uuid.d.ts +7 -0
- package/lib/types/utils/uuid.d.ts.map +1 -0
- package/lib/types/web/factory.d.ts +1 -1
- package/lib/types/web/factory.d.ts.map +1 -1
- package/lib/types/web/signer.d.ts +1 -1
- package/lib/types/web/signer.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -21,6 +21,18 @@ export interface RetryConfig {
|
|
|
21
21
|
onRetry: (retryCount: number, error: unknown) => void;
|
|
22
22
|
}
|
|
23
23
|
export declare const defaultRetryConfig: (logger?: TurboLogger) => RetryConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Canonical x402 upload routes on the upload service.
|
|
26
|
+
*
|
|
27
|
+
* These were previously `/x402/data-item/{signed,unsigned}`. The service
|
|
28
|
+
* renamed them to `/x402/upload/*` and kept a `data-item/signed` alias, but not
|
|
29
|
+
* a `data-item/unsigned` one — so every unsigned x402 upload 404ed. Both
|
|
30
|
+
* canonical paths are served by all released upload-service versions.
|
|
31
|
+
*/
|
|
32
|
+
export declare const x402UploadEndpoints: {
|
|
33
|
+
readonly signed: "/x402/upload/signed";
|
|
34
|
+
readonly unsigned: "/x402/upload/unsigned";
|
|
35
|
+
};
|
|
24
36
|
export declare class TurboHTTPService implements TurboHTTPServiceInterface {
|
|
25
37
|
protected baseURL: string;
|
|
26
38
|
protected logger: TurboLogger;
|
|
@@ -36,13 +48,14 @@ export declare class TurboHTTPService implements TurboHTTPServiceInterface {
|
|
|
36
48
|
allowedStatuses?: number[];
|
|
37
49
|
headers?: Partial<TurboSignedRequestHeaders> & Record<string, string>;
|
|
38
50
|
}): Promise<T>;
|
|
39
|
-
post<T>({ endpoint, signal, allowedStatuses, headers, data, x402Options, }: {
|
|
51
|
+
post<T>({ endpoint, signal, allowedStatuses, headers, data, x402Options, retry, }: {
|
|
40
52
|
endpoint: `/${string}`;
|
|
41
53
|
signal?: AbortSignal;
|
|
42
54
|
allowedStatuses?: number[];
|
|
43
55
|
headers?: Partial<TurboSignedRequestHeaders> & Record<string, string>;
|
|
44
56
|
data: Readable | Buffer | ReadableStream | Uint8Array;
|
|
45
57
|
x402Options?: X402RequestCredentials;
|
|
58
|
+
retry?: boolean;
|
|
46
59
|
}): Promise<T>;
|
|
47
60
|
private tryRequest;
|
|
48
61
|
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,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;gBAEvB,EACV,GAAG,EACH,MAAM,EACN,WAAwC,GACzC,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAA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WAAW,EAAE,WAAW,CAAC;gBAEvB,EACV,GAAG,EACH,MAAM,EACN,WAAwC,GACzC,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,WAAW,CAAC;QACzB,MAAM,EAAE,WAAW,CAAC;KACrB;IAMK,GAAG,CAAC,CAAC,EAAE,EACX,QAAQ,EACR,MAAM,EACN,eAA4B,EAC5B,OAAO,GACR,EAAE;QACD,QAAQ,EAAE,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACvE,GAAG,OAAO,CAAC,CAAC,CAAC;IAYR,IAAI,CAAC,CAAC,EAAE,EACZ,QAAQ,EACR,MAAM,EACN,eAA4B,EAC5B,OAAO,EACP,IAAI,EACJ,WAAW,EACX,KAAY,GACb,EAAE;QACD,QAAQ,EAAE,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,eAAe,CAAC,EAAE,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;CA+CvB"}
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export * from './upload.js';
|
|
17
17
|
export * from './payment.js';
|
|
18
|
+
export * from './arnsActions.js';
|
|
18
19
|
export * from './turbo.js';
|
|
19
20
|
export * from './currency.js';
|
|
20
21
|
export * from './token/index.js';
|
|
22
|
+
export * from '../utils/errors.js';
|
|
21
23
|
//# 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;
|
|
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;AAG7B,cAAc,kBAAkB,CAAC;AACjC,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 { ArNSAction, ArNSActionCompleted, ArNSActionResult, ArNSFiatPurchaseQuoteParams, ArNSFiatPurchaseQuoteResponse, ArNSNameType, ArNSOwnerSigner, ArNSPriceParams, ArNSPriceResponse, ArNSPurchaseParams, ArNSPurchaseStatusResponse, AuthenticatedArNSFiatPurchaseQuoteParams, Currency, GetCreditShareApprovalsResponse, TokenTools, TokenType, TurboArNSNamesResponse, TurboAuthenticatedPaymentServiceConfiguration, TurboAuthenticatedPaymentServiceInterface, TurboBalanceResponse, TurboCheckoutSessionParams, TurboCheckoutSessionResponse, TurboCountriesResponse, TurboCryptoFundResponse, TurboCurrenciesResponse, TurboDataItemSigner, TurboFiatEstimateForBytesResponse, TurboFiatToArResponse, TurboFreeStatusResponse, TurboFundWithTokensParams, TurboLogger, TurboPaymentHistoryParams, TurboPaymentHistoryResponse, 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";
|
|
@@ -6,8 +6,22 @@ export declare class TurboUnauthenticatedPaymentService implements TurboUnauthen
|
|
|
6
6
|
protected readonly httpService: TurboHTTPService;
|
|
7
7
|
protected logger: TurboLogger;
|
|
8
8
|
protected readonly token: TokenType;
|
|
9
|
+
private url;
|
|
9
10
|
constructor({ url, logger, retryConfig, token, }: TurboUnauthenticatedPaymentServiceConfiguration);
|
|
10
11
|
getBalance(address: string): Promise<TurboBalanceResponse>;
|
|
12
|
+
getFreeStatus(address: string): Promise<TurboFreeStatusResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the ArNS names a wallet owns or controls -- both custodial names
|
|
15
|
+
* bought via Turbo's ArNS-with-credits feature (Turbo may spawn and hold
|
|
16
|
+
* the ANT on the caller's behalf, depending on the buy) and self-custody
|
|
17
|
+
* names, in one list. See `TurboArNSName` for field semantics, including
|
|
18
|
+
* the `custodial` flag distinguishing the two.
|
|
19
|
+
*
|
|
20
|
+
* To read a name's current records or lease/expiration state, use
|
|
21
|
+
* `@ar.io/sdk` directly against the returned `antId` -- it talks to the
|
|
22
|
+
* chain directly and needs no round-trip through this SDK/backend.
|
|
23
|
+
*/
|
|
24
|
+
getArNSNames(address: string): Promise<TurboArNSNamesResponse>;
|
|
11
25
|
getFiatRates(): Promise<TurboRatesResponse>;
|
|
12
26
|
getFiatToAR({ currency, }: {
|
|
13
27
|
currency: Currency;
|
|
@@ -19,6 +33,46 @@ export declare class TurboUnauthenticatedPaymentService implements TurboUnauthen
|
|
|
19
33
|
}): Promise<TurboPriceResponse[]>;
|
|
20
34
|
getWincForFiat({ amount, promoCodes, nativeAddress, }: TurboWincForFiatParams): Promise<TurboWincForFiatResponse>;
|
|
21
35
|
getWincForToken({ tokenAmount, }: TurboWincForTokenParams): Promise<TurboWincForTokenResponse>;
|
|
36
|
+
getArNSPriceForName(params: ArNSPriceParams): Promise<ArNSPriceResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Fail fast (client-side) on malformed ArNS requests so JS callers that bypass
|
|
39
|
+
* the compile-time intent unions get a clear `ProvidedInputError` instead of an
|
|
40
|
+
* opaque service 4xx. Enforces the required fields per intent:
|
|
41
|
+
* - `Buy-Name`: `type` ('lease' | 'permabuy'); leases also need `years`.
|
|
42
|
+
* `processId` is OPTIONAL — omit it to have the bundler custodially
|
|
43
|
+
* provision the ANT (Turbo owns it), supply it for a user-owned ANT.
|
|
44
|
+
* - `Extend-Lease`: positive `years`
|
|
45
|
+
* - `Increase-Undername-Limit`: positive `increaseQty`
|
|
46
|
+
* - `Upgrade-Name`: just `name`
|
|
47
|
+
*/
|
|
48
|
+
protected validateArNSPurchaseParams(params: ArNSPriceParams): void;
|
|
49
|
+
getArNSPurchaseStatus({ nonce, }: {
|
|
50
|
+
nonce: string;
|
|
51
|
+
}): Promise<ArNSPurchaseStatusResponse>;
|
|
52
|
+
protected buildArNSPurchaseQuery(input: ArNSPurchaseParams): string;
|
|
53
|
+
/**
|
|
54
|
+
* Quote a fiat (Stripe) ArNS purchase — buy a name with a credit card in one
|
|
55
|
+
* step, with no Turbo Credits top-up in between.
|
|
56
|
+
*
|
|
57
|
+
* Returns the recorded `purchaseQuote` (its `nonce` is what
|
|
58
|
+
* `getArNSPurchaseStatus` polls) plus the Stripe `paymentSession` to complete
|
|
59
|
+
* payment with. For `payment-intent`, confirm client-side with
|
|
60
|
+
* `stripe.confirmCardPayment(paymentSession.client_secret, ...)`, then poll
|
|
61
|
+
* the nonce until the purchase reports success or failure.
|
|
62
|
+
*
|
|
63
|
+
* Throws {@link FiatPaymentsDisabledError} when the service has Stripe turned
|
|
64
|
+
* off (normal in the testnet sandbox) so callers can fall back to the
|
|
65
|
+
* credit-paid path without string-matching a generic 503.
|
|
66
|
+
*/
|
|
67
|
+
getArNSFiatPurchaseQuote(params: ArNSFiatPurchaseQuoteParams): Promise<ArNSFiatPurchaseQuoteResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Query string for a fiat quote. Distinct from `buildArNSPurchaseQuery`
|
|
70
|
+
* because this route takes `uiMode` + its paired URLs and has no `paidBy`
|
|
71
|
+
* (fiat has no delegated payer), and because promo codes must be REPEATED
|
|
72
|
+
* params here: the service reads them with `parseQueryParams`, which treats a
|
|
73
|
+
* comma-joined string as one code rather than several.
|
|
74
|
+
*/
|
|
75
|
+
protected buildArNSFiatQuoteQuery(params: ArNSFiatPurchaseQuoteParams, promoCodes: string[]): string;
|
|
22
76
|
protected appendPromoCodesToQuery(promoCodes: string[]): string;
|
|
23
77
|
getTurboCryptoWallets(): Promise<Record<TokenType, string>>;
|
|
24
78
|
protected getCheckout({ amount, owner, promoCodes, uiMode, ...callbackUrls }: TurboCheckoutSessionParams, type?: 'checkout-session' | 'payment-intent', headers?: TurboSignedRequestHeaders): Promise<TurboCheckoutSessionResponse>;
|
|
@@ -43,6 +97,181 @@ export declare class TurboAuthenticatedPaymentService extends TurboUnauthenticat
|
|
|
43
97
|
protected readonly tokenTools: TokenTools | undefined;
|
|
44
98
|
constructor({ url, retryConfig, signer, logger, token, tokenTools, }: TurboAuthenticatedPaymentServiceConfiguration);
|
|
45
99
|
getBalance(userAddress?: string): Promise<TurboBalanceResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Quote a fiat (Stripe) ArNS purchase. `address` defaults to this signer's
|
|
102
|
+
* native address — the wallet that will own the name — so the common case
|
|
103
|
+
* needs no address at all. Pass one explicitly to buy on another wallet's
|
|
104
|
+
* behalf; the route takes the destination as a path param and requires no
|
|
105
|
+
* signature, which is why it is available unauthenticated too.
|
|
106
|
+
*/
|
|
107
|
+
getArNSFiatPurchaseQuote(params: AuthenticatedArNSFiatPurchaseQuoteParams): Promise<ArNSFiatPurchaseQuoteResponse>;
|
|
108
|
+
getFreeStatus(userAddress?: string): Promise<TurboFreeStatusResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* The signer's OWN completed top-up history (crypto + fiat), merged newest
|
|
111
|
+
* first and keyset-paginated. This is a SIGNED GET: unlike `getBalance` /
|
|
112
|
+
* `getFreeStatus` (which name a wallet by `?address=`), payment history is
|
|
113
|
+
* self-scoped and returns only the rows belonging to the signing wallet — the
|
|
114
|
+
* service reads the address from the signature, never a query param.
|
|
115
|
+
*
|
|
116
|
+
* We sign the bare nonce (no action-binding of `limit`/`cursor`) to match the
|
|
117
|
+
* service's `verifySignature` middleware; the pagination params ride in the
|
|
118
|
+
* query string. Pass `cursor` from a prior response to fetch the next page.
|
|
119
|
+
*/
|
|
120
|
+
getPaymentHistory({ limit, cursor, }?: TurboPaymentHistoryParams): Promise<TurboPaymentHistoryResponse>;
|
|
121
|
+
/**
|
|
122
|
+
* Buy / extend / upgrade an ArNS name, paying with the signer's Turbo credit
|
|
123
|
+
* balance. The bundler performs the on-chain ARIO purchase and debits credits;
|
|
124
|
+
* a `402` (FailedRequestError.status === 402) indicates insufficient credits.
|
|
125
|
+
*/
|
|
126
|
+
/**
|
|
127
|
+
* Create an action. Returns `completed` or `awaiting-signature`.
|
|
128
|
+
*
|
|
129
|
+
* Credits are debited HERE, not at `/sign`. Capture the returned `nonce`
|
|
130
|
+
* before prompting for a signature: it is the idempotency key, and polling
|
|
131
|
+
* it is how you resume. Never re-create an action to "retry" — that debits
|
|
132
|
+
* a second time. An abandoned action is refunded automatically.
|
|
133
|
+
*/
|
|
134
|
+
createArNSAction(action: ArNSAction, params?: Record<string, unknown>, ownerProof?: {
|
|
135
|
+
owner: ArNSOwnerSigner;
|
|
136
|
+
message: string;
|
|
137
|
+
}): Promise<ArNSActionResult>;
|
|
138
|
+
/**
|
|
139
|
+
* Submit the owner-signed transaction for an `awaiting-signature` action.
|
|
140
|
+
*
|
|
141
|
+
* `signedTransaction` is the FULL serialized transaction, base64 — not just
|
|
142
|
+
* the signature. Replaying a completed action returns `alreadyCompleted:
|
|
143
|
+
* true` rather than buying twice, so this is safe to call again if a
|
|
144
|
+
* response is lost.
|
|
145
|
+
*/
|
|
146
|
+
signArNSAction(nonce: string, signedTransaction: string): Promise<ArNSActionCompleted>;
|
|
147
|
+
/**
|
|
148
|
+
* Status of an action by nonce. Open — no signature required — so it works
|
|
149
|
+
* from a status page or callback handler that never holds the payer's key.
|
|
150
|
+
*
|
|
151
|
+
* Terminal success carries `messageId`; terminal failure carries
|
|
152
|
+
* `failedDate`.
|
|
153
|
+
*/
|
|
154
|
+
getArNSActionStatus(nonce: string): Promise<ArNSActionResult & {
|
|
155
|
+
failedDate?: string;
|
|
156
|
+
}>;
|
|
157
|
+
/**
|
|
158
|
+
* Run an action to a terminal state, signing if the server asks for it.
|
|
159
|
+
*
|
|
160
|
+
* This is the two-shape branch, once, in one place — so callers cannot
|
|
161
|
+
* hardcode which actions need a signature and break when a customer
|
|
162
|
+
* exercises ownership.
|
|
163
|
+
*/
|
|
164
|
+
private completeArNSAction;
|
|
165
|
+
/**
|
|
166
|
+
* Buy a name. The ANT is minted straight to `owner` — Turbo never holds it.
|
|
167
|
+
*
|
|
168
|
+
* This is the ONLY action that always needs the owner's signature:
|
|
169
|
+
* `ario_ant::initialize` is the one instruction in the whole lifecycle that
|
|
170
|
+
* requires the ANT owner's key. The customer signs once, here, and never
|
|
171
|
+
* again unless they change controllers or transfer the name.
|
|
172
|
+
*
|
|
173
|
+
* The owner needs a Solana key to sign with, NOT a funded one — Turbo pays
|
|
174
|
+
* every lamport of fee and rent.
|
|
175
|
+
*/
|
|
176
|
+
buyArNSName({ name, owner, type, years, paidBy, onNonce, }: {
|
|
177
|
+
name: string;
|
|
178
|
+
owner: ArNSOwnerSigner;
|
|
179
|
+
type?: ArNSNameType;
|
|
180
|
+
years?: number;
|
|
181
|
+
paidBy?: UserAddress | UserAddress[];
|
|
182
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
183
|
+
}): Promise<ArNSActionCompleted>;
|
|
184
|
+
/** Extend a lease. Permissionless on chain — no owner signature needed. */
|
|
185
|
+
extendArNSLease({ name, years, paidBy, onNonce, }: {
|
|
186
|
+
name: string;
|
|
187
|
+
years: number;
|
|
188
|
+
paidBy?: UserAddress | UserAddress[];
|
|
189
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
190
|
+
}): Promise<ArNSActionCompleted>;
|
|
191
|
+
/** Upgrade a lease to a permanent name. No owner signature needed. */
|
|
192
|
+
upgradeArNSName({ name, paidBy, onNonce, }: {
|
|
193
|
+
name: string;
|
|
194
|
+
paidBy?: UserAddress | UserAddress[];
|
|
195
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
196
|
+
}): Promise<ArNSActionCompleted>;
|
|
197
|
+
/** Raise the undername limit. No owner signature needed. */
|
|
198
|
+
increaseArNSUndernameLimit({ name, increaseQty, paidBy, onNonce, }: {
|
|
199
|
+
name: string;
|
|
200
|
+
increaseQty: number;
|
|
201
|
+
paidBy?: UserAddress | UserAddress[];
|
|
202
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
203
|
+
}): Promise<ArNSActionCompleted>;
|
|
204
|
+
/**
|
|
205
|
+
* Point a name (or undername) at an Arweave transaction.
|
|
206
|
+
*
|
|
207
|
+
* Free — Turbo sponsors the Solana fee. Completes in one call while Turbo is
|
|
208
|
+
* a controller of the ANT, and returns `awaiting-signature` once the customer
|
|
209
|
+
* has revoked Turbo, at which point `owner` signs it themselves. Both paths
|
|
210
|
+
* are handled here.
|
|
211
|
+
*
|
|
212
|
+
* The owner proof is required EITHER WAY: Turbo is directing its own
|
|
213
|
+
* controller authority over an asset someone else owns, so nothing on chain
|
|
214
|
+
* records the owner's consent and we demand it. It is a MESSAGE signature,
|
|
215
|
+
* not a transaction — cheap and offline, but still a wallet prompt.
|
|
216
|
+
*/
|
|
217
|
+
setArNSRecord({ antId, owner, transactionId, undername, ttlSeconds, onNonce, }: {
|
|
218
|
+
antId: string;
|
|
219
|
+
owner: ArNSOwnerSigner;
|
|
220
|
+
transactionId: string;
|
|
221
|
+
undername?: string;
|
|
222
|
+
ttlSeconds?: number;
|
|
223
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
224
|
+
}): Promise<ArNSActionCompleted>;
|
|
225
|
+
/** Remove a record (an undername). Free; same two-shape rules as setArNSRecord. */
|
|
226
|
+
removeArNSRecord({ antId, owner, undername, onNonce, }: {
|
|
227
|
+
antId: string;
|
|
228
|
+
owner: ArNSOwnerSigner;
|
|
229
|
+
undername: string;
|
|
230
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
231
|
+
}): Promise<ArNSActionCompleted>;
|
|
232
|
+
/**
|
|
233
|
+
* Grant controller rights on the ANT. Omit `target` for Turbo itself, which
|
|
234
|
+
* is what makes `setArNSRecord` a single call.
|
|
235
|
+
*
|
|
236
|
+
* Owner-signed: changing an ANT's access control is an owner-only
|
|
237
|
+
* instruction. Free to the customer — Turbo funds the ACL page growth.
|
|
238
|
+
*/
|
|
239
|
+
addArNSController({ antId, owner, target, onNonce, }: {
|
|
240
|
+
antId: string;
|
|
241
|
+
owner: ArNSOwnerSigner;
|
|
242
|
+
target?: string;
|
|
243
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
244
|
+
}): Promise<ArNSActionCompleted>;
|
|
245
|
+
/**
|
|
246
|
+
* Revoke controller rights — the escape hatch that keeps "Turbo is not a
|
|
247
|
+
* custodian" honest.
|
|
248
|
+
*
|
|
249
|
+
* Always available, always free, and needs nothing from Turbo but the fee.
|
|
250
|
+
* After revoking, `setArNSRecord` keeps working: it simply starts returning
|
|
251
|
+
* `awaiting-signature` so the owner signs their own record writes.
|
|
252
|
+
*/
|
|
253
|
+
removeArNSController({ antId, owner, target, onNonce, }: {
|
|
254
|
+
antId: string;
|
|
255
|
+
owner: ArNSOwnerSigner;
|
|
256
|
+
target?: string;
|
|
257
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
258
|
+
}): Promise<ArNSActionCompleted>;
|
|
259
|
+
/**
|
|
260
|
+
* Hand the ANT to a new owner. Irreversible: after this lands, `owner` no
|
|
261
|
+
* longer controls the name. Owner-signed, and sponsored like the rest.
|
|
262
|
+
*/
|
|
263
|
+
transferArNSAnt({ antId, owner, target, onNonce, }: {
|
|
264
|
+
antId: string;
|
|
265
|
+
owner: ArNSOwnerSigner;
|
|
266
|
+
target: string;
|
|
267
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
268
|
+
}): Promise<ArNSActionCompleted>;
|
|
269
|
+
/**
|
|
270
|
+
* Defaults to the signer's own address when `userAddress` is omitted
|
|
271
|
+
* (`null`/`undefined`). Passing `''` does NOT trigger this default --
|
|
272
|
+
* mirrors `getBalance`'s existing behavior above.
|
|
273
|
+
*/
|
|
274
|
+
getArNSNames(userAddress?: string): Promise<TurboArNSNamesResponse>;
|
|
46
275
|
getCreditShareApprovals({ userAddress, }: {
|
|
47
276
|
userAddress?: string;
|
|
48
277
|
}): Promise<GetCreditShareApprovalsResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/common/payment.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,QAAQ,EACR,+BAA+B,EAE/B,UAAU,EACV,SAAS,EAET,6CAA6C,EAC7C,yCAAyC,EACzC,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,iCAAiC,EACjC,qBAAqB,EACrB,yBAAyB,EAEzB,WAAW,EACX,wBAAwB,EACxB,0BAA0B,EAE1B,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,+BAA+B,EAC/B,+CAA+C,EAC/C,2CAA2C,EAC3C,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,WAAW,
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/common/payment.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC3B,6BAA6B,EAC7B,YAAY,EACZ,eAAe,EAEf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,wCAAwC,EACxC,QAAQ,EACR,+BAA+B,EAE/B,UAAU,EACV,SAAS,EAET,sBAAsB,EACtB,6CAA6C,EAC7C,yCAAyC,EACzC,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,iCAAiC,EACjC,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EAEzB,WAAW,EACX,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,0BAA0B,EAE1B,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,+BAA+B,EAC/B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CAAC,+BAA+B,CAAC;IAK/B,cAAc,CAAC,EAC1B,MAAM,EACN,UAAe,GAChB,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAQhD,qBAAqB,CAChC,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,4BAA4B,CAAC;YAI1B,sBAAsB;IAYvB,eAAe,CAAC,EAC3B,aAAiB,EACjB,WAAW,EAAE,YAAY,EACzB,6BAA6B,GAC9B,EAAE,yBAAyB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CA0DhE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Signer as ArbundleSigner } from '@dha-team/arbundles';
|
|
2
2
|
import { Signer as x402Signer } from 'x402-fetch';
|
|
3
|
-
import { FileStreamFactory, NativeAddress, SendTxWithSignerParams, TokenType, TurboDataItemSigner, TurboDataItemSignerParams, TurboFileFactory, TurboLogger, TurboSignedDataItemFactory, TurboSigner, WalletAdapter } from '../types.js';
|
|
3
|
+
import { FileStreamFactory, NativeAddress, SendTxWithSignerParams, TokenType, TurboDataItemSigner, TurboDataItemSignerParams, TurboFileFactory, TurboLogger, TurboSignedDataItemFactory, TurboSignedRequestHeaders, TurboSigner, WalletAdapter } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Abstract class for signing TurboDataItems.
|
|
6
6
|
*/
|
|
@@ -12,16 +12,22 @@ export declare abstract class TurboDataItemAbstractSigner implements TurboDataIt
|
|
|
12
12
|
constructor({ signer, logger, token, walletAdapter, }: TurboDataItemSignerParams);
|
|
13
13
|
abstract signDataItem({ fileStreamFactory, fileSizeFactory, dataItemOpts, emitter, }: TurboFileFactory<FileStreamFactory>): Promise<TurboSignedDataItemFactory>;
|
|
14
14
|
private ownerToNativeAddress;
|
|
15
|
-
generateSignedRequestHeaders(): Promise<
|
|
16
|
-
'x-public-key': string;
|
|
17
|
-
'x-nonce': string;
|
|
18
|
-
'x-signature': string;
|
|
19
|
-
}>;
|
|
15
|
+
generateSignedRequestHeaders(nonce?: string, additionalData?: string): Promise<TurboSignedRequestHeaders>;
|
|
20
16
|
getPublicKey(): Promise<Buffer>;
|
|
21
17
|
getNativeAddress(): Promise<NativeAddress>;
|
|
22
18
|
/** Let the signer handle sending tx for better compat with cross chain libraries/web wallets */
|
|
23
19
|
sendTransaction({ target, amount, gatewayUrl, turboCreditDestinationAddress, }: SendTxWithSignerParams): Promise<string>;
|
|
24
20
|
signData(dataToSign: Uint8Array): Promise<Uint8Array>;
|
|
25
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Builds the wallet client x402-fetch signs payment authorizations with.
|
|
24
|
+
*
|
|
25
|
+
* The chain matters because `wrapFetchWithPayment` maps `walletClient.chain.id`
|
|
26
|
+
* to a network name and prefers the matching entry in the service's `accepts`
|
|
27
|
+
* list. The upload service advertises Base mainnet (`base`), and x402 support
|
|
28
|
+
* here is limited to `base-usdc`, so mainnet is the correct default. Callers
|
|
29
|
+
* needing another network can supply their own signer via
|
|
30
|
+
* `X402Funding({ signer })`.
|
|
31
|
+
*/
|
|
26
32
|
export declare function makeX402Signer(arbundlesSigner: ArbundleSigner): Promise<x402Signer>;
|
|
27
33
|
//# sourceMappingURL=signer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/common/signer.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAkB/D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,SAAS,EACT,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACX,aAAa,EAGd,MAAM,aAAa,CAAC;AAUrB;;GAEG;AACH,8BAAsB,2BACpB,YAAW,mBAAmB;IAEvB,MAAM,EAAE,WAAW,CAAC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CAAC,oBAAoB;IA+Bf,4BAA4B,CAGvC,KAAK,GAAE,MAAwC,EAM/C,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,yBAAyB,CAAC;IAexB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/B,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC;IAOvD,gGAAgG;IACnF,eAAe,CAAC,EAC3B,MAAM,EACN,MAAM,EACN,UAAU,EACV,6BAA6B,GAC9B,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IAuF9B,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAgBnE;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,eAAe,EAAE,cAAc,GAC9B,OAAO,CAAC,UAAU,CAAC,CAsCrB"}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
+
import { Connection } from '@solana/web3.js';
|
|
1
2
|
import { BigNumber } from 'bignumber.js';
|
|
2
|
-
import { TokenCreateTxParams, TokenPollingOptions, TokenTools, TurboLogger } from '../../types.js';
|
|
3
|
+
import { AoProcessConfig, TokenConfig, TokenCreateTxParams, TokenPollingOptions, TokenTools, TurboLogger } from '../../types.js';
|
|
3
4
|
export declare class ARIOToken implements TokenTools {
|
|
4
5
|
protected logger: TurboLogger;
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
protected connection: Connection;
|
|
7
|
+
protected gatewayUrl: string;
|
|
7
8
|
private pollingOptions;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
private mintAddress;
|
|
10
|
+
constructor({ gatewayUrl, logger, pollingOptions, }?: {
|
|
11
|
+
gatewayUrl?: string;
|
|
11
12
|
logger?: TurboLogger;
|
|
12
13
|
pollingOptions?: TokenPollingOptions;
|
|
13
|
-
});
|
|
14
|
-
createAndSubmitTx({ target, signer
|
|
14
|
+
} & Partial<AoProcessConfig> & TokenConfig);
|
|
15
|
+
createAndSubmitTx({ target, signer, tokenAmount, turboCreditDestinationAddress, }: TokenCreateTxParams): Promise<{
|
|
15
16
|
id: string;
|
|
16
17
|
target: string;
|
|
17
18
|
reward: string;
|
|
18
19
|
}>;
|
|
19
|
-
|
|
20
|
+
private submitTx;
|
|
21
|
+
pollTxAvailability({ txId }: {
|
|
22
|
+
txId: string;
|
|
23
|
+
}): Promise<void>;
|
|
20
24
|
}
|
|
21
25
|
export declare const mARIOToTokenAmount: (mARIO: BigNumber.Value) => BigNumber.Value;
|
|
22
26
|
export declare const ARIOToTokenAmount: (ario: BigNumber.Value) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ario.d.ts","sourceRoot":"","sources":["../../../../src/common/token/ario.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ario.d.ts","sourceRoot":"","sources":["../../../../src/common/token/ario.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,UAAU,EAMX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EACL,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAUxB,qBAAa,SAAU,YAAW,UAAU;IAC1C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAE9B,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,WAAW,CAAS;gBAEhB,EACV,UAA0C,EAC1C,MAAuB,EACvB,cAIC,GACF,GAAE;QACD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,cAAc,CAAC,EAAE,mBAAmB,CAAC;KACtC,GAAG,OAAO,CAAC,eAAe,CAAC,GAC1B,WAAgB;IAcL,iBAAiB,CAAC,EAC7B,MAAM,EACN,MAAM,EACN,WAAW,EACX,6BAA6B,GAC9B,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;YAkEY,QAAQ;IA2BT,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAqD3E;AAED,eAAO,MAAM,kBAAkB,UAAW,SAAS,CAAC,KAAK,oBAAU,CAAC;AACpE,eAAO,MAAM,iBAAiB,SAAU,SAAS,CAAC,KAAK,WACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/token/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/token/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAEL,YAAY,EACZ,SAAS,EAEV,MAAM,gBAAgB,CAAC;AAUxB,eAAO,MAAM,eAAe,EAAE,YAepB,CAAC;AAMX,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAYxC,CAAC;AAEX,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,SAAS,EACT,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAa/B,CAAC;AAEX,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,SAAS,CAE7D;AAED,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/common/token/solana.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,UAAU,EAOX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAKxB,eAAO,MAAM,oBAAoB,YAAa,SAAS,CAAC,KAAK,oBAAY,CAAC;AAC1E,eAAO,MAAM,gBAAgB,QAAS,SAAS,CAAC,KAAK,WACZ,CAAC;AAC1C,eAAO,MAAM,aAAa,gDAAgD,CAAC;AAE3E,qBAAa,WAAY,YAAW,UAAU;IAC5C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;gBAElC,EACV,MAAuB,EACvB,UAA0C,EAC1C,cAIC,GACF,GAAE,WAAgB;IAQN,iBAAiB,CAAC,EAC7B,MAAM,EACN,WAAW,EACX,MAAM,EACN,6BAA6B,GAC9B,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;YAiDY,QAAQ;IA2BT,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/common/token/solana.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,UAAU,EAOX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAKxB,eAAO,MAAM,oBAAoB,YAAa,SAAS,CAAC,KAAK,oBAAY,CAAC;AAC1E,eAAO,MAAM,gBAAgB,QAAS,SAAS,CAAC,KAAK,WACZ,CAAC;AAC1C,eAAO,MAAM,aAAa,gDAAgD,CAAC;AAE3E,qBAAa,WAAY,YAAW,UAAU;IAC5C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;gBAElC,EACV,MAAuB,EACvB,UAA0C,EAC1C,cAIC,GACF,GAAE,WAAgB;IAQN,iBAAiB,CAAC,EAC7B,MAAM,EACN,WAAW,EACX,MAAM,EACN,6BAA6B,GAC9B,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;YAiDY,QAAQ;IA2BT,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CA6C3E"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { BigNumber } from 'bignumber.js';
|
|
17
|
-
import { CreditShareApproval, Currency, FundingOptions, GetCreditShareApprovalsResponse, NativeAddress, TokenType, TurboAbortSignal, TurboAuthenticatedClientConfiguration, TurboAuthenticatedClientInterface, TurboAuthenticatedPaymentServiceInterface, TurboAuthenticatedUploadServiceInterface, TurboBalanceResponse, TurboCheckoutSessionParams, TurboCheckoutSessionResponse, TurboChunkingParams, TurboCountriesResponse, TurboCreateCreditShareApprovalParams, TurboCryptoFundResponse, TurboCurrenciesResponse, TurboDataItemSigner, TurboFiatEstimateForBytesResponse, TurboFiatToArResponse, TurboFundWithTokensParams, TurboPaymentIntentParams, TurboPaymentIntentResponse, TurboPriceResponse, TurboRatesResponse, TurboRevokeCreditsParams, TurboSignedDataItemFactory, TurboSubmitFundTxResponse, TurboTokenPriceForBytesResponse, TurboUnauthenticatedClientConfiguration, TurboUnauthenticatedClientInterface, TurboUnauthenticatedPaymentServiceInterface, TurboUnauthenticatedUploadServiceInterface, TurboUploadAndSigningEmitterEvents, TurboUploadDataItemResponse, TurboUploadEmitterEvents, TurboUploadFileWithFileOrPathParams, TurboUploadFileWithStreamFactoryParams, TurboUploadFolderParams, TurboUploadFolderResponse, TurboWincForFiatParams, TurboWincForFiatResponse, TurboWincForTokenParams, TurboWincForTokenResponse, UploadDataInput, UploadDataType } from '../types.js';
|
|
17
|
+
import { ArNSAction, ArNSActionCompleted, ArNSActionResult, ArNSFiatPurchaseQuoteParams, ArNSFiatPurchaseQuoteResponse, ArNSNameType, ArNSOwnerSigner, ArNSPriceParams, ArNSPriceResponse, ArNSPurchaseStatusResponse, AuthenticatedArNSFiatPurchaseQuoteParams, CreditShareApproval, Currency, FundingOptions, GetCreditShareApprovalsResponse, NativeAddress, TokenType, TurboAbortSignal, TurboArNSNamesResponse, TurboAuthenticatedClientConfiguration, TurboAuthenticatedClientInterface, TurboAuthenticatedPaymentServiceInterface, TurboAuthenticatedUploadServiceInterface, TurboBalanceResponse, TurboCheckoutSessionParams, TurboCheckoutSessionResponse, TurboChunkingParams, TurboCountriesResponse, TurboCreateCreditShareApprovalParams, TurboCryptoFundResponse, TurboCurrenciesResponse, TurboDataItemSigner, TurboFiatEstimateForBytesResponse, TurboFiatToArResponse, TurboFreeStatusResponse, TurboFundWithTokensParams, TurboPaymentHistoryParams, TurboPaymentHistoryResponse, TurboPaymentIntentParams, TurboPaymentIntentResponse, TurboPriceResponse, TurboRatesResponse, TurboRevokeCreditsParams, TurboSignedDataItemFactory, TurboSubmitFundTxResponse, TurboTokenPriceForBytesResponse, TurboUnauthenticatedClientConfiguration, TurboUnauthenticatedClientInterface, TurboUnauthenticatedPaymentServiceInterface, TurboUnauthenticatedUploadServiceInterface, TurboUploadAndSigningEmitterEvents, TurboUploadDataItemResponse, TurboUploadEmitterEvents, TurboUploadFileWithFileOrPathParams, TurboUploadFileWithStreamFactoryParams, TurboUploadFolderParams, TurboUploadFolderResponse, TurboWincForFiatParams, TurboWincForFiatResponse, TurboWincForTokenParams, TurboWincForTokenResponse, UploadDataInput, UploadDataType, UserAddress } from '../types.js';
|
|
18
18
|
/**
|
|
19
19
|
* Testing configuration.
|
|
20
20
|
*/
|
|
@@ -59,6 +59,37 @@ export declare class TurboUnauthenticatedClient implements TurboUnauthenticatedC
|
|
|
59
59
|
*/
|
|
60
60
|
getSupportedCountries(): Promise<TurboCountriesResponse>;
|
|
61
61
|
getBalance(address: NativeAddress): Promise<TurboBalanceResponse>;
|
|
62
|
+
getFreeStatus(address: NativeAddress): Promise<TurboFreeStatusResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the price in 'winc' (and mARIO) to buy/extend/upgrade an ArNS name.
|
|
65
|
+
*/
|
|
66
|
+
getArNSPriceForName(params: ArNSPriceParams): Promise<ArNSPriceResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the status of an ArNS purchase by its nonce.
|
|
69
|
+
*/
|
|
70
|
+
getArNSPurchaseStatus(p: {
|
|
71
|
+
nonce: string;
|
|
72
|
+
}): Promise<ArNSPurchaseStatusResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Returns the ArNS names a wallet owns or controls via Turbo's custodial
|
|
75
|
+
* ArNS-with-credits feature. `custodial: true` on a returned name means
|
|
76
|
+
* Turbo still holds/manages its ANT (transfer/manage routes apply);
|
|
77
|
+
* `custodial: false` means self-custody (or an already-completed exit) and
|
|
78
|
+
* is informational only.
|
|
79
|
+
*
|
|
80
|
+
* To read a name's current records or lease/expiration state, use
|
|
81
|
+
* `@ar.io/sdk` directly against the returned `antId`.
|
|
82
|
+
*/
|
|
83
|
+
getArNSNames(address: NativeAddress): Promise<TurboArNSNamesResponse>;
|
|
84
|
+
/**
|
|
85
|
+
* Quote a fiat (Stripe) ArNS purchase — buy a name with a credit card in one
|
|
86
|
+
* step, no Turbo Credits top-up in between. Complete the returned
|
|
87
|
+
* `paymentSession` with Stripe, then poll {@link getArNSPurchaseStatus} using
|
|
88
|
+
* `purchaseQuote.nonce`.
|
|
89
|
+
*
|
|
90
|
+
* Throws `FiatPaymentsDisabledError` when the service has Stripe switched off.
|
|
91
|
+
*/
|
|
92
|
+
getArNSFiatPurchaseQuote(params: ArNSFiatPurchaseQuoteParams): Promise<ArNSFiatPurchaseQuoteResponse>;
|
|
62
93
|
/**
|
|
63
94
|
* Returns a list of all supported fiat currencies.
|
|
64
95
|
*/
|
|
@@ -139,6 +170,114 @@ export declare class TurboAuthenticatedClient extends TurboUnauthenticatedClient
|
|
|
139
170
|
* Returns the current balance of the user's wallet in 'winc'.
|
|
140
171
|
*/
|
|
141
172
|
getBalance(userAddress?: NativeAddress): Promise<TurboBalanceResponse>;
|
|
173
|
+
/**
|
|
174
|
+
* Returns how many free-tier bytes the wallet can still upload for free
|
|
175
|
+
* (`bytesRemaining`), or `null` for an unlimited (exempt/partner) wallet.
|
|
176
|
+
*/
|
|
177
|
+
getFreeStatus(userAddress?: NativeAddress): Promise<TurboFreeStatusResponse>;
|
|
178
|
+
/**
|
|
179
|
+
* Returns the signer's OWN completed top-up history (crypto + fiat), newest
|
|
180
|
+
* first and keyset-paginated. Signature-required and self-scoped: it only ever
|
|
181
|
+
* returns the signing wallet's rows. Pass `cursor` from a prior response's
|
|
182
|
+
* `cursor` field (with `hasMore === true`) to fetch the next page.
|
|
183
|
+
*/
|
|
184
|
+
getPaymentHistory(params?: TurboPaymentHistoryParams): Promise<TurboPaymentHistoryResponse>;
|
|
185
|
+
/** Create an action. Debits credits HERE — capture the nonce before signing. */
|
|
186
|
+
createArNSAction(action: ArNSAction, params?: Record<string, unknown>, ownerProof?: {
|
|
187
|
+
owner: ArNSOwnerSigner;
|
|
188
|
+
message: string;
|
|
189
|
+
}): Promise<ArNSActionResult>;
|
|
190
|
+
/** Submit the owner-signed transaction (FULL serialized tx, base64). */
|
|
191
|
+
signArNSAction(nonce: string, signedTransaction: string): Promise<ArNSActionCompleted>;
|
|
192
|
+
/** Status by nonce — open, needs no signature. Use it to resume. */
|
|
193
|
+
getArNSActionStatus(nonce: string): Promise<ArNSActionResult & {
|
|
194
|
+
failedDate?: string;
|
|
195
|
+
}>;
|
|
196
|
+
/**
|
|
197
|
+
* Quote a fiat (Stripe) ArNS purchase for this signer's wallet — a credit-card
|
|
198
|
+
* buy in one step, with no Turbo Credits top-up in between. `address` defaults
|
|
199
|
+
* to the signer's native address; pass one to buy on another wallet's behalf.
|
|
200
|
+
*
|
|
201
|
+
* Complete the returned `paymentSession` with Stripe, then poll
|
|
202
|
+
* {@link getArNSPurchaseStatus} using `purchaseQuote.nonce`. Throws
|
|
203
|
+
* `FiatPaymentsDisabledError` when the service has Stripe switched off.
|
|
204
|
+
*/
|
|
205
|
+
getArNSFiatPurchaseQuote(params: AuthenticatedArNSFiatPurchaseQuoteParams): Promise<ArNSFiatPurchaseQuoteResponse>;
|
|
206
|
+
/**
|
|
207
|
+
* Buy a name. The ANT is minted straight to `owner`; Turbo never holds it.
|
|
208
|
+
* The only action that always needs the owner's signature — once, ever.
|
|
209
|
+
*/
|
|
210
|
+
buyArNSName(params: {
|
|
211
|
+
name: string;
|
|
212
|
+
owner: ArNSOwnerSigner;
|
|
213
|
+
type?: ArNSNameType;
|
|
214
|
+
years?: number;
|
|
215
|
+
paidBy?: UserAddress | UserAddress[];
|
|
216
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
217
|
+
}): Promise<ArNSActionCompleted>;
|
|
218
|
+
/** Extend a lease. No owner signature needed. */
|
|
219
|
+
extendArNSLease(params: {
|
|
220
|
+
name: string;
|
|
221
|
+
years: number;
|
|
222
|
+
paidBy?: UserAddress | UserAddress[];
|
|
223
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
224
|
+
}): Promise<ArNSActionCompleted>;
|
|
225
|
+
/** Raise the undername limit. No owner signature needed. */
|
|
226
|
+
increaseArNSUndernameLimit(params: {
|
|
227
|
+
name: string;
|
|
228
|
+
increaseQty: number;
|
|
229
|
+
paidBy?: UserAddress | UserAddress[];
|
|
230
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
231
|
+
}): Promise<ArNSActionCompleted>;
|
|
232
|
+
/** Upgrade a lease to a permanent name. No owner signature needed. */
|
|
233
|
+
upgradeArNSName(params: {
|
|
234
|
+
name: string;
|
|
235
|
+
paidBy?: UserAddress | UserAddress[];
|
|
236
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
237
|
+
}): Promise<ArNSActionCompleted>;
|
|
238
|
+
/** Point a name (or undername) at data. Free; handles both shapes. */
|
|
239
|
+
setArNSRecord(params: {
|
|
240
|
+
antId: string;
|
|
241
|
+
owner: ArNSOwnerSigner;
|
|
242
|
+
transactionId: string;
|
|
243
|
+
undername?: string;
|
|
244
|
+
ttlSeconds?: number;
|
|
245
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
246
|
+
}): Promise<ArNSActionCompleted>;
|
|
247
|
+
/** Remove a record. Free; handles both shapes. */
|
|
248
|
+
removeArNSRecord(params: {
|
|
249
|
+
antId: string;
|
|
250
|
+
owner: ArNSOwnerSigner;
|
|
251
|
+
undername: string;
|
|
252
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
253
|
+
}): Promise<ArNSActionCompleted>;
|
|
254
|
+
/** Grant controller rights — omit `target` for Turbo itself. Free. */
|
|
255
|
+
addArNSController(params: {
|
|
256
|
+
antId: string;
|
|
257
|
+
owner: ArNSOwnerSigner;
|
|
258
|
+
target?: string;
|
|
259
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
260
|
+
}): Promise<ArNSActionCompleted>;
|
|
261
|
+
/** Revoke controller rights. Always available, always free. */
|
|
262
|
+
removeArNSController(params: {
|
|
263
|
+
antId: string;
|
|
264
|
+
owner: ArNSOwnerSigner;
|
|
265
|
+
target?: string;
|
|
266
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
267
|
+
}): Promise<ArNSActionCompleted>;
|
|
268
|
+
/** Hand the ANT to a new owner. Irreversible. Free. */
|
|
269
|
+
transferArNSAnt(params: {
|
|
270
|
+
antId: string;
|
|
271
|
+
owner: ArNSOwnerSigner;
|
|
272
|
+
target: string;
|
|
273
|
+
onNonce?: (nonce: string) => void | Promise<void>;
|
|
274
|
+
}): Promise<ArNSActionCompleted>;
|
|
275
|
+
/**
|
|
276
|
+
* Returns the ArNS names owned or controlled by the connected signer's
|
|
277
|
+
* wallet (or the given `userAddress`) via Turbo's custodial
|
|
278
|
+
* ArNS-with-credits feature.
|
|
279
|
+
*/
|
|
280
|
+
getArNSNames(userAddress?: NativeAddress): Promise<TurboArNSNamesResponse>;
|
|
142
281
|
/**
|
|
143
282
|
* Returns a list of all credit share approvals for the user.
|
|
144
283
|
*/
|