@coinlist-co/react 0.12.2-rc.0fda52c → 0.12.2-rc.0ff2d03
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/chunk-MJ6YXZWH.js +22 -0
- package/dist/chunk-MJ6YXZWH.js.map +1 -0
- package/dist/{chunk-KRA6EM2L.js → chunk-PWGUKS4Q.js} +199 -186
- package/dist/chunk-PWGUKS4Q.js.map +1 -0
- package/dist/{chunk-STAHYDLY.js → chunk-QTBEDN7C.js} +10 -10
- package/dist/chunk-QTBEDN7C.js.map +1 -0
- package/dist/{chunk-BNMF2HMW.js → chunk-SVPFFLIT.js} +1210 -802
- package/dist/chunk-SVPFFLIT.js.map +1 -0
- package/dist/client/index.d.ts +3316 -4554
- package/dist/client/index.js +7235 -4340
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.d.ts +7 -33
- package/dist/server/index.js +8 -4
- package/dist/server/index.js.map +1 -1
- package/dist/{tokens-namespace-BJfFeowE.d.cts → time-BDzqB806.d.ts} +2083 -2725
- package/dist/{token-registry-snapshot-C1NxdBmF.d.ts → token-registry-snapshot-cvLsnMo_.d.ts} +74 -42
- package/dist/universal/index.d.ts +83 -1002
- package/dist/universal/index.js +42 -36
- package/package.json +18 -14
- package/dist/chunk-BNMF2HMW.js.map +0 -1
- package/dist/chunk-KRA6EM2L.js.map +0 -1
- package/dist/chunk-STAHYDLY.js.map +0 -1
- package/dist/client/index.cjs +0 -17035
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.d.cts +0 -6608
- package/dist/server/index.cjs +0 -4240
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.d.cts +0 -378
- package/dist/time-B5YOQxuh.d.ts +0 -50
- package/dist/time-BY3apBpc.d.cts +0 -50
- package/dist/token-registry-snapshot-DyjrA32p.d.cts +0 -179
- package/dist/tokens-namespace-BJfFeowE.d.ts +0 -3353
- package/dist/universal/index.cjs +0 -4125
- package/dist/universal/index.cjs.map +0 -1
- package/dist/universal/index.d.cts +0 -1294
|
@@ -1,86 +1,92 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet,
|
|
5
|
-
import {
|
|
6
|
-
export { E as EpochMillis, M as Millis, S as Seconds, i as isExpired } from '../time-B5YOQxuh.js';
|
|
1
|
+
import { ak as RequestId, al as ClientId, am as RedirectUri, an as CodeChallenge, ao as PKCEState, C as CodeVerifier, j as OfferSwapContract, E as EthereumChain, b as EvmContractAddress, k as OndoBuyTransaction, B as BlockchainAmount, l as OndoSellTransaction, S as SwapQuote, p as Bps, ap as SwapStatus, a8 as AssetDecimals, a as AssetSymbol, q as EvmWalletAddress, aq as KnownAssetSymbol, I as Erc20Asset, H as StablecoinSymbol } from '../time-BDzqB806.js';
|
|
2
|
+
export { ar as AllowWalletParams, as as AllowWalletResponse, at as Asset, au as AssetCode, h as AssetId, N as AsyncOfferDetail, av as AsyncOfferType, A as AuthorizationCode, aw as BaseEvent, ax as Blockchain, a1 as BuildCentrifugeVaultBuyParams, a2 as BuildOndoBuyParams, a4 as BuildOndoSellParams, ay as BuildOndoSwapParamsCore, az as CentrifugeAssets, d as CentrifugeClaimDirection, aA as CentrifugeDepositPosition, e as CentrifugeNamespace, aB as CentrifugeOrderReason, aC as CentrifugeOrderability, aD as CentrifugeRedeemPosition, aE as CentrifugeShares, ab as CentrifugeVault, c as CentrifugeVaultBuyTransaction, aF as CentrifugeVaultClaimProceedsTransaction, aG as CentrifugeVaultClaimTransaction, aa as CentrifugeVaultLeg, K as CentrifugeVaultLegId, aH as CentrifugeVaultOffer, L as CentrifugeVaultOfferDetail, aI as CentrifugeVaultReason, a0 as CentrifugeVaultRef, aJ as CentrifugeVaultResolution, $ as CentrifugeVaultStatus, aK as CentrifugeVaultTransactionCore, aL as CentrifugeWalletParams, aM as Chain, ag as ClientCredentialsOAuth, aj as ClientSecret, i as CoinListTokenSaleNamespace, aN as CoinListTokenSaleOffer, J as CoinListTokenSaleOfferDetail, w as Config, aO as ConnectExternalWalletParams, aP as CreateKycTokenParams, aQ as CreateParticipationParams, aR as CreateWalletOwnershipChallengeParams, aS as Cursor, aT as DebugEvent, aU as DecimalString, aV as DocumentFormType, ad as DocumentSubmission, aW as DocumentSubmissionStatus, aX as DocumentType, aY as ETHEREUM_CHAINS, aZ as EpochMillis, z as Erc20Namespace, a_ as FaqItem, a$ as FrontlineEventId, b0 as GetCentrifugeVaultStatusParams, b1 as GetOndoQuoteParams, b2 as GetOndoTradingStatusParams, b3 as GetSwapAuthorizationParams, b4 as GetSwapPreviewParams, b5 as GetSwapQuoteParams, b6 as GetTokenAllowanceParams, b7 as GetTokenBalanceParams, b8 as HexEncodedTransactionData, b9 as Isin, ba as Iso2CountryCode, U as KycLevelName, bb as KycToken, bc as Link, bd as ListOptionAddressesParams, be as LogBinding, bf as LogBindings, bg as LogCause, bh as LogLevel, bi as LogScope, bj as LogValue, _ as Logger, bk as MAX_ASSET_DECIMALS, bl as MAX_UINT_256, bm as Milestone, bn as Millis, bo as Newtype, x as OAuthAccessToken, bp as OAuthRefreshToken, af as OAuthSession, D as Offer, bq as OfferBase, G as OfferDetail, br as OfferDetailBase, bs as OfferEditorial, f as OfferId, bt as OfferOption, u as OfferOptionAddress, ac as OfferOptionAddressId, g as OfferOptionId, bu as OfferOptionSlug, bv as OfferSlug, bw as OfferToken, bx as OfferType, O as OfferVaultContract, y as OffersNamespace, m as OndoNamespace, a5 as OndoQuote, by as OndoQuoteDuration, a6 as OndoQuoteSize, bz as OndoSellOutcome, bA as OndoSwapOffer, a3 as OndoSwapOfferDetail, n as OndoSwapTransactionCore, a7 as OndoTradingStatus, o as OrderBookSide, ai as PaginatedResponse, ah as PaginationParams, P as Participation, bB as ParticipationId, bC as ParticipationStatus, bD as ParticipationsPaginationParams, bE as PauseFlags, bF as Pii, bG as PiiAddress, bH as PiiJurisdiction, bI as PiiKind, Z as PinoLoggerOptions, bJ as ProductionLogLevel, bK as ReadCentrifugePositionParams, bL as RedactedWalletError, bM as RemoveOptionAddressParams, s as Requirement, bN as RequirementActionNeededReason, Y as RequirementId, Q as RequirementStatusInfo, X as RequirementStatusValue, V as RequirementType, R as RequirementsNamespace, bO as RpcConfig, bP as RpcFailureReason, bQ as SOLANA_CHAINS, bR as STABLE_DECIMALS, bS as SafeEvent, bT as SafeFields, M as Seconds, bU as SolanaChain, bV as SubmitDocumentParams, r as SuperstateSwapNamespace, bW as SuperstateSwapOffer, a9 as SuperstateSwapOfferDetail, bX as SwapContractRef, bY as SwapPreview, bZ as TermItem, b_ as Ticker, ae as TokenIdentifier, b$ as TokenLogo, c0 as TokenLogoImage, c1 as TokenLogoUrl, F as TokenMetadata, c2 as TokenRole, T as TokensNamespace, c3 as Tx, c4 as Uint256, c5 as UnredactedFields, c6 as WalletAddress, t as WalletChallengeType, W as WalletError, c7 as WalletOwnershipChallenge, c8 as WalletOwnershipChallengeParamsBase, c9 as WalletProtocol, v as WalletsNamespace, ca as assertUint256, cb as isChain, cc as isOfferType, cd as parseUint256, ce as resolveCentrifugeVaults } from '../time-BDzqB806.js';
|
|
3
|
+
import { F as FormattedAmountAssetUi, T as TxExplorerUrl, d as FormattedAmountUi, b as FormattedPercentUi, S as ShortenedWalletAddress } from '../token-registry-snapshot-cvLsnMo_.js';
|
|
4
|
+
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, e as EvmSigner, E as EvmWallet, f as ExternalWalletAdapter, N as NonEmptyArray, g as TokenKey, c as TokenRegistrySnapshot, a as WalletLabelResolver, W as WalletSelection, h as WriteContractParams, o as offerDisplayTokens } from '../token-registry-snapshot-cvLsnMo_.js';
|
|
5
|
+
import { Hash, Chain } from 'viem';
|
|
7
6
|
|
|
7
|
+
type HttpResponse<TBody = unknown> = {
|
|
8
|
+
status: number;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
body: TBody | null;
|
|
11
|
+
/**
|
|
12
|
+
* The id of the request that produced this response, stamped by
|
|
13
|
+
* {@link HttpClient} so that whoever turns a non-2xx into an
|
|
14
|
+
* {@link HttpError} can carry it without threading the request alongside.
|
|
15
|
+
* Absent when the response did not come from an `HttpClient`.
|
|
16
|
+
*/
|
|
17
|
+
requestId?: RequestId;
|
|
18
|
+
};
|
|
19
|
+
declare class HttpError<TBody = unknown> extends Error {
|
|
20
|
+
readonly response: HttpResponse<TBody>;
|
|
21
|
+
constructor(response: HttpResponse<TBody>);
|
|
22
|
+
/**
|
|
23
|
+
* Correlates this failure with the `[HTTP]` log lines for the same request,
|
|
24
|
+
* which carry the method, the URL, the duration and every retry. `null` when
|
|
25
|
+
* the response did not come from an {@link HttpClient}.
|
|
26
|
+
*
|
|
27
|
+
* Worth quoting in a bug report: it is what makes a log excerpt readable.
|
|
28
|
+
*/
|
|
29
|
+
get requestId(): RequestId | null;
|
|
30
|
+
}
|
|
8
31
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Lives in the API layer rather than beside `PaginationParams` because it
|
|
13
|
-
* drives requests: it is the auto-paginating half that `list()` is built on,
|
|
14
|
-
* while the params and the response envelope are domain models the client and
|
|
15
|
-
* the server both name.
|
|
16
|
-
*/
|
|
17
|
-
declare function fetchAllPages<A, P extends PaginationParams = PaginationParams>(fetchPage: (params: P) => Promise<PaginatedResponse<A>>, baseParams?: Omit<P, keyof PaginationParams>): Promise<A[]>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* How often the Ondo checkout refreshes what it is allowed to poll: the market
|
|
21
|
-
* status and the indicative price. Both are free - neither spends an
|
|
22
|
-
* attestation - so this is paced for a price the user can trust rather than
|
|
23
|
-
* for cost.
|
|
24
|
-
*
|
|
25
|
-
* A built transaction is deliberately not on this timer. Building spends an
|
|
26
|
-
* attestation, so it happens once per order and once per refresh the user
|
|
27
|
-
* asks for.
|
|
28
|
-
*/
|
|
29
|
-
declare const ONDO_POLL_INTERVAL_MS = 15000;
|
|
30
|
-
/** Max time the review step offers a built quote. */
|
|
31
|
-
declare const ONDO_QUOTE_MAX_TTL_MS = 15000;
|
|
32
|
-
/**
|
|
33
|
-
* The order size the sidebar prices against before the user names one.
|
|
32
|
+
* The machine-readable `code` frontline attaches to an error, or `null` for
|
|
33
|
+
* anything else - a non-HTTP failure, or an error body that carries only a
|
|
34
|
+
* message.
|
|
34
35
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* Frontline answers a failure with `{ type, message, code?, errors?,
|
|
37
|
+
* event_id? }`, and `code` is the only part of it meant to be branched on:
|
|
38
|
+
* `message` is prose that may be reworded, and `type` distinguishes
|
|
39
|
+
* `invalid_request_error` from `api_error` without saying which one.
|
|
38
40
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* coexist - and they mean different things anyway.
|
|
41
|
+
* Reach for this only where a code has a distinct remedy the user can act on.
|
|
42
|
+
* Mapping the whole vocabulary would couple the SDK to strings frontline does
|
|
43
|
+
* not version; falling back to a generic failure is the right default.
|
|
43
44
|
*/
|
|
44
|
-
declare
|
|
45
|
+
declare function apiErrorCode(error: unknown): string | null;
|
|
46
|
+
|
|
47
|
+
type PKCEParams = {
|
|
48
|
+
clientId: ClientId;
|
|
49
|
+
responseType: 'code';
|
|
50
|
+
redirectUri: RedirectUri;
|
|
51
|
+
codeChallenge: CodeChallenge;
|
|
52
|
+
codeChallengeMethod: 'S256';
|
|
53
|
+
state: PKCEState;
|
|
54
|
+
codeVerifier: CodeVerifier;
|
|
55
|
+
};
|
|
56
|
+
type PKCEConfig = {
|
|
57
|
+
clientId: ClientId;
|
|
58
|
+
redirectUri: RedirectUri;
|
|
59
|
+
};
|
|
45
60
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* this names the token and never sizes it - `receive_output_decimals` is the
|
|
50
|
-
* only authority on how many decimals the proceeds are counted in, and the two
|
|
51
|
-
* are allowed to disagree.
|
|
52
|
-
*
|
|
53
|
-
* Named apart from {@link ONDO_SUPPORTED_INPUT_ASSETS} rather than read out of
|
|
54
|
-
* it, though both are USDC today. On a buy USDC is what the user funds with
|
|
55
|
-
* and one of a list that may grow; on a sell it is what they settle into and
|
|
56
|
-
* there is one of it. Reading `ONDO_SUPPORTED_INPUT_ASSETS[0]` here would make
|
|
57
|
-
* the sell screen quietly follow whichever funding coin happened to be listed
|
|
58
|
-
* first.
|
|
61
|
+
* Generates PKCE parameters for an OAuth2 authorization code flow.
|
|
62
|
+
* Pure crypto — no React, no DOM beyond Web Crypto API. Safe to use
|
|
63
|
+
* in server-side code and Next.js middleware.
|
|
59
64
|
*/
|
|
60
|
-
declare
|
|
65
|
+
declare function generatePKCEParams(config: PKCEConfig): Promise<PKCEParams>;
|
|
66
|
+
|
|
61
67
|
/**
|
|
62
|
-
* The
|
|
68
|
+
* The CoinList contract a swap on `chain` settles through, and therefore the
|
|
69
|
+
* ERC-20 spender the user approves - or `null` where this offer cannot be
|
|
70
|
+
* swapped on that chain.
|
|
63
71
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* and leave the panel permanently blank.
|
|
72
|
+
* Read off the offer rather than held as a constant because the address varies
|
|
73
|
+
* by environment, not only by chain: beta and production both run
|
|
74
|
+
* `ethereum_sepolia` and deploy a different contract on each, and one constant
|
|
75
|
+
* cannot name both. Frontline resolves it per environment and serves the
|
|
76
|
+
* answer on the offer.
|
|
70
77
|
*
|
|
71
|
-
* The
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* The coins an Ondo buy can be funded with, in display order, with the first
|
|
77
|
-
* preselected.
|
|
78
|
+
* The array varies per *offer* as well as per chain - frontline drops a chain
|
|
79
|
+
* whose funding and swap tokens do not both resolve for this asset - so an
|
|
80
|
+
* array read for one symbol must not be reused for another. An empty array
|
|
81
|
+
* means "cannot swap here", which is an answer rather than an error.
|
|
78
82
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
83
|
+
* A capability rather than a provider slice, and named for the data it reads
|
|
84
|
+
* rather than for its first caller: `swap_contracts` is an offer field, and
|
|
85
|
+
* `universal-core-isolation-and-sharing` would stop Superstate reusing this if
|
|
86
|
+
* it lived under `checkout/ondo/`. Superstate has not migrated yet - it still
|
|
87
|
+
* reads `superstateSwapContractAddress` - so Ondo is the only caller today.
|
|
82
88
|
*/
|
|
83
|
-
declare
|
|
89
|
+
declare function swapSpender(swapContracts: OfferSwapContract[], chain: EthereumChain): EvmContractAddress | null;
|
|
84
90
|
|
|
85
91
|
/**
|
|
86
92
|
* The price of one whole asset token in a built Ondo purchase, in the funding
|
|
@@ -127,696 +133,15 @@ declare function computeOndoBuyPrice(transaction: OndoBuyTransaction): Blockchai
|
|
|
127
133
|
* does today. They diverge the day ENG-1718 lands.
|
|
128
134
|
*/
|
|
129
135
|
declare function computeOndoSellPrice(transaction: OndoSellTransaction): BlockchainAmount;
|
|
130
|
-
/** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
|
|
131
|
-
declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
|
|
132
136
|
|
|
133
137
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* ```
|
|
138
|
-
* cd ../solidity && forge inspect TokenSwap abi --json --use 0.8.34
|
|
139
|
-
* ```
|
|
140
|
-
*
|
|
141
|
-
* Generated rather than hand-trimmed to the four methods the SDK calls, so
|
|
142
|
-
* regenerating after a contract change is one command and a paste. The custom
|
|
143
|
-
* errors carry their weight in particular: viem decodes a revert against them,
|
|
144
|
-
* so a `preview()` on a stopped contract surfaces as `IsStopped` rather than
|
|
145
|
-
* as an opaque `0x`-prefixed blob.
|
|
138
|
+
* Whether `error` is the CoinList API refusing an Ondo quote because the
|
|
139
|
+
* market is not open, as opposed to a request that failed.
|
|
146
140
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* `stopped() -> uint256` bitmask, which this contract still exposes but as a
|
|
150
|
-
* `bool`; {@link SwapStatus} reads `status()` and nothing else.
|
|
141
|
+
* Total: anything that is not an `HttpError` carrying
|
|
142
|
+
* {@link ONDO_NOT_TRADABLE_CODE} is `false`.
|
|
151
143
|
*/
|
|
152
|
-
declare
|
|
153
|
-
readonly type: "function";
|
|
154
|
-
readonly name: "KIND";
|
|
155
|
-
readonly inputs: readonly [];
|
|
156
|
-
readonly outputs: readonly [{
|
|
157
|
-
readonly name: "";
|
|
158
|
-
readonly type: "uint16";
|
|
159
|
-
readonly internalType: "uint16";
|
|
160
|
-
}];
|
|
161
|
-
readonly stateMutability: "view";
|
|
162
|
-
}, {
|
|
163
|
-
readonly type: "function";
|
|
164
|
-
readonly name: "ONE_HUNDRED_P";
|
|
165
|
-
readonly inputs: readonly [];
|
|
166
|
-
readonly outputs: readonly [{
|
|
167
|
-
readonly name: "";
|
|
168
|
-
readonly type: "uint256";
|
|
169
|
-
readonly internalType: "uint256";
|
|
170
|
-
}];
|
|
171
|
-
readonly stateMutability: "view";
|
|
172
|
-
}, {
|
|
173
|
-
readonly type: "function";
|
|
174
|
-
readonly name: "SWAP_LEVEL";
|
|
175
|
-
readonly inputs: readonly [];
|
|
176
|
-
readonly outputs: readonly [{
|
|
177
|
-
readonly name: "";
|
|
178
|
-
readonly type: "uint32";
|
|
179
|
-
readonly internalType: "uint32";
|
|
180
|
-
}];
|
|
181
|
-
readonly stateMutability: "view";
|
|
182
|
-
}, {
|
|
183
|
-
readonly type: "function";
|
|
184
|
-
readonly name: "VERSION";
|
|
185
|
-
readonly inputs: readonly [];
|
|
186
|
-
readonly outputs: readonly [{
|
|
187
|
-
readonly name: "";
|
|
188
|
-
readonly type: "uint16";
|
|
189
|
-
readonly internalType: "uint16";
|
|
190
|
-
}];
|
|
191
|
-
readonly stateMutability: "view";
|
|
192
|
-
}, {
|
|
193
|
-
readonly type: "function";
|
|
194
|
-
readonly name: "authorized";
|
|
195
|
-
readonly inputs: readonly [{
|
|
196
|
-
readonly name: "user";
|
|
197
|
-
readonly type: "address";
|
|
198
|
-
readonly internalType: "address";
|
|
199
|
-
}];
|
|
200
|
-
readonly outputs: readonly [{
|
|
201
|
-
readonly name: "";
|
|
202
|
-
readonly type: "bool";
|
|
203
|
-
readonly internalType: "bool";
|
|
204
|
-
}];
|
|
205
|
-
readonly stateMutability: "view";
|
|
206
|
-
}, {
|
|
207
|
-
readonly type: "function";
|
|
208
|
-
readonly name: "bpp";
|
|
209
|
-
readonly inputs: readonly [{
|
|
210
|
-
readonly name: "amount";
|
|
211
|
-
readonly type: "uint256";
|
|
212
|
-
readonly internalType: "uint256";
|
|
213
|
-
}];
|
|
214
|
-
readonly outputs: readonly [{
|
|
215
|
-
readonly name: "";
|
|
216
|
-
readonly type: "uint256";
|
|
217
|
-
readonly internalType: "uint256";
|
|
218
|
-
}];
|
|
219
|
-
readonly stateMutability: "view";
|
|
220
|
-
}, {
|
|
221
|
-
readonly type: "function";
|
|
222
|
-
readonly name: "bps";
|
|
223
|
-
readonly inputs: readonly [];
|
|
224
|
-
readonly outputs: readonly [{
|
|
225
|
-
readonly name: "";
|
|
226
|
-
readonly type: "uint256";
|
|
227
|
-
readonly internalType: "uint256";
|
|
228
|
-
}];
|
|
229
|
-
readonly stateMutability: "view";
|
|
230
|
-
}, {
|
|
231
|
-
readonly type: "function";
|
|
232
|
-
readonly name: "cancelOwnershipHandover";
|
|
233
|
-
readonly inputs: readonly [];
|
|
234
|
-
readonly outputs: readonly [];
|
|
235
|
-
readonly stateMutability: "payable";
|
|
236
|
-
}, {
|
|
237
|
-
readonly type: "function";
|
|
238
|
-
readonly name: "completeOwnershipHandover";
|
|
239
|
-
readonly inputs: readonly [{
|
|
240
|
-
readonly name: "pendingOwner";
|
|
241
|
-
readonly type: "address";
|
|
242
|
-
readonly internalType: "address";
|
|
243
|
-
}];
|
|
244
|
-
readonly outputs: readonly [];
|
|
245
|
-
readonly stateMutability: "payable";
|
|
246
|
-
}, {
|
|
247
|
-
readonly type: "function";
|
|
248
|
-
readonly name: "fee";
|
|
249
|
-
readonly inputs: readonly [{
|
|
250
|
-
readonly name: "amount";
|
|
251
|
-
readonly type: "uint256";
|
|
252
|
-
readonly internalType: "uint256";
|
|
253
|
-
}];
|
|
254
|
-
readonly outputs: readonly [{
|
|
255
|
-
readonly name: "";
|
|
256
|
-
readonly type: "uint256";
|
|
257
|
-
readonly internalType: "uint256";
|
|
258
|
-
}, {
|
|
259
|
-
readonly name: "";
|
|
260
|
-
readonly type: "uint256";
|
|
261
|
-
readonly internalType: "uint256";
|
|
262
|
-
}];
|
|
263
|
-
readonly stateMutability: "view";
|
|
264
|
-
}, {
|
|
265
|
-
readonly type: "function";
|
|
266
|
-
readonly name: "id";
|
|
267
|
-
readonly inputs: readonly [];
|
|
268
|
-
readonly outputs: readonly [{
|
|
269
|
-
readonly name: "";
|
|
270
|
-
readonly type: "bytes32";
|
|
271
|
-
readonly internalType: "bytes32";
|
|
272
|
-
}];
|
|
273
|
-
readonly stateMutability: "view";
|
|
274
|
-
}, {
|
|
275
|
-
readonly type: "function";
|
|
276
|
-
readonly name: "inputTokens";
|
|
277
|
-
readonly inputs: readonly [{
|
|
278
|
-
readonly name: "";
|
|
279
|
-
readonly type: "address";
|
|
280
|
-
readonly internalType: "address";
|
|
281
|
-
}];
|
|
282
|
-
readonly outputs: readonly [{
|
|
283
|
-
readonly name: "";
|
|
284
|
-
readonly type: "bool";
|
|
285
|
-
readonly internalType: "bool";
|
|
286
|
-
}];
|
|
287
|
-
readonly stateMutability: "view";
|
|
288
|
-
}, {
|
|
289
|
-
readonly type: "function";
|
|
290
|
-
readonly name: "outputToken";
|
|
291
|
-
readonly inputs: readonly [];
|
|
292
|
-
readonly outputs: readonly [{
|
|
293
|
-
readonly name: "";
|
|
294
|
-
readonly type: "address";
|
|
295
|
-
readonly internalType: "address";
|
|
296
|
-
}];
|
|
297
|
-
readonly stateMutability: "view";
|
|
298
|
-
}, {
|
|
299
|
-
readonly type: "function";
|
|
300
|
-
readonly name: "outputTokenBalance";
|
|
301
|
-
readonly inputs: readonly [];
|
|
302
|
-
readonly outputs: readonly [{
|
|
303
|
-
readonly name: "";
|
|
304
|
-
readonly type: "uint256";
|
|
305
|
-
readonly internalType: "uint256";
|
|
306
|
-
}];
|
|
307
|
-
readonly stateMutability: "view";
|
|
308
|
-
}, {
|
|
309
|
-
readonly type: "function";
|
|
310
|
-
readonly name: "owner";
|
|
311
|
-
readonly inputs: readonly [];
|
|
312
|
-
readonly outputs: readonly [{
|
|
313
|
-
readonly name: "result";
|
|
314
|
-
readonly type: "address";
|
|
315
|
-
readonly internalType: "address";
|
|
316
|
-
}];
|
|
317
|
-
readonly stateMutability: "view";
|
|
318
|
-
}, {
|
|
319
|
-
readonly type: "function";
|
|
320
|
-
readonly name: "ownershipHandoverExpiresAt";
|
|
321
|
-
readonly inputs: readonly [{
|
|
322
|
-
readonly name: "pendingOwner";
|
|
323
|
-
readonly type: "address";
|
|
324
|
-
readonly internalType: "address";
|
|
325
|
-
}];
|
|
326
|
-
readonly outputs: readonly [{
|
|
327
|
-
readonly name: "result";
|
|
328
|
-
readonly type: "uint256";
|
|
329
|
-
readonly internalType: "uint256";
|
|
330
|
-
}];
|
|
331
|
-
readonly stateMutability: "view";
|
|
332
|
-
}, {
|
|
333
|
-
readonly type: "function";
|
|
334
|
-
readonly name: "pause";
|
|
335
|
-
readonly inputs: readonly [{
|
|
336
|
-
readonly name: "level";
|
|
337
|
-
readonly type: "uint32";
|
|
338
|
-
readonly internalType: "uint32";
|
|
339
|
-
}];
|
|
340
|
-
readonly outputs: readonly [{
|
|
341
|
-
readonly name: "";
|
|
342
|
-
readonly type: "bool";
|
|
343
|
-
readonly internalType: "bool";
|
|
344
|
-
}];
|
|
345
|
-
readonly stateMutability: "nonpayable";
|
|
346
|
-
}, {
|
|
347
|
-
readonly type: "function";
|
|
348
|
-
readonly name: "paused";
|
|
349
|
-
readonly inputs: readonly [];
|
|
350
|
-
readonly outputs: readonly [{
|
|
351
|
-
readonly name: "";
|
|
352
|
-
readonly type: "uint32";
|
|
353
|
-
readonly internalType: "uint32";
|
|
354
|
-
}];
|
|
355
|
-
readonly stateMutability: "view";
|
|
356
|
-
}, {
|
|
357
|
-
readonly type: "function";
|
|
358
|
-
readonly name: "preview";
|
|
359
|
-
readonly inputs: readonly [{
|
|
360
|
-
readonly name: "token";
|
|
361
|
-
readonly type: "address";
|
|
362
|
-
readonly internalType: "address";
|
|
363
|
-
}, {
|
|
364
|
-
readonly name: "amount";
|
|
365
|
-
readonly type: "uint256";
|
|
366
|
-
readonly internalType: "uint256";
|
|
367
|
-
}];
|
|
368
|
-
readonly outputs: readonly [{
|
|
369
|
-
readonly name: "";
|
|
370
|
-
readonly type: "tuple";
|
|
371
|
-
readonly internalType: "struct Preview";
|
|
372
|
-
readonly components: readonly [{
|
|
373
|
-
readonly name: "input";
|
|
374
|
-
readonly type: "uint256";
|
|
375
|
-
readonly internalType: "uint256";
|
|
376
|
-
}, {
|
|
377
|
-
readonly name: "fee";
|
|
378
|
-
readonly type: "uint256";
|
|
379
|
-
readonly internalType: "uint256";
|
|
380
|
-
}, {
|
|
381
|
-
readonly name: "output";
|
|
382
|
-
readonly type: "uint256";
|
|
383
|
-
readonly internalType: "uint256";
|
|
384
|
-
}];
|
|
385
|
-
}];
|
|
386
|
-
readonly stateMutability: "view";
|
|
387
|
-
}, {
|
|
388
|
-
readonly type: "function";
|
|
389
|
-
readonly name: "renounceOwnership";
|
|
390
|
-
readonly inputs: readonly [];
|
|
391
|
-
readonly outputs: readonly [];
|
|
392
|
-
readonly stateMutability: "payable";
|
|
393
|
-
}, {
|
|
394
|
-
readonly type: "function";
|
|
395
|
-
readonly name: "requestOwnershipHandover";
|
|
396
|
-
readonly inputs: readonly [];
|
|
397
|
-
readonly outputs: readonly [];
|
|
398
|
-
readonly stateMutability: "payable";
|
|
399
|
-
}, {
|
|
400
|
-
readonly type: "function";
|
|
401
|
-
readonly name: "setBps";
|
|
402
|
-
readonly inputs: readonly [{
|
|
403
|
-
readonly name: "points";
|
|
404
|
-
readonly type: "uint256";
|
|
405
|
-
readonly internalType: "uint256";
|
|
406
|
-
}];
|
|
407
|
-
readonly outputs: readonly [{
|
|
408
|
-
readonly name: "";
|
|
409
|
-
readonly type: "bool";
|
|
410
|
-
readonly internalType: "bool";
|
|
411
|
-
}];
|
|
412
|
-
readonly stateMutability: "nonpayable";
|
|
413
|
-
}, {
|
|
414
|
-
readonly type: "function";
|
|
415
|
-
readonly name: "setInputToken";
|
|
416
|
-
readonly inputs: readonly [{
|
|
417
|
-
readonly name: "token";
|
|
418
|
-
readonly type: "address";
|
|
419
|
-
readonly internalType: "address";
|
|
420
|
-
}, {
|
|
421
|
-
readonly name: "val";
|
|
422
|
-
readonly type: "bool";
|
|
423
|
-
readonly internalType: "bool";
|
|
424
|
-
}];
|
|
425
|
-
readonly outputs: readonly [{
|
|
426
|
-
readonly name: "";
|
|
427
|
-
readonly type: "bool";
|
|
428
|
-
readonly internalType: "bool";
|
|
429
|
-
}];
|
|
430
|
-
readonly stateMutability: "nonpayable";
|
|
431
|
-
}, {
|
|
432
|
-
readonly type: "function";
|
|
433
|
-
readonly name: "status";
|
|
434
|
-
readonly inputs: readonly [];
|
|
435
|
-
readonly outputs: readonly [{
|
|
436
|
-
readonly name: "";
|
|
437
|
-
readonly type: "tuple";
|
|
438
|
-
readonly internalType: "struct Status";
|
|
439
|
-
readonly components: readonly [{
|
|
440
|
-
readonly name: "flags";
|
|
441
|
-
readonly type: "uint32";
|
|
442
|
-
readonly internalType: "uint32";
|
|
443
|
-
}, {
|
|
444
|
-
readonly name: "state";
|
|
445
|
-
readonly type: "uint8";
|
|
446
|
-
readonly internalType: "enum State";
|
|
447
|
-
}];
|
|
448
|
-
}];
|
|
449
|
-
readonly stateMutability: "view";
|
|
450
|
-
}, {
|
|
451
|
-
readonly type: "function";
|
|
452
|
-
readonly name: "stop";
|
|
453
|
-
readonly inputs: readonly [];
|
|
454
|
-
readonly outputs: readonly [{
|
|
455
|
-
readonly name: "";
|
|
456
|
-
readonly type: "bool";
|
|
457
|
-
readonly internalType: "bool";
|
|
458
|
-
}];
|
|
459
|
-
readonly stateMutability: "nonpayable";
|
|
460
|
-
}, {
|
|
461
|
-
readonly type: "function";
|
|
462
|
-
readonly name: "stopped";
|
|
463
|
-
readonly inputs: readonly [];
|
|
464
|
-
readonly outputs: readonly [{
|
|
465
|
-
readonly name: "";
|
|
466
|
-
readonly type: "bool";
|
|
467
|
-
readonly internalType: "bool";
|
|
468
|
-
}];
|
|
469
|
-
readonly stateMutability: "view";
|
|
470
|
-
}, {
|
|
471
|
-
readonly type: "function";
|
|
472
|
-
readonly name: "swap";
|
|
473
|
-
readonly inputs: readonly [{
|
|
474
|
-
readonly name: "token";
|
|
475
|
-
readonly type: "address";
|
|
476
|
-
readonly internalType: "address";
|
|
477
|
-
}, {
|
|
478
|
-
readonly name: "amount";
|
|
479
|
-
readonly type: "uint256";
|
|
480
|
-
readonly internalType: "uint256";
|
|
481
|
-
}, {
|
|
482
|
-
readonly name: "slip";
|
|
483
|
-
readonly type: "uint256";
|
|
484
|
-
readonly internalType: "uint256";
|
|
485
|
-
}];
|
|
486
|
-
readonly outputs: readonly [{
|
|
487
|
-
readonly name: "";
|
|
488
|
-
readonly type: "uint256";
|
|
489
|
-
readonly internalType: "uint256";
|
|
490
|
-
}];
|
|
491
|
-
readonly stateMutability: "nonpayable";
|
|
492
|
-
}, {
|
|
493
|
-
readonly type: "function";
|
|
494
|
-
readonly name: "tokenBalance";
|
|
495
|
-
readonly inputs: readonly [{
|
|
496
|
-
readonly name: "token";
|
|
497
|
-
readonly type: "address";
|
|
498
|
-
readonly internalType: "address";
|
|
499
|
-
}];
|
|
500
|
-
readonly outputs: readonly [{
|
|
501
|
-
readonly name: "";
|
|
502
|
-
readonly type: "uint256";
|
|
503
|
-
readonly internalType: "uint256";
|
|
504
|
-
}];
|
|
505
|
-
readonly stateMutability: "view";
|
|
506
|
-
}, {
|
|
507
|
-
readonly type: "function";
|
|
508
|
-
readonly name: "totals";
|
|
509
|
-
readonly inputs: readonly [{
|
|
510
|
-
readonly name: "user";
|
|
511
|
-
readonly type: "address";
|
|
512
|
-
readonly internalType: "address";
|
|
513
|
-
}, {
|
|
514
|
-
readonly name: "token";
|
|
515
|
-
readonly type: "address";
|
|
516
|
-
readonly internalType: "address";
|
|
517
|
-
}];
|
|
518
|
-
readonly outputs: readonly [{
|
|
519
|
-
readonly name: "";
|
|
520
|
-
readonly type: "tuple";
|
|
521
|
-
readonly internalType: "struct SwapTotal";
|
|
522
|
-
readonly components: readonly [{
|
|
523
|
-
readonly name: "inputSum";
|
|
524
|
-
readonly type: "uint256";
|
|
525
|
-
readonly internalType: "uint256";
|
|
526
|
-
}, {
|
|
527
|
-
readonly name: "feeSum";
|
|
528
|
-
readonly type: "uint256";
|
|
529
|
-
readonly internalType: "uint256";
|
|
530
|
-
}, {
|
|
531
|
-
readonly name: "outputSum";
|
|
532
|
-
readonly type: "uint256";
|
|
533
|
-
readonly internalType: "uint256";
|
|
534
|
-
}, {
|
|
535
|
-
readonly name: "count";
|
|
536
|
-
readonly type: "uint256";
|
|
537
|
-
readonly internalType: "uint256";
|
|
538
|
-
}];
|
|
539
|
-
}];
|
|
540
|
-
readonly stateMutability: "view";
|
|
541
|
-
}, {
|
|
542
|
-
readonly type: "function";
|
|
543
|
-
readonly name: "totals";
|
|
544
|
-
readonly inputs: readonly [{
|
|
545
|
-
readonly name: "token";
|
|
546
|
-
readonly type: "address";
|
|
547
|
-
readonly internalType: "address";
|
|
548
|
-
}];
|
|
549
|
-
readonly outputs: readonly [{
|
|
550
|
-
readonly name: "";
|
|
551
|
-
readonly type: "tuple";
|
|
552
|
-
readonly internalType: "struct SwapTotal";
|
|
553
|
-
readonly components: readonly [{
|
|
554
|
-
readonly name: "inputSum";
|
|
555
|
-
readonly type: "uint256";
|
|
556
|
-
readonly internalType: "uint256";
|
|
557
|
-
}, {
|
|
558
|
-
readonly name: "feeSum";
|
|
559
|
-
readonly type: "uint256";
|
|
560
|
-
readonly internalType: "uint256";
|
|
561
|
-
}, {
|
|
562
|
-
readonly name: "outputSum";
|
|
563
|
-
readonly type: "uint256";
|
|
564
|
-
readonly internalType: "uint256";
|
|
565
|
-
}, {
|
|
566
|
-
readonly name: "count";
|
|
567
|
-
readonly type: "uint256";
|
|
568
|
-
readonly internalType: "uint256";
|
|
569
|
-
}];
|
|
570
|
-
}];
|
|
571
|
-
readonly stateMutability: "view";
|
|
572
|
-
}, {
|
|
573
|
-
readonly type: "function";
|
|
574
|
-
readonly name: "transfer";
|
|
575
|
-
readonly inputs: readonly [{
|
|
576
|
-
readonly name: "to";
|
|
577
|
-
readonly type: "address";
|
|
578
|
-
readonly internalType: "address";
|
|
579
|
-
}, {
|
|
580
|
-
readonly name: "amount";
|
|
581
|
-
readonly type: "uint256";
|
|
582
|
-
readonly internalType: "uint256";
|
|
583
|
-
}];
|
|
584
|
-
readonly outputs: readonly [{
|
|
585
|
-
readonly name: "";
|
|
586
|
-
readonly type: "bool";
|
|
587
|
-
readonly internalType: "bool";
|
|
588
|
-
}];
|
|
589
|
-
readonly stateMutability: "nonpayable";
|
|
590
|
-
}, {
|
|
591
|
-
readonly type: "function";
|
|
592
|
-
readonly name: "transfer";
|
|
593
|
-
readonly inputs: readonly [{
|
|
594
|
-
readonly name: "to";
|
|
595
|
-
readonly type: "address";
|
|
596
|
-
readonly internalType: "address";
|
|
597
|
-
}, {
|
|
598
|
-
readonly name: "token";
|
|
599
|
-
readonly type: "address";
|
|
600
|
-
readonly internalType: "address";
|
|
601
|
-
}, {
|
|
602
|
-
readonly name: "amount";
|
|
603
|
-
readonly type: "uint256";
|
|
604
|
-
readonly internalType: "uint256";
|
|
605
|
-
}];
|
|
606
|
-
readonly outputs: readonly [{
|
|
607
|
-
readonly name: "";
|
|
608
|
-
readonly type: "bool";
|
|
609
|
-
readonly internalType: "bool";
|
|
610
|
-
}];
|
|
611
|
-
readonly stateMutability: "nonpayable";
|
|
612
|
-
}, {
|
|
613
|
-
readonly type: "function";
|
|
614
|
-
readonly name: "transferOwnership";
|
|
615
|
-
readonly inputs: readonly [{
|
|
616
|
-
readonly name: "newOwner";
|
|
617
|
-
readonly type: "address";
|
|
618
|
-
readonly internalType: "address";
|
|
619
|
-
}];
|
|
620
|
-
readonly outputs: readonly [];
|
|
621
|
-
readonly stateMutability: "payable";
|
|
622
|
-
}, {
|
|
623
|
-
readonly type: "event";
|
|
624
|
-
readonly name: "BpsUpdated";
|
|
625
|
-
readonly inputs: readonly [{
|
|
626
|
-
readonly name: "prev";
|
|
627
|
-
readonly type: "uint256";
|
|
628
|
-
readonly indexed: false;
|
|
629
|
-
readonly internalType: "uint256";
|
|
630
|
-
}, {
|
|
631
|
-
readonly name: "next";
|
|
632
|
-
readonly type: "uint256";
|
|
633
|
-
readonly indexed: false;
|
|
634
|
-
readonly internalType: "uint256";
|
|
635
|
-
}];
|
|
636
|
-
readonly anonymous: false;
|
|
637
|
-
}, {
|
|
638
|
-
readonly type: "event";
|
|
639
|
-
readonly name: "InputTokenUpdated";
|
|
640
|
-
readonly inputs: readonly [{
|
|
641
|
-
readonly name: "token";
|
|
642
|
-
readonly type: "address";
|
|
643
|
-
readonly indexed: true;
|
|
644
|
-
readonly internalType: "address";
|
|
645
|
-
}, {
|
|
646
|
-
readonly name: "prev";
|
|
647
|
-
readonly type: "bool";
|
|
648
|
-
readonly indexed: false;
|
|
649
|
-
readonly internalType: "bool";
|
|
650
|
-
}, {
|
|
651
|
-
readonly name: "next";
|
|
652
|
-
readonly type: "bool";
|
|
653
|
-
readonly indexed: false;
|
|
654
|
-
readonly internalType: "bool";
|
|
655
|
-
}];
|
|
656
|
-
readonly anonymous: false;
|
|
657
|
-
}, {
|
|
658
|
-
readonly type: "event";
|
|
659
|
-
readonly name: "OwnershipHandoverCanceled";
|
|
660
|
-
readonly inputs: readonly [{
|
|
661
|
-
readonly name: "pendingOwner";
|
|
662
|
-
readonly type: "address";
|
|
663
|
-
readonly indexed: true;
|
|
664
|
-
readonly internalType: "address";
|
|
665
|
-
}];
|
|
666
|
-
readonly anonymous: false;
|
|
667
|
-
}, {
|
|
668
|
-
readonly type: "event";
|
|
669
|
-
readonly name: "OwnershipHandoverRequested";
|
|
670
|
-
readonly inputs: readonly [{
|
|
671
|
-
readonly name: "pendingOwner";
|
|
672
|
-
readonly type: "address";
|
|
673
|
-
readonly indexed: true;
|
|
674
|
-
readonly internalType: "address";
|
|
675
|
-
}];
|
|
676
|
-
readonly anonymous: false;
|
|
677
|
-
}, {
|
|
678
|
-
readonly type: "event";
|
|
679
|
-
readonly name: "OwnershipTransferred";
|
|
680
|
-
readonly inputs: readonly [{
|
|
681
|
-
readonly name: "oldOwner";
|
|
682
|
-
readonly type: "address";
|
|
683
|
-
readonly indexed: true;
|
|
684
|
-
readonly internalType: "address";
|
|
685
|
-
}, {
|
|
686
|
-
readonly name: "newOwner";
|
|
687
|
-
readonly type: "address";
|
|
688
|
-
readonly indexed: true;
|
|
689
|
-
readonly internalType: "address";
|
|
690
|
-
}];
|
|
691
|
-
readonly anonymous: false;
|
|
692
|
-
}, {
|
|
693
|
-
readonly type: "event";
|
|
694
|
-
readonly name: "Paused";
|
|
695
|
-
readonly inputs: readonly [{
|
|
696
|
-
readonly name: "previous";
|
|
697
|
-
readonly type: "uint32";
|
|
698
|
-
readonly indexed: false;
|
|
699
|
-
readonly internalType: "uint32";
|
|
700
|
-
}, {
|
|
701
|
-
readonly name: "next";
|
|
702
|
-
readonly type: "uint32";
|
|
703
|
-
readonly indexed: false;
|
|
704
|
-
readonly internalType: "uint32";
|
|
705
|
-
}];
|
|
706
|
-
readonly anonymous: false;
|
|
707
|
-
}, {
|
|
708
|
-
readonly type: "event";
|
|
709
|
-
readonly name: "Stopped";
|
|
710
|
-
readonly inputs: readonly [];
|
|
711
|
-
readonly anonymous: false;
|
|
712
|
-
}, {
|
|
713
|
-
readonly type: "event";
|
|
714
|
-
readonly name: "Swapped";
|
|
715
|
-
readonly inputs: readonly [{
|
|
716
|
-
readonly name: "user";
|
|
717
|
-
readonly type: "address";
|
|
718
|
-
readonly indexed: true;
|
|
719
|
-
readonly internalType: "address";
|
|
720
|
-
}, {
|
|
721
|
-
readonly name: "inputToken";
|
|
722
|
-
readonly type: "address";
|
|
723
|
-
readonly indexed: true;
|
|
724
|
-
readonly internalType: "address";
|
|
725
|
-
}, {
|
|
726
|
-
readonly name: "outputToken";
|
|
727
|
-
readonly type: "address";
|
|
728
|
-
readonly indexed: true;
|
|
729
|
-
readonly internalType: "address";
|
|
730
|
-
}, {
|
|
731
|
-
readonly name: "inputAmount";
|
|
732
|
-
readonly type: "uint256";
|
|
733
|
-
readonly indexed: false;
|
|
734
|
-
readonly internalType: "uint256";
|
|
735
|
-
}, {
|
|
736
|
-
readonly name: "fee";
|
|
737
|
-
readonly type: "uint256";
|
|
738
|
-
readonly indexed: false;
|
|
739
|
-
readonly internalType: "uint256";
|
|
740
|
-
}, {
|
|
741
|
-
readonly name: "outputAmount";
|
|
742
|
-
readonly type: "uint256";
|
|
743
|
-
readonly indexed: false;
|
|
744
|
-
readonly internalType: "uint256";
|
|
745
|
-
}];
|
|
746
|
-
readonly anonymous: false;
|
|
747
|
-
}, {
|
|
748
|
-
readonly type: "event";
|
|
749
|
-
readonly name: "Transferred";
|
|
750
|
-
readonly inputs: readonly [{
|
|
751
|
-
readonly name: "to";
|
|
752
|
-
readonly type: "address";
|
|
753
|
-
readonly indexed: true;
|
|
754
|
-
readonly internalType: "address";
|
|
755
|
-
}, {
|
|
756
|
-
readonly name: "token";
|
|
757
|
-
readonly type: "address";
|
|
758
|
-
readonly indexed: true;
|
|
759
|
-
readonly internalType: "address";
|
|
760
|
-
}, {
|
|
761
|
-
readonly name: "amount";
|
|
762
|
-
readonly type: "uint256";
|
|
763
|
-
readonly indexed: false;
|
|
764
|
-
readonly internalType: "uint256";
|
|
765
|
-
}];
|
|
766
|
-
readonly anonymous: false;
|
|
767
|
-
}, {
|
|
768
|
-
readonly type: "error";
|
|
769
|
-
readonly name: "AlreadyInitialized";
|
|
770
|
-
readonly inputs: readonly [];
|
|
771
|
-
}, {
|
|
772
|
-
readonly type: "error";
|
|
773
|
-
readonly name: "InsufficientAmount";
|
|
774
|
-
readonly inputs: readonly [];
|
|
775
|
-
}, {
|
|
776
|
-
readonly type: "error";
|
|
777
|
-
readonly name: "InvalidAddress";
|
|
778
|
-
readonly inputs: readonly [];
|
|
779
|
-
}, {
|
|
780
|
-
readonly type: "error";
|
|
781
|
-
readonly name: "InvalidAmount";
|
|
782
|
-
readonly inputs: readonly [];
|
|
783
|
-
}, {
|
|
784
|
-
readonly type: "error";
|
|
785
|
-
readonly name: "IsPaused";
|
|
786
|
-
readonly inputs: readonly [{
|
|
787
|
-
readonly name: "level";
|
|
788
|
-
readonly type: "uint32";
|
|
789
|
-
readonly internalType: "uint32";
|
|
790
|
-
}];
|
|
791
|
-
}, {
|
|
792
|
-
readonly type: "error";
|
|
793
|
-
readonly name: "IsStopped";
|
|
794
|
-
readonly inputs: readonly [];
|
|
795
|
-
}, {
|
|
796
|
-
readonly type: "error";
|
|
797
|
-
readonly name: "NewOwnerIsZeroAddress";
|
|
798
|
-
readonly inputs: readonly [];
|
|
799
|
-
}, {
|
|
800
|
-
readonly type: "error";
|
|
801
|
-
readonly name: "NoHandoverRequest";
|
|
802
|
-
readonly inputs: readonly [];
|
|
803
|
-
}, {
|
|
804
|
-
readonly type: "error";
|
|
805
|
-
readonly name: "SwapFailed";
|
|
806
|
-
readonly inputs: readonly [{
|
|
807
|
-
readonly name: "user";
|
|
808
|
-
readonly type: "address";
|
|
809
|
-
readonly internalType: "address";
|
|
810
|
-
}, {
|
|
811
|
-
readonly name: "token";
|
|
812
|
-
readonly type: "address";
|
|
813
|
-
readonly internalType: "address";
|
|
814
|
-
}];
|
|
815
|
-
}, {
|
|
816
|
-
readonly type: "error";
|
|
817
|
-
readonly name: "Unauthorized";
|
|
818
|
-
readonly inputs: readonly [];
|
|
819
|
-
}];
|
|
144
|
+
declare function isOndoNotTradableError(error: unknown): error is HttpError;
|
|
820
145
|
|
|
821
146
|
/**
|
|
822
147
|
* Price of 1 output token in USD, assuming the input token is a $1 stablecoin.
|
|
@@ -855,52 +180,10 @@ declare const SWAP_LEVEL = 2;
|
|
|
855
180
|
*/
|
|
856
181
|
declare function isSwapAvailable(status: SwapStatus): boolean;
|
|
857
182
|
|
|
858
|
-
/**
|
|
859
|
-
* Decodes the confirmed output amount from the `Swapped` event in a swap
|
|
860
|
-
* transaction receipt.
|
|
861
|
-
*
|
|
862
|
-
* Returns `null` when the event is absent or the amount is not a valid uint256
|
|
863
|
-
* so callers can fall back to the quote's expected output — the swap already
|
|
864
|
-
* confirmed on-chain, so a missing/undecodable event should not fail the flow.
|
|
865
|
-
*/
|
|
866
|
-
declare function decodeSwappedOutputAmount(receipt: TransactionReceipt, outputDecimals: AssetDecimals): BlockchainAmount | null;
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* Who issues the asset a Superstate swap pays out.
|
|
870
|
-
*
|
|
871
|
-
* A constant rather than a field off the offer: no frontline endpoint carries
|
|
872
|
-
* an issuer, and every offer this checkout serves is Superstate's by
|
|
873
|
-
* definition — `CheckoutContainer` routes here on `superstate::swap` alone.
|
|
874
|
-
*/
|
|
875
|
-
declare const SUPERSTATE_ISSUER_NAME = "Superstate";
|
|
876
|
-
/**
|
|
877
|
-
* The coins a Superstate swap can be funded with, in display order, with the
|
|
878
|
-
* first preselected.
|
|
879
|
-
*
|
|
880
|
-
* USDC alone today: it is what the deployed swap contract accepts. The amount
|
|
881
|
-
* step renders a single entry as a plain card and two or more as a picker, so
|
|
882
|
-
* adding one here is all it takes.
|
|
883
|
-
*/
|
|
884
|
-
declare const SUPERSTATE_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
885
|
-
/** Poll interval for refreshing on-chain swap quotes and balances. */
|
|
886
|
-
declare const SWAP_POLL_INTERVAL_MS = 15000;
|
|
887
|
-
/**
|
|
888
|
-
* Notional input used to derive a display price-per-share when the user has
|
|
889
|
-
* not yet entered an amount (1 USDC at 6 decimals).
|
|
890
|
-
*/
|
|
891
|
-
declare const DEFAULT_AMOUNT_TO_COMPUTE_PRICE = 1000000n;
|
|
892
183
|
/** Slippage tolerances offered in the review step, in basis points. */
|
|
893
184
|
declare const SLIPPAGE_OPTIONS_BPS: Bps[];
|
|
894
185
|
/** Default slippage tolerance (0.5%). */
|
|
895
186
|
declare const DEFAULT_SLIPPAGE_BPS: Bps;
|
|
896
|
-
/**
|
|
897
|
-
* The deployed Superstate swap contract on Ethereum Sepolia, and therefore the
|
|
898
|
-
* ERC-20 spender the user approves there.
|
|
899
|
-
*
|
|
900
|
-
* Exported in its own right for a partner driving `coinlist.superstate.execute`
|
|
901
|
-
* at Level 1, where the contract is an explicit parameter.
|
|
902
|
-
*/
|
|
903
|
-
declare const SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA: EvmContractAddress;
|
|
904
187
|
/**
|
|
905
188
|
* The Superstate swap contract on `chain`, or `null` where none is deployed.
|
|
906
189
|
*
|
|
@@ -921,39 +204,6 @@ declare function superstateSwapContractAddress(chain: EthereumChain): EvmContrac
|
|
|
921
204
|
*/
|
|
922
205
|
declare function formattedPricePerShare(quote: SwapQuote | null, locale: string): FormattedAmountAssetUi;
|
|
923
206
|
|
|
924
|
-
/**
|
|
925
|
-
* The CoinList contract a swap on `chain` settles through, and therefore the
|
|
926
|
-
* ERC-20 spender the user approves - or `null` where this offer cannot be
|
|
927
|
-
* swapped on that chain.
|
|
928
|
-
*
|
|
929
|
-
* Read off the offer rather than held as a constant because the address varies
|
|
930
|
-
* by environment, not only by chain: beta and production both run
|
|
931
|
-
* `ethereum_sepolia` and deploy a different contract on each, and one constant
|
|
932
|
-
* cannot name both. Frontline resolves it per environment and serves the
|
|
933
|
-
* answer on the offer.
|
|
934
|
-
*
|
|
935
|
-
* The array varies per *offer* as well as per chain - frontline drops a chain
|
|
936
|
-
* whose funding and swap tokens do not both resolve for this asset - so an
|
|
937
|
-
* array read for one symbol must not be reused for another. An empty array
|
|
938
|
-
* means "cannot swap here", which is an answer rather than an error.
|
|
939
|
-
*
|
|
940
|
-
* A capability rather than a provider slice, and named for the data it reads
|
|
941
|
-
* rather than for its first caller: `swap_contracts` is an offer field, and
|
|
942
|
-
* `universal-core-isolation-and-sharing` would stop Superstate reusing this if
|
|
943
|
-
* it lived under `checkout/ondo/`. Superstate has not migrated yet - it still
|
|
944
|
-
* reads `superstateSwapContractAddress` - so Ondo is the only caller today.
|
|
945
|
-
*/
|
|
946
|
-
declare function swapSpender(swapContracts: OfferSwapContract[], chain: EthereumChain): EvmContractAddress | null;
|
|
947
|
-
|
|
948
|
-
/** Basis-point denominator: 10_000 bps = 100%. */
|
|
949
|
-
declare const BPS_DENOM: Bps;
|
|
950
|
-
/**
|
|
951
|
-
* Applies a basis-point fraction to an amount, flooring the result.
|
|
952
|
-
* `floor((amount × bps) / BPS_DENOM)`. The result is bounds-checked, so an
|
|
953
|
-
* overflow (bps far above BPS_DENOM) or a negative product is rejected.
|
|
954
|
-
*/
|
|
955
|
-
declare function applyBps(amount: Uint256, bps: Bps): Uint256;
|
|
956
|
-
|
|
957
207
|
/** The viem chain definition the SDK reads and writes this chain through. */
|
|
958
208
|
declare function viemChain(chain: EthereumChain): Chain;
|
|
959
209
|
declare function getChainId(chain: EthereumChain): number;
|
|
@@ -968,158 +218,6 @@ declare function chainFromId(chainId: string): EthereumChain;
|
|
|
968
218
|
declare function getNetworkName(chain: EthereumChain): string;
|
|
969
219
|
declare function txExplorerUrl(chain: EthereumChain, txHash: Hash): TxExplorerUrl;
|
|
970
220
|
|
|
971
|
-
/**
|
|
972
|
-
* Minimal ERC-20 ABI the SDK writes against (mirrors viem's `erc20Abi`). The
|
|
973
|
-
* swap flow uses `approve`; `allowance`/`balanceOf`/`decimals`/`symbol`/`name`
|
|
974
|
-
* are included so reads share a single SDK-owned ABI.
|
|
975
|
-
*/
|
|
976
|
-
declare const ERC20_ABI: readonly [{
|
|
977
|
-
readonly type: "function";
|
|
978
|
-
readonly name: "allowance";
|
|
979
|
-
readonly inputs: readonly [{
|
|
980
|
-
readonly name: "owner";
|
|
981
|
-
readonly type: "address";
|
|
982
|
-
}, {
|
|
983
|
-
readonly name: "spender";
|
|
984
|
-
readonly type: "address";
|
|
985
|
-
}];
|
|
986
|
-
readonly outputs: readonly [{
|
|
987
|
-
readonly name: "";
|
|
988
|
-
readonly type: "uint256";
|
|
989
|
-
}];
|
|
990
|
-
readonly stateMutability: "view";
|
|
991
|
-
}, {
|
|
992
|
-
readonly type: "function";
|
|
993
|
-
readonly name: "approve";
|
|
994
|
-
readonly inputs: readonly [{
|
|
995
|
-
readonly name: "spender";
|
|
996
|
-
readonly type: "address";
|
|
997
|
-
}, {
|
|
998
|
-
readonly name: "amount";
|
|
999
|
-
readonly type: "uint256";
|
|
1000
|
-
}];
|
|
1001
|
-
readonly outputs: readonly [{
|
|
1002
|
-
readonly name: "";
|
|
1003
|
-
readonly type: "bool";
|
|
1004
|
-
}];
|
|
1005
|
-
readonly stateMutability: "nonpayable";
|
|
1006
|
-
}, {
|
|
1007
|
-
readonly type: "function";
|
|
1008
|
-
readonly name: "balanceOf";
|
|
1009
|
-
readonly inputs: readonly [{
|
|
1010
|
-
readonly name: "account";
|
|
1011
|
-
readonly type: "address";
|
|
1012
|
-
}];
|
|
1013
|
-
readonly outputs: readonly [{
|
|
1014
|
-
readonly name: "";
|
|
1015
|
-
readonly type: "uint256";
|
|
1016
|
-
}];
|
|
1017
|
-
readonly stateMutability: "view";
|
|
1018
|
-
}, {
|
|
1019
|
-
readonly type: "function";
|
|
1020
|
-
readonly name: "decimals";
|
|
1021
|
-
readonly inputs: readonly [];
|
|
1022
|
-
readonly outputs: readonly [{
|
|
1023
|
-
readonly name: "";
|
|
1024
|
-
readonly type: "uint8";
|
|
1025
|
-
}];
|
|
1026
|
-
readonly stateMutability: "view";
|
|
1027
|
-
}, {
|
|
1028
|
-
readonly type: "function";
|
|
1029
|
-
readonly name: "name";
|
|
1030
|
-
readonly inputs: readonly [];
|
|
1031
|
-
readonly outputs: readonly [{
|
|
1032
|
-
readonly name: "";
|
|
1033
|
-
readonly type: "string";
|
|
1034
|
-
}];
|
|
1035
|
-
readonly stateMutability: "view";
|
|
1036
|
-
}, {
|
|
1037
|
-
readonly type: "function";
|
|
1038
|
-
readonly name: "symbol";
|
|
1039
|
-
readonly inputs: readonly [];
|
|
1040
|
-
readonly outputs: readonly [{
|
|
1041
|
-
readonly name: "";
|
|
1042
|
-
readonly type: "string";
|
|
1043
|
-
}];
|
|
1044
|
-
readonly stateMutability: "view";
|
|
1045
|
-
}, {
|
|
1046
|
-
readonly type: "function";
|
|
1047
|
-
readonly name: "totalSupply";
|
|
1048
|
-
readonly inputs: readonly [];
|
|
1049
|
-
readonly outputs: readonly [{
|
|
1050
|
-
readonly name: "";
|
|
1051
|
-
readonly type: "uint256";
|
|
1052
|
-
}];
|
|
1053
|
-
readonly stateMutability: "view";
|
|
1054
|
-
}, {
|
|
1055
|
-
readonly type: "function";
|
|
1056
|
-
readonly name: "transfer";
|
|
1057
|
-
readonly inputs: readonly [{
|
|
1058
|
-
readonly name: "recipient";
|
|
1059
|
-
readonly type: "address";
|
|
1060
|
-
}, {
|
|
1061
|
-
readonly name: "amount";
|
|
1062
|
-
readonly type: "uint256";
|
|
1063
|
-
}];
|
|
1064
|
-
readonly outputs: readonly [{
|
|
1065
|
-
readonly name: "";
|
|
1066
|
-
readonly type: "bool";
|
|
1067
|
-
}];
|
|
1068
|
-
readonly stateMutability: "nonpayable";
|
|
1069
|
-
}, {
|
|
1070
|
-
readonly type: "function";
|
|
1071
|
-
readonly name: "transferFrom";
|
|
1072
|
-
readonly inputs: readonly [{
|
|
1073
|
-
readonly name: "sender";
|
|
1074
|
-
readonly type: "address";
|
|
1075
|
-
}, {
|
|
1076
|
-
readonly name: "recipient";
|
|
1077
|
-
readonly type: "address";
|
|
1078
|
-
}, {
|
|
1079
|
-
readonly name: "amount";
|
|
1080
|
-
readonly type: "uint256";
|
|
1081
|
-
}];
|
|
1082
|
-
readonly outputs: readonly [{
|
|
1083
|
-
readonly name: "";
|
|
1084
|
-
readonly type: "bool";
|
|
1085
|
-
}];
|
|
1086
|
-
readonly stateMutability: "nonpayable";
|
|
1087
|
-
}, {
|
|
1088
|
-
readonly type: "event";
|
|
1089
|
-
readonly name: "Approval";
|
|
1090
|
-
readonly inputs: readonly [{
|
|
1091
|
-
readonly name: "owner";
|
|
1092
|
-
readonly type: "address";
|
|
1093
|
-
readonly indexed: true;
|
|
1094
|
-
}, {
|
|
1095
|
-
readonly name: "spender";
|
|
1096
|
-
readonly type: "address";
|
|
1097
|
-
readonly indexed: true;
|
|
1098
|
-
}, {
|
|
1099
|
-
readonly name: "value";
|
|
1100
|
-
readonly type: "uint256";
|
|
1101
|
-
readonly indexed: false;
|
|
1102
|
-
}];
|
|
1103
|
-
readonly anonymous: false;
|
|
1104
|
-
}, {
|
|
1105
|
-
readonly type: "event";
|
|
1106
|
-
readonly name: "Transfer";
|
|
1107
|
-
readonly inputs: readonly [{
|
|
1108
|
-
readonly name: "from";
|
|
1109
|
-
readonly type: "address";
|
|
1110
|
-
readonly indexed: true;
|
|
1111
|
-
}, {
|
|
1112
|
-
readonly name: "to";
|
|
1113
|
-
readonly type: "address";
|
|
1114
|
-
readonly indexed: true;
|
|
1115
|
-
}, {
|
|
1116
|
-
readonly name: "value";
|
|
1117
|
-
readonly type: "uint256";
|
|
1118
|
-
readonly indexed: false;
|
|
1119
|
-
}];
|
|
1120
|
-
readonly anonymous: false;
|
|
1121
|
-
}];
|
|
1122
|
-
|
|
1123
221
|
declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
|
|
1124
222
|
type FormatAmountOptions = {
|
|
1125
223
|
maxFractionDigits?: AssetDecimals;
|
|
@@ -1274,21 +372,4 @@ declare class MathError extends Error {
|
|
|
1274
372
|
constructor(message: string);
|
|
1275
373
|
}
|
|
1276
374
|
|
|
1277
|
-
type
|
|
1278
|
-
id: string;
|
|
1279
|
-
email: string;
|
|
1280
|
-
};
|
|
1281
|
-
|
|
1282
|
-
type UserId = Newtype<string, 'UserId'>;
|
|
1283
|
-
declare const UserId: (value: string) => UserId;
|
|
1284
|
-
type UserEmail = Newtype<string, 'UserEmail'>;
|
|
1285
|
-
declare const UserEmail: (value: string) => UserEmail;
|
|
1286
|
-
type User = {
|
|
1287
|
-
id: UserId;
|
|
1288
|
-
email: UserEmail;
|
|
1289
|
-
};
|
|
1290
|
-
declare const User: {
|
|
1291
|
-
fromDto: (dto: UserDto) => User;
|
|
1292
|
-
};
|
|
1293
|
-
|
|
1294
|
-
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, SWAP_LEVEL, SWAP_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
|
|
375
|
+
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BlockchainAmount, Bps, ClientId, CodeChallenge, CodeVerifier, DEFAULT_SLIPPAGE_BPS, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, HttpError, type HttpResponse, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NotAuthenticatedError, NotImplementedError, OfferSwapContract, OndoBuyTransaction, OndoSellTransaction, type PKCEConfig, type PKCEParams, PKCEState, RedirectUri, RequestId, SLIPPAGE_OPTIONS_BPS, SWAP_LEVEL, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, ValidationError, apiErrorCode, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, generatePKCEParams, getChainId, getNetworkName, isOndoNotTradableError, isSwapAvailable, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
|