@coinlist-co/react 0.12.2-rc.bc20f5b → 0.12.2-rc.e1f6c82
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/dist/{chunk-3WW5FLT7.js → chunk-EKLUJZ7T.js} +10 -10
- package/dist/chunk-EKLUJZ7T.js.map +1 -0
- package/dist/{chunk-C6GF7MDF.js → chunk-GIE4UWB3.js} +680 -619
- package/dist/chunk-GIE4UWB3.js.map +1 -0
- package/dist/chunk-MJ6YXZWH.js +22 -0
- package/dist/chunk-MJ6YXZWH.js.map +1 -0
- package/dist/{chunk-IZJ4JSSC.js → chunk-PIOQA6HW.js} +173 -234
- package/dist/chunk-PIOQA6HW.js.map +1 -0
- package/dist/client/index.d.ts +2414 -5239
- package/dist/client/index.js +683 -788
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.d.ts +2 -32
- package/dist/server/index.js +6 -4
- package/dist/server/index.js.map +1 -1
- package/dist/{time-CVZpAkGY.d.cts → time-Bbqlt2x7.d.ts} +1907 -3183
- package/dist/{token-registry-snapshot-BkwA8KmD.d.ts → token-registry-snapshot-DttZXGvY.d.ts} +7 -41
- package/dist/universal/index.d.ts +57 -1044
- package/dist/universal/index.js +16 -42
- package/package.json +18 -14
- package/dist/chunk-3WW5FLT7.js.map +0 -1
- package/dist/chunk-C6GF7MDF.js.map +0 -1
- package/dist/chunk-IZJ4JSSC.js.map +0 -1
- package/dist/client/index.cjs +0 -20460
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.d.cts +0 -8195
- package/dist/server/index.cjs +0 -4525
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.d.cts +0 -382
- package/dist/time-CVZpAkGY.d.ts +0 -3987
- package/dist/token-registry-snapshot-bR14QehS.d.cts +0 -245
- package/dist/universal/index.cjs +0 -4562
- package/dist/universal/index.cjs.map +0 -1
- package/dist/universal/index.d.cts +0 -1362
|
@@ -1,1362 +0,0 @@
|
|
|
1
|
-
import { aI as PaginationParams, aJ as PaginatedResponse, a as EthereumChain, b as EvmContractAddress, J as TokenMetadata, aL as OfferToken, K as CentrifugeVaultOfferDetail, aM as DecimalString, G as StablecoinSymbol, o as OndoBuyTransaction, B as BlockchainAmount, p as OndoSellTransaction, ap as HttpError, u as Bps, aN as SwapStatus, a9 as AssetDecimals, n as OfferSwapContract, aO as Uint256, d as AssetSymbol, v as EvmWalletAddress, aP as KnownAssetSymbol, H as Erc20Asset, aQ as Newtype } from '../time-CVZpAkGY.cjs';
|
|
2
|
-
export { aR as AllowWalletParams, aS as AllowWalletResponse, aT as Asset, aU as AssetCode, k as AssetId, _ as AsyncOfferDetail, Z as AsyncOfferType, A as AuthorizationCode, aV as Blockchain, aa as BuildCentrifugeVaultBuyParams, ae as BuildOndoBuyParams, af as BuildOndoSellParams, aW as BuildOndoSwapParamsCore, f as CentrifugeClaimDirection, c as CentrifugeNamespace, g as CentrifugeNamespaceImpl, ab as CentrifugeOrderReason, ac as CentrifugeOrderability, aX as CentrifugePositionStatus, e as CentrifugeVaultBuyTransaction, aY as CentrifugeVaultClaimProceedsTransaction, aZ as CentrifugeVaultClaimTransaction, aj as CentrifugeVaultLeg, X as CentrifugeVaultLegId, a_ as CentrifugeVaultOffer, a$ as CentrifugeVaultPosition, b0 as CentrifugeVaultReason, b1 as CentrifugeVaultRedeemPosition, al as CentrifugeVaultStatus, b2 as CentrifugeVaultTransactionCore, b3 as CentrifugeWalletParams, b4 as Chain, aG as ClientCredentialsOAuth, b5 as ClientId, aK as ClientSecret, b6 as CodeChallenge, C as CodeVerifier, h as CoinListTokenSaleNamespace, l as CoinListTokenSaleNamespaceImpl, b7 as CoinListTokenSaleOffer, Q as CoinListTokenSaleOfferDetail, z as Config, b8 as ConnectExternalWalletParams, b9 as CreateKycTokenParams, ba as CreateParticipationParams, bb as CreateWalletOwnershipChallengeParams, bc as Cursor, an as DebugEvent, bd as DocumentFormType, a6 as DocumentSubmission, be as DocumentSubmissionStatus, bf as DocumentType, bg as ETHEREUM_CHAINS, bh as EpochMillis, E as Erc20Namespace, bi as Erc20NamespaceImpl, bj as FaqItem, ao as FrontlineEventId, bk as GetCentrifugeVaultStatusParams, bl as GetOndoQuoteParams, bm as GetOndoTradingStatusParams, bn as GetSwapAuthorizationParams, bo as GetSwapPreviewParams, bp as GetTokenAllowanceParams, bq as GetTokenBalanceParams, br as HexEncodedTransactionData, aq as HttpResponse, bs as Isin, bt as Iso2CountryCode, a5 as KycLevelName, ar as KycToken, bu as Link, bv as ListOptionAddressesParams, as as LogBinding, at as LogBindings, au as LogCause, av as LogLevel, aw as LogScope, ax as LogValue, L as Logger, bw as MAX_ASSET_DECIMALS, bx as MAX_UINT_256, by as Milestone, bz as Millis, D as OAuthAccessToken, bA as OAuthRefreshToken, aF as OAuthSession, $ as Offer, bB as OfferBase, I as OfferDetail, bC as OfferDetailBase, bD as OfferEditorial, i as OfferId, bE as OfferOption, a3 as OfferOptionAddress, ak as OfferOptionAddressId, j as OfferOptionId, bF as OfferOptionSlug, bG as OfferSlug, M as OfferType, O as OfferVaultContract, F as OffersNamespace, bH as OffersNamespaceImpl, m as OndoNamespace, s as OndoNamespaceImpl, ag as OndoQuote, bI as OndoQuoteDuration, ah as OndoQuoteSize, bJ as OndoSellOutcome, bK as OndoSwapOffer, N as OndoSwapOfferDetail, q as OndoSwapTransactionCore, ad as OndoTradingStatus, r as OrderBookSide, bL as PKCEState, bM as PaginatedResponseDto, P as Participation, bN as ParticipationId, bO as ParticipationStatus, bP as ParticipationsPaginationParams, bQ as PauseFlags, bR as Pii, bS as PiiAddress, bT as PiiJurisdiction, bU as PiiKind, a8 as PinoLoggerOptions, ay as ProductionLogLevel, bV as QueryParamValue, bW as QueryParamValues, az as RedactedWalletError, bX as RedirectUri, bY as RemoveOptionAddressParams, aA as RequestId, x as Requirement, bZ as RequirementActionNeededReason, a4 as RequirementId, a0 as RequirementStatusInfo, a2 as RequirementStatusValue, a1 as RequirementType, R as RequirementsNamespace, y as RequirementsNamespaceImpl, b_ as RpcConfig, aB as RpcFailureReason, b$ as SOLANA_CHAINS, c0 as STABLE_DECIMALS, aC as SafeEvent, aD as SafeFields, Y as Seconds, c1 as SolanaChain, c2 as SubmitDocumentParams, S as SuperstateSwapNamespace, w as SuperstateSwapNamespaceImpl, c3 as SuperstateSwapOffer, V as SuperstateSwapOfferDetail, c4 as SwapContractRef, c5 as SwapPreview, c6 as TermItem, c7 as Ticker, ai as TokenIdentifier, am as TokenLogo, c8 as TokenLogoImage, c9 as TokenLogoUrl, ca as TokenRole, T as TokensNamespace, cb as TokensNamespaceImpl, cc as Tx, aE as UnredactedFields, cd as WalletAddress, a7 as WalletChallengeType, W as WalletError, ce as WalletOwnershipChallenge, cf as WalletProtocol, t as WalletsNamespace, cg as WalletsNamespaceImpl, ch as apiErrorCode, ci as assertUint256, cj as isChain, ck as isExpired, cl as isOfferType, cm as parseUint256 } from '../time-CVZpAkGY.cjs';
|
|
3
|
-
import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl, h as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress } from '../token-registry-snapshot-bR14QehS.cjs';
|
|
4
|
-
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, e as EvmSigner, E as EvmWallet, f as ExternalWalletAdapter, P as PKCEConfig, i as PKCEParams, d as TokenRegistrySnapshot, c as WalletLabelResolver, W as WalletSelection, g as WriteContractParams, j as generatePKCEParams, o as offerDisplayTokens } from '../token-registry-snapshot-bR14QehS.cjs';
|
|
5
|
-
import { TransactionReceipt, Hash, Chain } from 'viem';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Walks every page of a cursor-paginated endpoint and returns the flattened
|
|
9
|
-
* result.
|
|
10
|
-
*
|
|
11
|
-
* Lives in the API layer rather than beside `PaginationParams` because it
|
|
12
|
-
* drives requests: it is the auto-paginating half that `list()` is built on,
|
|
13
|
-
* while the params and the response envelope are domain models the client and
|
|
14
|
-
* the server both name.
|
|
15
|
-
*/
|
|
16
|
-
declare function fetchAllPages<A, P extends PaginationParams = PaginationParams>(fetchPage: (params: P) => Promise<PaginatedResponse<A>>, baseParams?: Omit<P, keyof PaginationParams>): Promise<A[]>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* How often the Centrifuge checkout refreshes the vault status. The read is
|
|
20
|
-
* free - it spends no attestation - so this is paced for a gate the user can
|
|
21
|
-
* trust rather than for cost.
|
|
22
|
-
*/
|
|
23
|
-
declare const CENTRIFUGE_POLL_INTERVAL_MS = 15000;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* One chain a vault offer runs on, with everything a screen needs to read and
|
|
27
|
-
* show a position there: the proxy every request and claim goes through, the
|
|
28
|
-
* share token it issues, and the funding token it is paid in.
|
|
29
|
-
*
|
|
30
|
-
* The share token's `symbol` is what every `/v1/centrifuge/vault/*` call is
|
|
31
|
-
* keyed by.
|
|
32
|
-
*/
|
|
33
|
-
type CentrifugeVault = {
|
|
34
|
-
chain: EthereumChain;
|
|
35
|
-
proxy: EvmContractAddress;
|
|
36
|
-
share: TokenMetadata;
|
|
37
|
-
funding: TokenMetadata;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* The vaults an offer runs on, or why a chain could not be resolved: one
|
|
41
|
-
* entry per `vaultContracts` chain, in the offer's order.
|
|
42
|
-
*/
|
|
43
|
-
type CentrifugeVaultResolution = {
|
|
44
|
-
type: 'resolved';
|
|
45
|
-
vault: CentrifugeVault;
|
|
46
|
-
} | {
|
|
47
|
-
type: 'unresolved';
|
|
48
|
-
chain: OfferToken['chain'];
|
|
49
|
-
/** Which token the offer or the registry could not name. */
|
|
50
|
-
missing: 'share-token' | 'funding-token' | 'evm-chain';
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Resolves each chain of a vault offer to its share and funding tokens.
|
|
54
|
-
*
|
|
55
|
-
* The offer names tokens by role and address only - the share token as
|
|
56
|
-
* `vault`, the coin it is paid in as `funding` - so `lookup` turns each into
|
|
57
|
-
* metadata. A function rather than a registry snapshot, so this module does
|
|
58
|
-
* not depend on where the metadata comes from.
|
|
59
|
-
*
|
|
60
|
-
* A chain whose tokens cannot be named is reported rather than dropped: its
|
|
61
|
-
* position cannot be read without the symbol, and a caller has to know it is
|
|
62
|
-
* not showing it. When a chain lists several funding tokens, the first one
|
|
63
|
-
* `lookup` knows wins - a vault is priced in one.
|
|
64
|
-
*/
|
|
65
|
-
declare function resolveCentrifugeVaults(offer: CentrifugeVaultOfferDetail, lookup: (token: OfferToken) => TokenMetadata | null): CentrifugeVaultResolution[];
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* How often the Ondo checkout refreshes what it is allowed to poll: the market
|
|
69
|
-
* status and the indicative price. Both are free - neither spends an
|
|
70
|
-
* attestation - so this is paced for a price the user can trust rather than
|
|
71
|
-
* for cost.
|
|
72
|
-
*
|
|
73
|
-
* A built transaction is deliberately not on this timer. Building spends an
|
|
74
|
-
* attestation, so it happens once per order and once per refresh the user
|
|
75
|
-
* asks for.
|
|
76
|
-
*/
|
|
77
|
-
declare const ONDO_POLL_INTERVAL_MS = 15000;
|
|
78
|
-
/** Max time the review step offers a built quote. */
|
|
79
|
-
declare const ONDO_QUOTE_MAX_TTL_MS = 15000;
|
|
80
|
-
/**
|
|
81
|
-
* The order size the sidebar prices against before the user names one.
|
|
82
|
-
*
|
|
83
|
-
* Ondo prices by size, so some amount has to be sent. $1,000 is a plausible
|
|
84
|
-
* order rather than a token one: a size so small that Ondo's minimum rejects
|
|
85
|
-
* it would leave the panel permanently blank.
|
|
86
|
-
*
|
|
87
|
-
* Named distinctly from `DEFAULT_AMOUNT_TO_COMPUTE_PRICE` in the swap
|
|
88
|
-
* constants, which is a raw `bigint` of USDC base units for a different
|
|
89
|
-
* endpoint. Both barrels are flat, so two constants of the same name could not
|
|
90
|
-
* coexist - and they mean different things anyway.
|
|
91
|
-
*/
|
|
92
|
-
declare const DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE: DecimalString;
|
|
93
|
-
/**
|
|
94
|
-
* The coin an Ondo sell settles into, for display only.
|
|
95
|
-
*
|
|
96
|
-
* The scale of every amount on a built transaction comes off the response, so
|
|
97
|
-
* this names the token and never sizes it - `receive_output_decimals` is the
|
|
98
|
-
* only authority on how many decimals the proceeds are counted in, and the two
|
|
99
|
-
* are allowed to disagree.
|
|
100
|
-
*
|
|
101
|
-
* Named apart from {@link ONDO_SUPPORTED_INPUT_ASSETS} rather than read out of
|
|
102
|
-
* it, though both are USDC today. On a buy USDC is what the user funds with
|
|
103
|
-
* and one of a list that may grow; on a sell it is what they settle into and
|
|
104
|
-
* there is one of it. Reading `ONDO_SUPPORTED_INPUT_ASSETS[0]` here would make
|
|
105
|
-
* the sell screen quietly follow whichever funding coin happened to be listed
|
|
106
|
-
* first.
|
|
107
|
-
*/
|
|
108
|
-
declare const ONDO_SETTLEMENT_ASSET: StablecoinSymbol;
|
|
109
|
-
/**
|
|
110
|
-
* The order size the sidebar prices a sell against before the user names one.
|
|
111
|
-
*
|
|
112
|
-
* Sells are quoted by token amount rather than by notional: the fee comes out
|
|
113
|
-
* of dollars, and Ondo's price is size-aware, so a buy's quantity depends on
|
|
114
|
-
* the quote being asked for while a sell is sized by what the user already
|
|
115
|
-
* holds. One whole share is a size Ondo will price - small enough to be
|
|
116
|
-
* plausible for any asset, large enough that Ondo's minimum does not reject it
|
|
117
|
-
* and leave the panel permanently blank.
|
|
118
|
-
*
|
|
119
|
-
* The buy counterpart is {@link DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE}, which
|
|
120
|
-
* is a dollar figure for the same reason in reverse.
|
|
121
|
-
*/
|
|
122
|
-
declare const DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE = 1;
|
|
123
|
-
/**
|
|
124
|
-
* The coins an Ondo buy can be funded with, in display order, with the first
|
|
125
|
-
* preselected.
|
|
126
|
-
*
|
|
127
|
-
* USDC alone today: it is what the Sepolia integration contract accepts. The
|
|
128
|
-
* amount step renders a single entry as a plain card and two or more as a
|
|
129
|
-
* picker, so adding one here is all it takes.
|
|
130
|
-
*/
|
|
131
|
-
declare const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* The price of one whole asset token in a built Ondo purchase, in the funding
|
|
135
|
-
* token's units - USD per share.
|
|
136
|
-
*
|
|
137
|
-
* Neither builder publishes a price. Frontline drops Ninshubur's deliberately,
|
|
138
|
-
* because `GET /v1/ondo/swap/quote` already serves one under that name at a
|
|
139
|
-
* different scale, and echoing both would leave a caller to guess which was
|
|
140
|
-
* which.
|
|
141
|
-
*
|
|
142
|
-
* Dividing the two amounts the response *does* carry is better than reading
|
|
143
|
-
* the indicative one anyway: it is the price this transaction fills at, rather
|
|
144
|
-
* than a poll that has since moved and was struck against a different size.
|
|
145
|
-
*
|
|
146
|
-
* **Fee-exclusive.** `notionalValue` is the deposit after CoinList's fee comes
|
|
147
|
-
* off, so this is the price Ondo filled at, not the buyer's all-in cost per
|
|
148
|
-
* token - that would be `spendInputAmount / receiveOutputAmount`, and it is
|
|
149
|
-
* higher. Fee-exclusive is what the review screen wants, because it renders
|
|
150
|
-
* the fee on its own line: price x quantity, plus fee, comes to the total.
|
|
151
|
-
* Making this all-in would double-count the fee against that breakdown.
|
|
152
|
-
*
|
|
153
|
-
* The two are equal until ENG-1718 turns a fee on, which frontline rejects
|
|
154
|
-
* today. They diverge the moment it does, so the choice is load-bearing rather
|
|
155
|
-
* than academic.
|
|
156
|
-
*/
|
|
157
|
-
declare function computeOndoBuyPrice(transaction: OndoBuyTransaction): BlockchainAmount;
|
|
158
|
-
/**
|
|
159
|
-
* The price of one whole asset token in a built Ondo sale, in the settlement
|
|
160
|
-
* token's units - USD per share, the same thing
|
|
161
|
-
* {@link computeOndoBuyPrice} answers with the ratio inverted.
|
|
162
|
-
*
|
|
163
|
-
* **Fee-exclusive, and it takes arithmetic to be so.** `expected.quantity` is
|
|
164
|
-
* published already net of `expected.fee`, so the proceeds are added back
|
|
165
|
-
* before dividing: what comes out is the price Ondo filled at, which is the
|
|
166
|
-
* buy arm's meaning rather than a second one. That is what lets one review row
|
|
167
|
-
* render on either screen, and what keeps the sell breakdown honest - the fee
|
|
168
|
-
* sits on its own line beside this, and a net price would count it twice.
|
|
169
|
-
*
|
|
170
|
-
* Read against {@link OndoSellTransaction.expected} alone. The `minimum` arm
|
|
171
|
-
* describes the same trade at a different outcome, and pricing that one would
|
|
172
|
-
* answer "the worst price this could fill at", which no screen asks for.
|
|
173
|
-
*
|
|
174
|
-
* The two readings coincide while frontline forces the fee to zero, which it
|
|
175
|
-
* does today. They diverge the day ENG-1718 lands.
|
|
176
|
-
*/
|
|
177
|
-
declare function computeOndoSellPrice(transaction: OndoSellTransaction): BlockchainAmount;
|
|
178
|
-
/** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
|
|
179
|
-
declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* The CoinList API's error code for an Ondo quote refused because the asset
|
|
183
|
-
* cannot be traded right now: the market is closed or paused, or the asset is
|
|
184
|
-
* paused or closed for the session. It arrives on a 409.
|
|
185
|
-
*
|
|
186
|
-
* One code for all four of Ondo's reasons, because the remedy is the same:
|
|
187
|
-
* wait for the market to open. Ondo pauses for a moment at every US session
|
|
188
|
-
* change (04:00 and 16:00 ET), so a poll can land on one even while
|
|
189
|
-
* `getTradingStatus` reported the asset tradable a second earlier.
|
|
190
|
-
*/
|
|
191
|
-
declare const ONDO_NOT_TRADABLE_CODE = "not_tradable";
|
|
192
|
-
/**
|
|
193
|
-
* Whether `error` is the CoinList API refusing an Ondo quote because the
|
|
194
|
-
* market is not open, as opposed to a request that failed.
|
|
195
|
-
*
|
|
196
|
-
* Total: anything that is not an `HttpError` carrying
|
|
197
|
-
* {@link ONDO_NOT_TRADABLE_CODE} is `false`.
|
|
198
|
-
*/
|
|
199
|
-
declare function isOndoNotTradableError(error: unknown): error is HttpError;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* The Superstate swap contract's ABI, generated verbatim from the shared
|
|
203
|
-
* `TokenSwap` base contract:
|
|
204
|
-
*
|
|
205
|
-
* ```
|
|
206
|
-
* cd ../solidity && forge inspect TokenSwap abi --json --use 0.8.34
|
|
207
|
-
* ```
|
|
208
|
-
*
|
|
209
|
-
* Generated rather than hand-trimmed to the four methods the SDK calls, so
|
|
210
|
-
* regenerating after a contract change is one command and a paste. The custom
|
|
211
|
-
* errors carry their weight in particular: viem decodes a revert against them,
|
|
212
|
-
* so a `preview()` on a stopped contract surfaces as `IsStopped` rather than
|
|
213
|
-
* as an opaque `0x`-prefixed blob.
|
|
214
|
-
*
|
|
215
|
-
* `status()` returns `Status { uint32 flags; State state }` where `State` is
|
|
216
|
-
* `0 = Active | 1 = Paused | 2 = Stopped`. It replaced the older
|
|
217
|
-
* `stopped() -> uint256` bitmask, which this contract still exposes but as a
|
|
218
|
-
* `bool`; {@link SwapStatus} reads `status()` and nothing else.
|
|
219
|
-
*/
|
|
220
|
-
declare const SUPERSTATE_SWAP_ABI: readonly [{
|
|
221
|
-
readonly type: "function";
|
|
222
|
-
readonly name: "KIND";
|
|
223
|
-
readonly inputs: readonly [];
|
|
224
|
-
readonly outputs: readonly [{
|
|
225
|
-
readonly name: "";
|
|
226
|
-
readonly type: "uint16";
|
|
227
|
-
readonly internalType: "uint16";
|
|
228
|
-
}];
|
|
229
|
-
readonly stateMutability: "view";
|
|
230
|
-
}, {
|
|
231
|
-
readonly type: "function";
|
|
232
|
-
readonly name: "ONE_HUNDRED_P";
|
|
233
|
-
readonly inputs: readonly [];
|
|
234
|
-
readonly outputs: readonly [{
|
|
235
|
-
readonly name: "";
|
|
236
|
-
readonly type: "uint256";
|
|
237
|
-
readonly internalType: "uint256";
|
|
238
|
-
}];
|
|
239
|
-
readonly stateMutability: "view";
|
|
240
|
-
}, {
|
|
241
|
-
readonly type: "function";
|
|
242
|
-
readonly name: "SWAP_LEVEL";
|
|
243
|
-
readonly inputs: readonly [];
|
|
244
|
-
readonly outputs: readonly [{
|
|
245
|
-
readonly name: "";
|
|
246
|
-
readonly type: "uint32";
|
|
247
|
-
readonly internalType: "uint32";
|
|
248
|
-
}];
|
|
249
|
-
readonly stateMutability: "view";
|
|
250
|
-
}, {
|
|
251
|
-
readonly type: "function";
|
|
252
|
-
readonly name: "VERSION";
|
|
253
|
-
readonly inputs: readonly [];
|
|
254
|
-
readonly outputs: readonly [{
|
|
255
|
-
readonly name: "";
|
|
256
|
-
readonly type: "uint16";
|
|
257
|
-
readonly internalType: "uint16";
|
|
258
|
-
}];
|
|
259
|
-
readonly stateMutability: "view";
|
|
260
|
-
}, {
|
|
261
|
-
readonly type: "function";
|
|
262
|
-
readonly name: "authorized";
|
|
263
|
-
readonly inputs: readonly [{
|
|
264
|
-
readonly name: "user";
|
|
265
|
-
readonly type: "address";
|
|
266
|
-
readonly internalType: "address";
|
|
267
|
-
}];
|
|
268
|
-
readonly outputs: readonly [{
|
|
269
|
-
readonly name: "";
|
|
270
|
-
readonly type: "bool";
|
|
271
|
-
readonly internalType: "bool";
|
|
272
|
-
}];
|
|
273
|
-
readonly stateMutability: "view";
|
|
274
|
-
}, {
|
|
275
|
-
readonly type: "function";
|
|
276
|
-
readonly name: "bpp";
|
|
277
|
-
readonly inputs: readonly [{
|
|
278
|
-
readonly name: "amount";
|
|
279
|
-
readonly type: "uint256";
|
|
280
|
-
readonly internalType: "uint256";
|
|
281
|
-
}];
|
|
282
|
-
readonly outputs: readonly [{
|
|
283
|
-
readonly name: "";
|
|
284
|
-
readonly type: "uint256";
|
|
285
|
-
readonly internalType: "uint256";
|
|
286
|
-
}];
|
|
287
|
-
readonly stateMutability: "view";
|
|
288
|
-
}, {
|
|
289
|
-
readonly type: "function";
|
|
290
|
-
readonly name: "bps";
|
|
291
|
-
readonly inputs: readonly [];
|
|
292
|
-
readonly outputs: readonly [{
|
|
293
|
-
readonly name: "";
|
|
294
|
-
readonly type: "uint256";
|
|
295
|
-
readonly internalType: "uint256";
|
|
296
|
-
}];
|
|
297
|
-
readonly stateMutability: "view";
|
|
298
|
-
}, {
|
|
299
|
-
readonly type: "function";
|
|
300
|
-
readonly name: "cancelOwnershipHandover";
|
|
301
|
-
readonly inputs: readonly [];
|
|
302
|
-
readonly outputs: readonly [];
|
|
303
|
-
readonly stateMutability: "payable";
|
|
304
|
-
}, {
|
|
305
|
-
readonly type: "function";
|
|
306
|
-
readonly name: "completeOwnershipHandover";
|
|
307
|
-
readonly inputs: readonly [{
|
|
308
|
-
readonly name: "pendingOwner";
|
|
309
|
-
readonly type: "address";
|
|
310
|
-
readonly internalType: "address";
|
|
311
|
-
}];
|
|
312
|
-
readonly outputs: readonly [];
|
|
313
|
-
readonly stateMutability: "payable";
|
|
314
|
-
}, {
|
|
315
|
-
readonly type: "function";
|
|
316
|
-
readonly name: "fee";
|
|
317
|
-
readonly inputs: readonly [{
|
|
318
|
-
readonly name: "amount";
|
|
319
|
-
readonly type: "uint256";
|
|
320
|
-
readonly internalType: "uint256";
|
|
321
|
-
}];
|
|
322
|
-
readonly outputs: readonly [{
|
|
323
|
-
readonly name: "";
|
|
324
|
-
readonly type: "uint256";
|
|
325
|
-
readonly internalType: "uint256";
|
|
326
|
-
}, {
|
|
327
|
-
readonly name: "";
|
|
328
|
-
readonly type: "uint256";
|
|
329
|
-
readonly internalType: "uint256";
|
|
330
|
-
}];
|
|
331
|
-
readonly stateMutability: "view";
|
|
332
|
-
}, {
|
|
333
|
-
readonly type: "function";
|
|
334
|
-
readonly name: "id";
|
|
335
|
-
readonly inputs: readonly [];
|
|
336
|
-
readonly outputs: readonly [{
|
|
337
|
-
readonly name: "";
|
|
338
|
-
readonly type: "bytes32";
|
|
339
|
-
readonly internalType: "bytes32";
|
|
340
|
-
}];
|
|
341
|
-
readonly stateMutability: "view";
|
|
342
|
-
}, {
|
|
343
|
-
readonly type: "function";
|
|
344
|
-
readonly name: "inputTokens";
|
|
345
|
-
readonly inputs: readonly [{
|
|
346
|
-
readonly name: "";
|
|
347
|
-
readonly type: "address";
|
|
348
|
-
readonly internalType: "address";
|
|
349
|
-
}];
|
|
350
|
-
readonly outputs: readonly [{
|
|
351
|
-
readonly name: "";
|
|
352
|
-
readonly type: "bool";
|
|
353
|
-
readonly internalType: "bool";
|
|
354
|
-
}];
|
|
355
|
-
readonly stateMutability: "view";
|
|
356
|
-
}, {
|
|
357
|
-
readonly type: "function";
|
|
358
|
-
readonly name: "outputToken";
|
|
359
|
-
readonly inputs: readonly [];
|
|
360
|
-
readonly outputs: readonly [{
|
|
361
|
-
readonly name: "";
|
|
362
|
-
readonly type: "address";
|
|
363
|
-
readonly internalType: "address";
|
|
364
|
-
}];
|
|
365
|
-
readonly stateMutability: "view";
|
|
366
|
-
}, {
|
|
367
|
-
readonly type: "function";
|
|
368
|
-
readonly name: "outputTokenBalance";
|
|
369
|
-
readonly inputs: readonly [];
|
|
370
|
-
readonly outputs: readonly [{
|
|
371
|
-
readonly name: "";
|
|
372
|
-
readonly type: "uint256";
|
|
373
|
-
readonly internalType: "uint256";
|
|
374
|
-
}];
|
|
375
|
-
readonly stateMutability: "view";
|
|
376
|
-
}, {
|
|
377
|
-
readonly type: "function";
|
|
378
|
-
readonly name: "owner";
|
|
379
|
-
readonly inputs: readonly [];
|
|
380
|
-
readonly outputs: readonly [{
|
|
381
|
-
readonly name: "result";
|
|
382
|
-
readonly type: "address";
|
|
383
|
-
readonly internalType: "address";
|
|
384
|
-
}];
|
|
385
|
-
readonly stateMutability: "view";
|
|
386
|
-
}, {
|
|
387
|
-
readonly type: "function";
|
|
388
|
-
readonly name: "ownershipHandoverExpiresAt";
|
|
389
|
-
readonly inputs: readonly [{
|
|
390
|
-
readonly name: "pendingOwner";
|
|
391
|
-
readonly type: "address";
|
|
392
|
-
readonly internalType: "address";
|
|
393
|
-
}];
|
|
394
|
-
readonly outputs: readonly [{
|
|
395
|
-
readonly name: "result";
|
|
396
|
-
readonly type: "uint256";
|
|
397
|
-
readonly internalType: "uint256";
|
|
398
|
-
}];
|
|
399
|
-
readonly stateMutability: "view";
|
|
400
|
-
}, {
|
|
401
|
-
readonly type: "function";
|
|
402
|
-
readonly name: "pause";
|
|
403
|
-
readonly inputs: readonly [{
|
|
404
|
-
readonly name: "level";
|
|
405
|
-
readonly type: "uint32";
|
|
406
|
-
readonly internalType: "uint32";
|
|
407
|
-
}];
|
|
408
|
-
readonly outputs: readonly [{
|
|
409
|
-
readonly name: "";
|
|
410
|
-
readonly type: "bool";
|
|
411
|
-
readonly internalType: "bool";
|
|
412
|
-
}];
|
|
413
|
-
readonly stateMutability: "nonpayable";
|
|
414
|
-
}, {
|
|
415
|
-
readonly type: "function";
|
|
416
|
-
readonly name: "paused";
|
|
417
|
-
readonly inputs: readonly [];
|
|
418
|
-
readonly outputs: readonly [{
|
|
419
|
-
readonly name: "";
|
|
420
|
-
readonly type: "uint32";
|
|
421
|
-
readonly internalType: "uint32";
|
|
422
|
-
}];
|
|
423
|
-
readonly stateMutability: "view";
|
|
424
|
-
}, {
|
|
425
|
-
readonly type: "function";
|
|
426
|
-
readonly name: "preview";
|
|
427
|
-
readonly inputs: readonly [{
|
|
428
|
-
readonly name: "token";
|
|
429
|
-
readonly type: "address";
|
|
430
|
-
readonly internalType: "address";
|
|
431
|
-
}, {
|
|
432
|
-
readonly name: "amount";
|
|
433
|
-
readonly type: "uint256";
|
|
434
|
-
readonly internalType: "uint256";
|
|
435
|
-
}];
|
|
436
|
-
readonly outputs: readonly [{
|
|
437
|
-
readonly name: "";
|
|
438
|
-
readonly type: "tuple";
|
|
439
|
-
readonly internalType: "struct Preview";
|
|
440
|
-
readonly components: readonly [{
|
|
441
|
-
readonly name: "input";
|
|
442
|
-
readonly type: "uint256";
|
|
443
|
-
readonly internalType: "uint256";
|
|
444
|
-
}, {
|
|
445
|
-
readonly name: "fee";
|
|
446
|
-
readonly type: "uint256";
|
|
447
|
-
readonly internalType: "uint256";
|
|
448
|
-
}, {
|
|
449
|
-
readonly name: "output";
|
|
450
|
-
readonly type: "uint256";
|
|
451
|
-
readonly internalType: "uint256";
|
|
452
|
-
}];
|
|
453
|
-
}];
|
|
454
|
-
readonly stateMutability: "view";
|
|
455
|
-
}, {
|
|
456
|
-
readonly type: "function";
|
|
457
|
-
readonly name: "renounceOwnership";
|
|
458
|
-
readonly inputs: readonly [];
|
|
459
|
-
readonly outputs: readonly [];
|
|
460
|
-
readonly stateMutability: "payable";
|
|
461
|
-
}, {
|
|
462
|
-
readonly type: "function";
|
|
463
|
-
readonly name: "requestOwnershipHandover";
|
|
464
|
-
readonly inputs: readonly [];
|
|
465
|
-
readonly outputs: readonly [];
|
|
466
|
-
readonly stateMutability: "payable";
|
|
467
|
-
}, {
|
|
468
|
-
readonly type: "function";
|
|
469
|
-
readonly name: "setBps";
|
|
470
|
-
readonly inputs: readonly [{
|
|
471
|
-
readonly name: "points";
|
|
472
|
-
readonly type: "uint256";
|
|
473
|
-
readonly internalType: "uint256";
|
|
474
|
-
}];
|
|
475
|
-
readonly outputs: readonly [{
|
|
476
|
-
readonly name: "";
|
|
477
|
-
readonly type: "bool";
|
|
478
|
-
readonly internalType: "bool";
|
|
479
|
-
}];
|
|
480
|
-
readonly stateMutability: "nonpayable";
|
|
481
|
-
}, {
|
|
482
|
-
readonly type: "function";
|
|
483
|
-
readonly name: "setInputToken";
|
|
484
|
-
readonly inputs: readonly [{
|
|
485
|
-
readonly name: "token";
|
|
486
|
-
readonly type: "address";
|
|
487
|
-
readonly internalType: "address";
|
|
488
|
-
}, {
|
|
489
|
-
readonly name: "val";
|
|
490
|
-
readonly type: "bool";
|
|
491
|
-
readonly internalType: "bool";
|
|
492
|
-
}];
|
|
493
|
-
readonly outputs: readonly [{
|
|
494
|
-
readonly name: "";
|
|
495
|
-
readonly type: "bool";
|
|
496
|
-
readonly internalType: "bool";
|
|
497
|
-
}];
|
|
498
|
-
readonly stateMutability: "nonpayable";
|
|
499
|
-
}, {
|
|
500
|
-
readonly type: "function";
|
|
501
|
-
readonly name: "status";
|
|
502
|
-
readonly inputs: readonly [];
|
|
503
|
-
readonly outputs: readonly [{
|
|
504
|
-
readonly name: "";
|
|
505
|
-
readonly type: "tuple";
|
|
506
|
-
readonly internalType: "struct Status";
|
|
507
|
-
readonly components: readonly [{
|
|
508
|
-
readonly name: "flags";
|
|
509
|
-
readonly type: "uint32";
|
|
510
|
-
readonly internalType: "uint32";
|
|
511
|
-
}, {
|
|
512
|
-
readonly name: "state";
|
|
513
|
-
readonly type: "uint8";
|
|
514
|
-
readonly internalType: "enum State";
|
|
515
|
-
}];
|
|
516
|
-
}];
|
|
517
|
-
readonly stateMutability: "view";
|
|
518
|
-
}, {
|
|
519
|
-
readonly type: "function";
|
|
520
|
-
readonly name: "stop";
|
|
521
|
-
readonly inputs: readonly [];
|
|
522
|
-
readonly outputs: readonly [{
|
|
523
|
-
readonly name: "";
|
|
524
|
-
readonly type: "bool";
|
|
525
|
-
readonly internalType: "bool";
|
|
526
|
-
}];
|
|
527
|
-
readonly stateMutability: "nonpayable";
|
|
528
|
-
}, {
|
|
529
|
-
readonly type: "function";
|
|
530
|
-
readonly name: "stopped";
|
|
531
|
-
readonly inputs: readonly [];
|
|
532
|
-
readonly outputs: readonly [{
|
|
533
|
-
readonly name: "";
|
|
534
|
-
readonly type: "bool";
|
|
535
|
-
readonly internalType: "bool";
|
|
536
|
-
}];
|
|
537
|
-
readonly stateMutability: "view";
|
|
538
|
-
}, {
|
|
539
|
-
readonly type: "function";
|
|
540
|
-
readonly name: "swap";
|
|
541
|
-
readonly inputs: readonly [{
|
|
542
|
-
readonly name: "token";
|
|
543
|
-
readonly type: "address";
|
|
544
|
-
readonly internalType: "address";
|
|
545
|
-
}, {
|
|
546
|
-
readonly name: "amount";
|
|
547
|
-
readonly type: "uint256";
|
|
548
|
-
readonly internalType: "uint256";
|
|
549
|
-
}, {
|
|
550
|
-
readonly name: "slip";
|
|
551
|
-
readonly type: "uint256";
|
|
552
|
-
readonly internalType: "uint256";
|
|
553
|
-
}];
|
|
554
|
-
readonly outputs: readonly [{
|
|
555
|
-
readonly name: "";
|
|
556
|
-
readonly type: "uint256";
|
|
557
|
-
readonly internalType: "uint256";
|
|
558
|
-
}];
|
|
559
|
-
readonly stateMutability: "nonpayable";
|
|
560
|
-
}, {
|
|
561
|
-
readonly type: "function";
|
|
562
|
-
readonly name: "tokenBalance";
|
|
563
|
-
readonly inputs: readonly [{
|
|
564
|
-
readonly name: "token";
|
|
565
|
-
readonly type: "address";
|
|
566
|
-
readonly internalType: "address";
|
|
567
|
-
}];
|
|
568
|
-
readonly outputs: readonly [{
|
|
569
|
-
readonly name: "";
|
|
570
|
-
readonly type: "uint256";
|
|
571
|
-
readonly internalType: "uint256";
|
|
572
|
-
}];
|
|
573
|
-
readonly stateMutability: "view";
|
|
574
|
-
}, {
|
|
575
|
-
readonly type: "function";
|
|
576
|
-
readonly name: "totals";
|
|
577
|
-
readonly inputs: readonly [{
|
|
578
|
-
readonly name: "user";
|
|
579
|
-
readonly type: "address";
|
|
580
|
-
readonly internalType: "address";
|
|
581
|
-
}, {
|
|
582
|
-
readonly name: "token";
|
|
583
|
-
readonly type: "address";
|
|
584
|
-
readonly internalType: "address";
|
|
585
|
-
}];
|
|
586
|
-
readonly outputs: readonly [{
|
|
587
|
-
readonly name: "";
|
|
588
|
-
readonly type: "tuple";
|
|
589
|
-
readonly internalType: "struct SwapTotal";
|
|
590
|
-
readonly components: readonly [{
|
|
591
|
-
readonly name: "inputSum";
|
|
592
|
-
readonly type: "uint256";
|
|
593
|
-
readonly internalType: "uint256";
|
|
594
|
-
}, {
|
|
595
|
-
readonly name: "feeSum";
|
|
596
|
-
readonly type: "uint256";
|
|
597
|
-
readonly internalType: "uint256";
|
|
598
|
-
}, {
|
|
599
|
-
readonly name: "outputSum";
|
|
600
|
-
readonly type: "uint256";
|
|
601
|
-
readonly internalType: "uint256";
|
|
602
|
-
}, {
|
|
603
|
-
readonly name: "count";
|
|
604
|
-
readonly type: "uint256";
|
|
605
|
-
readonly internalType: "uint256";
|
|
606
|
-
}];
|
|
607
|
-
}];
|
|
608
|
-
readonly stateMutability: "view";
|
|
609
|
-
}, {
|
|
610
|
-
readonly type: "function";
|
|
611
|
-
readonly name: "totals";
|
|
612
|
-
readonly inputs: readonly [{
|
|
613
|
-
readonly name: "token";
|
|
614
|
-
readonly type: "address";
|
|
615
|
-
readonly internalType: "address";
|
|
616
|
-
}];
|
|
617
|
-
readonly outputs: readonly [{
|
|
618
|
-
readonly name: "";
|
|
619
|
-
readonly type: "tuple";
|
|
620
|
-
readonly internalType: "struct SwapTotal";
|
|
621
|
-
readonly components: readonly [{
|
|
622
|
-
readonly name: "inputSum";
|
|
623
|
-
readonly type: "uint256";
|
|
624
|
-
readonly internalType: "uint256";
|
|
625
|
-
}, {
|
|
626
|
-
readonly name: "feeSum";
|
|
627
|
-
readonly type: "uint256";
|
|
628
|
-
readonly internalType: "uint256";
|
|
629
|
-
}, {
|
|
630
|
-
readonly name: "outputSum";
|
|
631
|
-
readonly type: "uint256";
|
|
632
|
-
readonly internalType: "uint256";
|
|
633
|
-
}, {
|
|
634
|
-
readonly name: "count";
|
|
635
|
-
readonly type: "uint256";
|
|
636
|
-
readonly internalType: "uint256";
|
|
637
|
-
}];
|
|
638
|
-
}];
|
|
639
|
-
readonly stateMutability: "view";
|
|
640
|
-
}, {
|
|
641
|
-
readonly type: "function";
|
|
642
|
-
readonly name: "transfer";
|
|
643
|
-
readonly inputs: readonly [{
|
|
644
|
-
readonly name: "to";
|
|
645
|
-
readonly type: "address";
|
|
646
|
-
readonly internalType: "address";
|
|
647
|
-
}, {
|
|
648
|
-
readonly name: "amount";
|
|
649
|
-
readonly type: "uint256";
|
|
650
|
-
readonly internalType: "uint256";
|
|
651
|
-
}];
|
|
652
|
-
readonly outputs: readonly [{
|
|
653
|
-
readonly name: "";
|
|
654
|
-
readonly type: "bool";
|
|
655
|
-
readonly internalType: "bool";
|
|
656
|
-
}];
|
|
657
|
-
readonly stateMutability: "nonpayable";
|
|
658
|
-
}, {
|
|
659
|
-
readonly type: "function";
|
|
660
|
-
readonly name: "transfer";
|
|
661
|
-
readonly inputs: readonly [{
|
|
662
|
-
readonly name: "to";
|
|
663
|
-
readonly type: "address";
|
|
664
|
-
readonly internalType: "address";
|
|
665
|
-
}, {
|
|
666
|
-
readonly name: "token";
|
|
667
|
-
readonly type: "address";
|
|
668
|
-
readonly internalType: "address";
|
|
669
|
-
}, {
|
|
670
|
-
readonly name: "amount";
|
|
671
|
-
readonly type: "uint256";
|
|
672
|
-
readonly internalType: "uint256";
|
|
673
|
-
}];
|
|
674
|
-
readonly outputs: readonly [{
|
|
675
|
-
readonly name: "";
|
|
676
|
-
readonly type: "bool";
|
|
677
|
-
readonly internalType: "bool";
|
|
678
|
-
}];
|
|
679
|
-
readonly stateMutability: "nonpayable";
|
|
680
|
-
}, {
|
|
681
|
-
readonly type: "function";
|
|
682
|
-
readonly name: "transferOwnership";
|
|
683
|
-
readonly inputs: readonly [{
|
|
684
|
-
readonly name: "newOwner";
|
|
685
|
-
readonly type: "address";
|
|
686
|
-
readonly internalType: "address";
|
|
687
|
-
}];
|
|
688
|
-
readonly outputs: readonly [];
|
|
689
|
-
readonly stateMutability: "payable";
|
|
690
|
-
}, {
|
|
691
|
-
readonly type: "event";
|
|
692
|
-
readonly name: "BpsUpdated";
|
|
693
|
-
readonly inputs: readonly [{
|
|
694
|
-
readonly name: "prev";
|
|
695
|
-
readonly type: "uint256";
|
|
696
|
-
readonly indexed: false;
|
|
697
|
-
readonly internalType: "uint256";
|
|
698
|
-
}, {
|
|
699
|
-
readonly name: "next";
|
|
700
|
-
readonly type: "uint256";
|
|
701
|
-
readonly indexed: false;
|
|
702
|
-
readonly internalType: "uint256";
|
|
703
|
-
}];
|
|
704
|
-
readonly anonymous: false;
|
|
705
|
-
}, {
|
|
706
|
-
readonly type: "event";
|
|
707
|
-
readonly name: "InputTokenUpdated";
|
|
708
|
-
readonly inputs: readonly [{
|
|
709
|
-
readonly name: "token";
|
|
710
|
-
readonly type: "address";
|
|
711
|
-
readonly indexed: true;
|
|
712
|
-
readonly internalType: "address";
|
|
713
|
-
}, {
|
|
714
|
-
readonly name: "prev";
|
|
715
|
-
readonly type: "bool";
|
|
716
|
-
readonly indexed: false;
|
|
717
|
-
readonly internalType: "bool";
|
|
718
|
-
}, {
|
|
719
|
-
readonly name: "next";
|
|
720
|
-
readonly type: "bool";
|
|
721
|
-
readonly indexed: false;
|
|
722
|
-
readonly internalType: "bool";
|
|
723
|
-
}];
|
|
724
|
-
readonly anonymous: false;
|
|
725
|
-
}, {
|
|
726
|
-
readonly type: "event";
|
|
727
|
-
readonly name: "OwnershipHandoverCanceled";
|
|
728
|
-
readonly inputs: readonly [{
|
|
729
|
-
readonly name: "pendingOwner";
|
|
730
|
-
readonly type: "address";
|
|
731
|
-
readonly indexed: true;
|
|
732
|
-
readonly internalType: "address";
|
|
733
|
-
}];
|
|
734
|
-
readonly anonymous: false;
|
|
735
|
-
}, {
|
|
736
|
-
readonly type: "event";
|
|
737
|
-
readonly name: "OwnershipHandoverRequested";
|
|
738
|
-
readonly inputs: readonly [{
|
|
739
|
-
readonly name: "pendingOwner";
|
|
740
|
-
readonly type: "address";
|
|
741
|
-
readonly indexed: true;
|
|
742
|
-
readonly internalType: "address";
|
|
743
|
-
}];
|
|
744
|
-
readonly anonymous: false;
|
|
745
|
-
}, {
|
|
746
|
-
readonly type: "event";
|
|
747
|
-
readonly name: "OwnershipTransferred";
|
|
748
|
-
readonly inputs: readonly [{
|
|
749
|
-
readonly name: "oldOwner";
|
|
750
|
-
readonly type: "address";
|
|
751
|
-
readonly indexed: true;
|
|
752
|
-
readonly internalType: "address";
|
|
753
|
-
}, {
|
|
754
|
-
readonly name: "newOwner";
|
|
755
|
-
readonly type: "address";
|
|
756
|
-
readonly indexed: true;
|
|
757
|
-
readonly internalType: "address";
|
|
758
|
-
}];
|
|
759
|
-
readonly anonymous: false;
|
|
760
|
-
}, {
|
|
761
|
-
readonly type: "event";
|
|
762
|
-
readonly name: "Paused";
|
|
763
|
-
readonly inputs: readonly [{
|
|
764
|
-
readonly name: "previous";
|
|
765
|
-
readonly type: "uint32";
|
|
766
|
-
readonly indexed: false;
|
|
767
|
-
readonly internalType: "uint32";
|
|
768
|
-
}, {
|
|
769
|
-
readonly name: "next";
|
|
770
|
-
readonly type: "uint32";
|
|
771
|
-
readonly indexed: false;
|
|
772
|
-
readonly internalType: "uint32";
|
|
773
|
-
}];
|
|
774
|
-
readonly anonymous: false;
|
|
775
|
-
}, {
|
|
776
|
-
readonly type: "event";
|
|
777
|
-
readonly name: "Stopped";
|
|
778
|
-
readonly inputs: readonly [];
|
|
779
|
-
readonly anonymous: false;
|
|
780
|
-
}, {
|
|
781
|
-
readonly type: "event";
|
|
782
|
-
readonly name: "Swapped";
|
|
783
|
-
readonly inputs: readonly [{
|
|
784
|
-
readonly name: "user";
|
|
785
|
-
readonly type: "address";
|
|
786
|
-
readonly indexed: true;
|
|
787
|
-
readonly internalType: "address";
|
|
788
|
-
}, {
|
|
789
|
-
readonly name: "inputToken";
|
|
790
|
-
readonly type: "address";
|
|
791
|
-
readonly indexed: true;
|
|
792
|
-
readonly internalType: "address";
|
|
793
|
-
}, {
|
|
794
|
-
readonly name: "outputToken";
|
|
795
|
-
readonly type: "address";
|
|
796
|
-
readonly indexed: true;
|
|
797
|
-
readonly internalType: "address";
|
|
798
|
-
}, {
|
|
799
|
-
readonly name: "inputAmount";
|
|
800
|
-
readonly type: "uint256";
|
|
801
|
-
readonly indexed: false;
|
|
802
|
-
readonly internalType: "uint256";
|
|
803
|
-
}, {
|
|
804
|
-
readonly name: "fee";
|
|
805
|
-
readonly type: "uint256";
|
|
806
|
-
readonly indexed: false;
|
|
807
|
-
readonly internalType: "uint256";
|
|
808
|
-
}, {
|
|
809
|
-
readonly name: "outputAmount";
|
|
810
|
-
readonly type: "uint256";
|
|
811
|
-
readonly indexed: false;
|
|
812
|
-
readonly internalType: "uint256";
|
|
813
|
-
}];
|
|
814
|
-
readonly anonymous: false;
|
|
815
|
-
}, {
|
|
816
|
-
readonly type: "event";
|
|
817
|
-
readonly name: "Transferred";
|
|
818
|
-
readonly inputs: readonly [{
|
|
819
|
-
readonly name: "to";
|
|
820
|
-
readonly type: "address";
|
|
821
|
-
readonly indexed: true;
|
|
822
|
-
readonly internalType: "address";
|
|
823
|
-
}, {
|
|
824
|
-
readonly name: "token";
|
|
825
|
-
readonly type: "address";
|
|
826
|
-
readonly indexed: true;
|
|
827
|
-
readonly internalType: "address";
|
|
828
|
-
}, {
|
|
829
|
-
readonly name: "amount";
|
|
830
|
-
readonly type: "uint256";
|
|
831
|
-
readonly indexed: false;
|
|
832
|
-
readonly internalType: "uint256";
|
|
833
|
-
}];
|
|
834
|
-
readonly anonymous: false;
|
|
835
|
-
}, {
|
|
836
|
-
readonly type: "error";
|
|
837
|
-
readonly name: "AlreadyInitialized";
|
|
838
|
-
readonly inputs: readonly [];
|
|
839
|
-
}, {
|
|
840
|
-
readonly type: "error";
|
|
841
|
-
readonly name: "InsufficientAmount";
|
|
842
|
-
readonly inputs: readonly [];
|
|
843
|
-
}, {
|
|
844
|
-
readonly type: "error";
|
|
845
|
-
readonly name: "InvalidAddress";
|
|
846
|
-
readonly inputs: readonly [];
|
|
847
|
-
}, {
|
|
848
|
-
readonly type: "error";
|
|
849
|
-
readonly name: "InvalidAmount";
|
|
850
|
-
readonly inputs: readonly [];
|
|
851
|
-
}, {
|
|
852
|
-
readonly type: "error";
|
|
853
|
-
readonly name: "IsPaused";
|
|
854
|
-
readonly inputs: readonly [{
|
|
855
|
-
readonly name: "level";
|
|
856
|
-
readonly type: "uint32";
|
|
857
|
-
readonly internalType: "uint32";
|
|
858
|
-
}];
|
|
859
|
-
}, {
|
|
860
|
-
readonly type: "error";
|
|
861
|
-
readonly name: "IsStopped";
|
|
862
|
-
readonly inputs: readonly [];
|
|
863
|
-
}, {
|
|
864
|
-
readonly type: "error";
|
|
865
|
-
readonly name: "NewOwnerIsZeroAddress";
|
|
866
|
-
readonly inputs: readonly [];
|
|
867
|
-
}, {
|
|
868
|
-
readonly type: "error";
|
|
869
|
-
readonly name: "NoHandoverRequest";
|
|
870
|
-
readonly inputs: readonly [];
|
|
871
|
-
}, {
|
|
872
|
-
readonly type: "error";
|
|
873
|
-
readonly name: "SwapFailed";
|
|
874
|
-
readonly inputs: readonly [{
|
|
875
|
-
readonly name: "user";
|
|
876
|
-
readonly type: "address";
|
|
877
|
-
readonly internalType: "address";
|
|
878
|
-
}, {
|
|
879
|
-
readonly name: "token";
|
|
880
|
-
readonly type: "address";
|
|
881
|
-
readonly internalType: "address";
|
|
882
|
-
}];
|
|
883
|
-
}, {
|
|
884
|
-
readonly type: "error";
|
|
885
|
-
readonly name: "Unauthorized";
|
|
886
|
-
readonly inputs: readonly [];
|
|
887
|
-
}];
|
|
888
|
-
|
|
889
|
-
/**
|
|
890
|
-
* Price of 1 output token in USD, assuming the input token is a $1 stablecoin.
|
|
891
|
-
*
|
|
892
|
-
* `raw_price = inputTokenAmount.raw × 10^outputDecimals ÷ outputTokenAmount.raw`
|
|
893
|
-
*
|
|
894
|
-
* The multiplication happens before the division so we never lose precision to
|
|
895
|
-
* integer truncation early. This mirrors standard fixed-point practice on-chain.
|
|
896
|
-
* Returned decimals match the input token decimals (always the stablecoin's 6).
|
|
897
|
-
*/
|
|
898
|
-
declare function computePrice({ inputTokenAmount, outputTokenAmount, }: SwapQuote): BlockchainAmount | null;
|
|
899
|
-
/**
|
|
900
|
-
* Applies slippage to an amount, returning the minimum acceptable amount:
|
|
901
|
-
* `amount × (BPS_DENOM − slippage) / BPS_DENOM`. Throws when `slippage` exceeds
|
|
902
|
-
* `BPS_DENOM` (the retained fraction would be negative).
|
|
903
|
-
*/
|
|
904
|
-
declare function computeSlip(amount: BlockchainAmount, slippage: Bps): BlockchainAmount;
|
|
905
|
-
|
|
906
|
-
/**
|
|
907
|
-
* The bit `Operable.paused` sets for the swap operation, mirroring the
|
|
908
|
-
* contract's `SWAP_LEVEL` constant.
|
|
909
|
-
*
|
|
910
|
-
* A constant rather than a `SWAP_LEVEL()` read: it is `constant` in the
|
|
911
|
-
* contract, so reading it would spend a round-trip to be told the same number
|
|
912
|
-
* every time.
|
|
913
|
-
*/
|
|
914
|
-
declare const SWAP_LEVEL = 2;
|
|
915
|
-
/**
|
|
916
|
-
* Whether the contract will actually accept a swap right now.
|
|
917
|
-
*
|
|
918
|
-
* Not the same question as "is it active". `paused` is a bitmask over
|
|
919
|
-
* *operations*, so a contract can suspend something unrelated and go on
|
|
920
|
-
* swapping; only the {@link SWAP_LEVEL} bit stops it. Reading `state ===
|
|
921
|
-
* 'active'` instead would refuse swaps the contract is perfectly willing to
|
|
922
|
-
* make.
|
|
923
|
-
*/
|
|
924
|
-
declare function isSwapAvailable(status: SwapStatus): boolean;
|
|
925
|
-
|
|
926
|
-
/**
|
|
927
|
-
* Decodes the confirmed output amount from the `Swapped` event in a swap
|
|
928
|
-
* transaction receipt.
|
|
929
|
-
*
|
|
930
|
-
* Returns `null` when the event is absent or the amount is not a valid uint256
|
|
931
|
-
* so callers can fall back to the quote's expected output — the swap already
|
|
932
|
-
* confirmed on-chain, so a missing/undecodable event should not fail the flow.
|
|
933
|
-
*/
|
|
934
|
-
declare function decodeSwappedOutputAmount(receipt: TransactionReceipt, outputDecimals: AssetDecimals): BlockchainAmount | null;
|
|
935
|
-
|
|
936
|
-
/**
|
|
937
|
-
* Who issues the asset a Superstate swap pays out.
|
|
938
|
-
*
|
|
939
|
-
* A constant rather than a field off the offer: no frontline endpoint carries
|
|
940
|
-
* an issuer, and every offer this checkout serves is Superstate's by
|
|
941
|
-
* definition — `CheckoutContainer` routes here on `superstate::swap` alone.
|
|
942
|
-
*/
|
|
943
|
-
declare const SUPERSTATE_ISSUER_NAME = "Superstate";
|
|
944
|
-
/**
|
|
945
|
-
* The coins a Superstate swap can be funded with, in display order, with the
|
|
946
|
-
* first preselected.
|
|
947
|
-
*
|
|
948
|
-
* USDC alone today: it is what the deployed swap contract accepts. The amount
|
|
949
|
-
* step renders a single entry as a plain card and two or more as a picker, so
|
|
950
|
-
* adding one here is all it takes.
|
|
951
|
-
*/
|
|
952
|
-
declare const SUPERSTATE_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
953
|
-
/** Poll interval for refreshing on-chain swap quotes and balances. */
|
|
954
|
-
declare const SWAP_POLL_INTERVAL_MS = 15000;
|
|
955
|
-
/**
|
|
956
|
-
* Notional input used to derive a display price-per-share when the user has
|
|
957
|
-
* not yet entered an amount (1 USDC at 6 decimals).
|
|
958
|
-
*/
|
|
959
|
-
declare const DEFAULT_AMOUNT_TO_COMPUTE_PRICE = 1000000n;
|
|
960
|
-
/** Slippage tolerances offered in the review step, in basis points. */
|
|
961
|
-
declare const SLIPPAGE_OPTIONS_BPS: Bps[];
|
|
962
|
-
/** Default slippage tolerance (0.5%). */
|
|
963
|
-
declare const DEFAULT_SLIPPAGE_BPS: Bps;
|
|
964
|
-
/**
|
|
965
|
-
* The deployed Superstate swap contract on Ethereum Sepolia, and therefore the
|
|
966
|
-
* ERC-20 spender the user approves there.
|
|
967
|
-
*
|
|
968
|
-
* Exported in its own right for a partner driving `coinlist.superstate.execute`
|
|
969
|
-
* at Level 1, where the contract is an explicit parameter.
|
|
970
|
-
*/
|
|
971
|
-
declare const SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA: EvmContractAddress;
|
|
972
|
-
/**
|
|
973
|
-
* The Superstate swap contract on `chain`, or `null` where none is deployed.
|
|
974
|
-
*
|
|
975
|
-
* TODO(ENG-1734): Ondo now reads its spender off the offer's `swap_contracts`
|
|
976
|
-
* via `swapSpender`, which is why that helper sits in `shared/core/offers/`
|
|
977
|
-
* rather than under a provider. Superstate still resolves from this table, so
|
|
978
|
-
* two mechanisms answer one question. Migrate once frontline serves
|
|
979
|
-
* `swap_contracts` on Superstate offers too.
|
|
980
|
-
*/
|
|
981
|
-
declare function superstateSwapContractAddress(chain: EthereumChain): EvmContractAddress | null;
|
|
982
|
-
|
|
983
|
-
/**
|
|
984
|
-
* Formats a quote's implied price per output token as a USD amount.
|
|
985
|
-
*
|
|
986
|
-
* Lives with the provider rather than in `@/universal/core/shared/blockchain/formatters`
|
|
987
|
-
* because {@link SwapQuote} and {@link computePrice} are Superstate's: the
|
|
988
|
-
* shared formatters stay provider-agnostic.
|
|
989
|
-
*/
|
|
990
|
-
declare function formattedPricePerShare(quote: SwapQuote | null, locale: string): FormattedAmountAssetUi;
|
|
991
|
-
|
|
992
|
-
/**
|
|
993
|
-
* The CoinList contract a swap on `chain` settles through, and therefore the
|
|
994
|
-
* ERC-20 spender the user approves - or `null` where this offer cannot be
|
|
995
|
-
* swapped on that chain.
|
|
996
|
-
*
|
|
997
|
-
* Read off the offer rather than held as a constant because the address varies
|
|
998
|
-
* by environment, not only by chain: beta and production both run
|
|
999
|
-
* `ethereum_sepolia` and deploy a different contract on each, and one constant
|
|
1000
|
-
* cannot name both. Frontline resolves it per environment and serves the
|
|
1001
|
-
* answer on the offer.
|
|
1002
|
-
*
|
|
1003
|
-
* The array varies per *offer* as well as per chain - frontline drops a chain
|
|
1004
|
-
* whose funding and swap tokens do not both resolve for this asset - so an
|
|
1005
|
-
* array read for one symbol must not be reused for another. An empty array
|
|
1006
|
-
* means "cannot swap here", which is an answer rather than an error.
|
|
1007
|
-
*
|
|
1008
|
-
* A capability rather than a provider slice, and named for the data it reads
|
|
1009
|
-
* rather than for its first caller: `swap_contracts` is an offer field, and
|
|
1010
|
-
* `universal-core-isolation-and-sharing` would stop Superstate reusing this if
|
|
1011
|
-
* it lived under `checkout/ondo/`. Superstate has not migrated yet - it still
|
|
1012
|
-
* reads `superstateSwapContractAddress` - so Ondo is the only caller today.
|
|
1013
|
-
*/
|
|
1014
|
-
declare function swapSpender(swapContracts: OfferSwapContract[], chain: EthereumChain): EvmContractAddress | null;
|
|
1015
|
-
|
|
1016
|
-
/** Basis-point denominator: 10_000 bps = 100%. */
|
|
1017
|
-
declare const BPS_DENOM: Bps;
|
|
1018
|
-
/**
|
|
1019
|
-
* Applies a basis-point fraction to an amount, flooring the result.
|
|
1020
|
-
* `floor((amount × bps) / BPS_DENOM)`. The result is bounds-checked, so an
|
|
1021
|
-
* overflow (bps far above BPS_DENOM) or a negative product is rejected.
|
|
1022
|
-
*/
|
|
1023
|
-
declare function applyBps(amount: Uint256, bps: Bps): Uint256;
|
|
1024
|
-
|
|
1025
|
-
/** The viem chain definition the SDK reads and writes this chain through. */
|
|
1026
|
-
declare function viemChain(chain: EthereumChain): Chain;
|
|
1027
|
-
declare function getChainId(chain: EthereumChain): number;
|
|
1028
|
-
/**
|
|
1029
|
-
* Resolves an EIP-155 chain id to the chain the SDK names it by — the inverse
|
|
1030
|
-
* of {@link getChainId}, for backends that report a bare `chain_id`.
|
|
1031
|
-
*
|
|
1032
|
-
* @throws ValidationError on an unrecognised id. Defaulting to mainnet would
|
|
1033
|
-
* let a testnet response read as a live one.
|
|
1034
|
-
*/
|
|
1035
|
-
declare function chainFromId(chainId: string): EthereumChain;
|
|
1036
|
-
declare function getNetworkName(chain: EthereumChain): string;
|
|
1037
|
-
declare function txExplorerUrl(chain: EthereumChain, txHash: Hash): TxExplorerUrl;
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
* Minimal ERC-20 ABI the SDK writes against (mirrors viem's `erc20Abi`). The
|
|
1041
|
-
* swap flow uses `approve`; `allowance`/`balanceOf`/`decimals`/`symbol`/`name`
|
|
1042
|
-
* are included so reads share a single SDK-owned ABI.
|
|
1043
|
-
*/
|
|
1044
|
-
declare const ERC20_ABI: readonly [{
|
|
1045
|
-
readonly type: "function";
|
|
1046
|
-
readonly name: "allowance";
|
|
1047
|
-
readonly inputs: readonly [{
|
|
1048
|
-
readonly name: "owner";
|
|
1049
|
-
readonly type: "address";
|
|
1050
|
-
}, {
|
|
1051
|
-
readonly name: "spender";
|
|
1052
|
-
readonly type: "address";
|
|
1053
|
-
}];
|
|
1054
|
-
readonly outputs: readonly [{
|
|
1055
|
-
readonly name: "";
|
|
1056
|
-
readonly type: "uint256";
|
|
1057
|
-
}];
|
|
1058
|
-
readonly stateMutability: "view";
|
|
1059
|
-
}, {
|
|
1060
|
-
readonly type: "function";
|
|
1061
|
-
readonly name: "approve";
|
|
1062
|
-
readonly inputs: readonly [{
|
|
1063
|
-
readonly name: "spender";
|
|
1064
|
-
readonly type: "address";
|
|
1065
|
-
}, {
|
|
1066
|
-
readonly name: "amount";
|
|
1067
|
-
readonly type: "uint256";
|
|
1068
|
-
}];
|
|
1069
|
-
readonly outputs: readonly [{
|
|
1070
|
-
readonly name: "";
|
|
1071
|
-
readonly type: "bool";
|
|
1072
|
-
}];
|
|
1073
|
-
readonly stateMutability: "nonpayable";
|
|
1074
|
-
}, {
|
|
1075
|
-
readonly type: "function";
|
|
1076
|
-
readonly name: "balanceOf";
|
|
1077
|
-
readonly inputs: readonly [{
|
|
1078
|
-
readonly name: "account";
|
|
1079
|
-
readonly type: "address";
|
|
1080
|
-
}];
|
|
1081
|
-
readonly outputs: readonly [{
|
|
1082
|
-
readonly name: "";
|
|
1083
|
-
readonly type: "uint256";
|
|
1084
|
-
}];
|
|
1085
|
-
readonly stateMutability: "view";
|
|
1086
|
-
}, {
|
|
1087
|
-
readonly type: "function";
|
|
1088
|
-
readonly name: "decimals";
|
|
1089
|
-
readonly inputs: readonly [];
|
|
1090
|
-
readonly outputs: readonly [{
|
|
1091
|
-
readonly name: "";
|
|
1092
|
-
readonly type: "uint8";
|
|
1093
|
-
}];
|
|
1094
|
-
readonly stateMutability: "view";
|
|
1095
|
-
}, {
|
|
1096
|
-
readonly type: "function";
|
|
1097
|
-
readonly name: "name";
|
|
1098
|
-
readonly inputs: readonly [];
|
|
1099
|
-
readonly outputs: readonly [{
|
|
1100
|
-
readonly name: "";
|
|
1101
|
-
readonly type: "string";
|
|
1102
|
-
}];
|
|
1103
|
-
readonly stateMutability: "view";
|
|
1104
|
-
}, {
|
|
1105
|
-
readonly type: "function";
|
|
1106
|
-
readonly name: "symbol";
|
|
1107
|
-
readonly inputs: readonly [];
|
|
1108
|
-
readonly outputs: readonly [{
|
|
1109
|
-
readonly name: "";
|
|
1110
|
-
readonly type: "string";
|
|
1111
|
-
}];
|
|
1112
|
-
readonly stateMutability: "view";
|
|
1113
|
-
}, {
|
|
1114
|
-
readonly type: "function";
|
|
1115
|
-
readonly name: "totalSupply";
|
|
1116
|
-
readonly inputs: readonly [];
|
|
1117
|
-
readonly outputs: readonly [{
|
|
1118
|
-
readonly name: "";
|
|
1119
|
-
readonly type: "uint256";
|
|
1120
|
-
}];
|
|
1121
|
-
readonly stateMutability: "view";
|
|
1122
|
-
}, {
|
|
1123
|
-
readonly type: "function";
|
|
1124
|
-
readonly name: "transfer";
|
|
1125
|
-
readonly inputs: readonly [{
|
|
1126
|
-
readonly name: "recipient";
|
|
1127
|
-
readonly type: "address";
|
|
1128
|
-
}, {
|
|
1129
|
-
readonly name: "amount";
|
|
1130
|
-
readonly type: "uint256";
|
|
1131
|
-
}];
|
|
1132
|
-
readonly outputs: readonly [{
|
|
1133
|
-
readonly name: "";
|
|
1134
|
-
readonly type: "bool";
|
|
1135
|
-
}];
|
|
1136
|
-
readonly stateMutability: "nonpayable";
|
|
1137
|
-
}, {
|
|
1138
|
-
readonly type: "function";
|
|
1139
|
-
readonly name: "transferFrom";
|
|
1140
|
-
readonly inputs: readonly [{
|
|
1141
|
-
readonly name: "sender";
|
|
1142
|
-
readonly type: "address";
|
|
1143
|
-
}, {
|
|
1144
|
-
readonly name: "recipient";
|
|
1145
|
-
readonly type: "address";
|
|
1146
|
-
}, {
|
|
1147
|
-
readonly name: "amount";
|
|
1148
|
-
readonly type: "uint256";
|
|
1149
|
-
}];
|
|
1150
|
-
readonly outputs: readonly [{
|
|
1151
|
-
readonly name: "";
|
|
1152
|
-
readonly type: "bool";
|
|
1153
|
-
}];
|
|
1154
|
-
readonly stateMutability: "nonpayable";
|
|
1155
|
-
}, {
|
|
1156
|
-
readonly type: "event";
|
|
1157
|
-
readonly name: "Approval";
|
|
1158
|
-
readonly inputs: readonly [{
|
|
1159
|
-
readonly name: "owner";
|
|
1160
|
-
readonly type: "address";
|
|
1161
|
-
readonly indexed: true;
|
|
1162
|
-
}, {
|
|
1163
|
-
readonly name: "spender";
|
|
1164
|
-
readonly type: "address";
|
|
1165
|
-
readonly indexed: true;
|
|
1166
|
-
}, {
|
|
1167
|
-
readonly name: "value";
|
|
1168
|
-
readonly type: "uint256";
|
|
1169
|
-
readonly indexed: false;
|
|
1170
|
-
}];
|
|
1171
|
-
readonly anonymous: false;
|
|
1172
|
-
}, {
|
|
1173
|
-
readonly type: "event";
|
|
1174
|
-
readonly name: "Transfer";
|
|
1175
|
-
readonly inputs: readonly [{
|
|
1176
|
-
readonly name: "from";
|
|
1177
|
-
readonly type: "address";
|
|
1178
|
-
readonly indexed: true;
|
|
1179
|
-
}, {
|
|
1180
|
-
readonly name: "to";
|
|
1181
|
-
readonly type: "address";
|
|
1182
|
-
readonly indexed: true;
|
|
1183
|
-
}, {
|
|
1184
|
-
readonly name: "value";
|
|
1185
|
-
readonly type: "uint256";
|
|
1186
|
-
readonly indexed: false;
|
|
1187
|
-
}];
|
|
1188
|
-
readonly anonymous: false;
|
|
1189
|
-
}];
|
|
1190
|
-
|
|
1191
|
-
declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
|
|
1192
|
-
type FormatAmountOptions = {
|
|
1193
|
-
maxFractionDigits?: AssetDecimals;
|
|
1194
|
-
/**
|
|
1195
|
-
* Trailing zeros are kept down to this many places. Defaults to
|
|
1196
|
-
* `maxFractionDigits` when that is set, otherwise 2 (or the token's own
|
|
1197
|
-
* decimals, when fewer). A figure that wants a cap and a shorter floor —
|
|
1198
|
-
* a share headline — passes both.
|
|
1199
|
-
*/
|
|
1200
|
-
minFractionDigits?: AssetDecimals;
|
|
1201
|
-
};
|
|
1202
|
-
declare function formatAmount(amount: BlockchainAmount, locale: string, options?: FormatAmountOptions): FormattedAmountUi;
|
|
1203
|
-
declare function formatRawAmount(amount: BlockchainAmount): string;
|
|
1204
|
-
/**
|
|
1205
|
-
* Formats a {@link BlockchainAmount} using compact notation (e.g. `1.37B`,
|
|
1206
|
-
* `5M`). Compact notation only surfaces a couple of significant decimals, so
|
|
1207
|
-
* the bigint → number narrowing here is intentional and safe: full precision
|
|
1208
|
-
* is deliberately dropped in favour of a human-readable summary value.
|
|
1209
|
-
*/
|
|
1210
|
-
declare function formatCompactAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
|
|
1211
|
-
declare function formatBpsAsPercent(bps: Bps, locale: string): FormattedPercentUi;
|
|
1212
|
-
declare function usdAmount(amount: FormattedAmountUi): FormattedAmountAssetUi;
|
|
1213
|
-
declare function assetAmount(amount: FormattedAmountUi, symbol: AssetSymbol): FormattedAmountAssetUi;
|
|
1214
|
-
/** Placeholder shown when an amount is unavailable (e.g. a loading quote). */
|
|
1215
|
-
declare const NA_AMOUNT_ASSET_UI: FormattedAmountAssetUi;
|
|
1216
|
-
/**
|
|
1217
|
-
* A share quantity for a headline: at most 6 decimal places, at least 2, with
|
|
1218
|
-
* the zeros between those dropped.
|
|
1219
|
-
*
|
|
1220
|
-
* An 18-decimal fill (`0.002689383776381483`) otherwise takes the whole
|
|
1221
|
-
* confirmation row and the fund name collapses to an ellipsis. Places past 6
|
|
1222
|
-
* are dust at share scale. The chain amount is unchanged, and the transaction
|
|
1223
|
-
* link still carries the exact figure.
|
|
1224
|
-
*/
|
|
1225
|
-
declare function formatShareAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
|
|
1226
|
-
/**
|
|
1227
|
-
* Formats a USD amount capped at 2 fractional digits, falling back to the
|
|
1228
|
-
* {@link NA_AMOUNT_ASSET_UI} placeholder when the amount is absent.
|
|
1229
|
-
*/
|
|
1230
|
-
declare function formattedUsdPrice(amount: BlockchainAmount | null, locale: string): FormattedAmountAssetUi;
|
|
1231
|
-
|
|
1232
|
-
/** A typed, i18n-agnostic reason a raw amount string failed to parse. */
|
|
1233
|
-
type AmountParseErrorReason = {
|
|
1234
|
-
type: 'empty';
|
|
1235
|
-
} | {
|
|
1236
|
-
type: 'negative';
|
|
1237
|
-
} | {
|
|
1238
|
-
type: 'invalid-format';
|
|
1239
|
-
} | {
|
|
1240
|
-
type: 'too-many-decimals';
|
|
1241
|
-
maxDecimals: AssetDecimals;
|
|
1242
|
-
}
|
|
1243
|
-
/** Scaled up by `decimals`, the amount no longer fits a uint256. */
|
|
1244
|
-
| {
|
|
1245
|
-
type: 'overflow';
|
|
1246
|
-
};
|
|
1247
|
-
type AmountParseResult = {
|
|
1248
|
-
valid: true;
|
|
1249
|
-
amount: BlockchainAmount;
|
|
1250
|
-
} | {
|
|
1251
|
-
valid: false;
|
|
1252
|
-
reason: AmountParseErrorReason;
|
|
1253
|
-
};
|
|
1254
|
-
/**
|
|
1255
|
-
* Wraps a raw uint256 base-unit string — what Ondo and the on-chain reads
|
|
1256
|
-
* return ("100000000" is 100 USDC, not 100 wei-of-nothing) — in a
|
|
1257
|
-
* {@link BlockchainAmount} at the given decimals. The value is already scaled,
|
|
1258
|
-
* so `decimals` is only the unit tag that travels with it.
|
|
1259
|
-
*
|
|
1260
|
-
* Distinct from {@link parseBlockchainAmount}, which takes a *human decimal*
|
|
1261
|
-
* string and scales it up. Feeding a raw amount to that one silently
|
|
1262
|
-
* multiplies it by 10^decimals — pick by what the backend sends, not by which
|
|
1263
|
-
* one is closer at hand.
|
|
1264
|
-
*
|
|
1265
|
-
* @throws ValidationError when the string is not a non-negative uint256
|
|
1266
|
-
* integer. A backend that regresses to decimal strings fails loudly here
|
|
1267
|
-
* rather than truncating.
|
|
1268
|
-
*/
|
|
1269
|
-
declare function blockchainAmountFromRawOrThrow({ label, raw, decimals, }: {
|
|
1270
|
-
label: string;
|
|
1271
|
-
raw: string;
|
|
1272
|
-
decimals: AssetDecimals;
|
|
1273
|
-
}): BlockchainAmount;
|
|
1274
|
-
/**
|
|
1275
|
-
* Parses a user-entered decimal string into a {@link BlockchainAmount} at the
|
|
1276
|
-
* given token decimals. Rejects scientific notation, negatives, malformed
|
|
1277
|
-
* input, more fractional digits than the token supports, and amounts that
|
|
1278
|
-
* scale past uint256 — surfacing a typed {@link AmountParseErrorReason} so
|
|
1279
|
-
* callers own the display copy.
|
|
1280
|
-
*/
|
|
1281
|
-
declare function parseBlockchainAmount(amount: string, decimals: AssetDecimals): AmountParseResult;
|
|
1282
|
-
|
|
1283
|
-
declare const USDC_SYMBOL: StablecoinSymbol;
|
|
1284
|
-
declare const USDC: Erc20Asset;
|
|
1285
|
-
declare const USDT_SYMBOL: StablecoinSymbol;
|
|
1286
|
-
declare const USDT: Erc20Asset;
|
|
1287
|
-
/** Lookups for the stablecoins the SDK's swap flows support out of the box. */
|
|
1288
|
-
declare const TOKEN_REGISTRY: {
|
|
1289
|
-
erc20: (symbol: KnownAssetSymbol) => Erc20Asset;
|
|
1290
|
-
/**
|
|
1291
|
-
* USDC's contract on `chain`. USDC is deployed on every chain the SDK
|
|
1292
|
-
* models, so the table is total and the answer is never `null`.
|
|
1293
|
-
*/
|
|
1294
|
-
usdcAddress: (chain: EthereumChain) => EvmContractAddress;
|
|
1295
|
-
/**
|
|
1296
|
-
* USDT's contract on `chain`, or `null` where Tether publishes none —
|
|
1297
|
-
* Base Sepolia today. The honest answer, never a fake address a balance
|
|
1298
|
-
* read would call.
|
|
1299
|
-
*/
|
|
1300
|
-
usdtAddress: (chain: EthereumChain) => EvmContractAddress | null;
|
|
1301
|
-
};
|
|
1302
|
-
|
|
1303
|
-
/**
|
|
1304
|
-
* Error thrown when a feature or code path is not yet implemented.
|
|
1305
|
-
*/
|
|
1306
|
-
declare class NotImplementedError extends Error {
|
|
1307
|
-
constructor(message?: string);
|
|
1308
|
-
}
|
|
1309
|
-
/**
|
|
1310
|
-
* Error thrown when accessing a feature that requires authentication
|
|
1311
|
-
* without being authenticated.
|
|
1312
|
-
*/
|
|
1313
|
-
declare class NotAuthenticatedError extends Error {
|
|
1314
|
-
constructor(message?: string);
|
|
1315
|
-
}
|
|
1316
|
-
declare class ValidationError extends Error {
|
|
1317
|
-
constructor(message: string);
|
|
1318
|
-
}
|
|
1319
|
-
/**
|
|
1320
|
-
* Error thrown when the SDK computes something impossible: a value outside
|
|
1321
|
-
* uint256 after its own arithmetic, a symbol missing from a registry the SDK
|
|
1322
|
-
* itself ships. Distinct from {@link ValidationError}, which means the backend
|
|
1323
|
-
* sent a shape the SDK does not understand.
|
|
1324
|
-
*
|
|
1325
|
-
* The two have different remedies, which is the whole reason they are separate
|
|
1326
|
-
* types: a {@link ValidationError} is worth reporting to CoinList, an
|
|
1327
|
-
* `InvariantError` is an SDK bug worth reporting against the SDK.
|
|
1328
|
-
*/
|
|
1329
|
-
declare class InvariantError extends Error {
|
|
1330
|
-
constructor(message: string);
|
|
1331
|
-
}
|
|
1332
|
-
/**
|
|
1333
|
-
* Error thrown when an arithmetic operation has no answer to give: a division
|
|
1334
|
-
* by zero, or a result that falls outside the range its type can represent.
|
|
1335
|
-
*
|
|
1336
|
-
* Distinct from {@link ValidationError}, which says a value arrived malformed.
|
|
1337
|
-
* A `MathError` says every operand was well-formed and the operation on them
|
|
1338
|
-
* still has no result, so the two are worth catching apart: one points at the
|
|
1339
|
-
* response, the other at the arithmetic we asked for.
|
|
1340
|
-
*/
|
|
1341
|
-
declare class MathError extends Error {
|
|
1342
|
-
constructor(message: string);
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
type UserDto = {
|
|
1346
|
-
id: string;
|
|
1347
|
-
email: string;
|
|
1348
|
-
};
|
|
1349
|
-
|
|
1350
|
-
type UserId = Newtype<string, 'UserId'>;
|
|
1351
|
-
declare const UserId: (value: string) => UserId;
|
|
1352
|
-
type UserEmail = Newtype<string, 'UserEmail'>;
|
|
1353
|
-
declare const UserEmail: (value: string) => UserEmail;
|
|
1354
|
-
type User = {
|
|
1355
|
-
id: UserId;
|
|
1356
|
-
email: UserEmail;
|
|
1357
|
-
};
|
|
1358
|
-
declare const User: {
|
|
1359
|
-
fromDto: (dto: UserDto) => User;
|
|
1360
|
-
};
|
|
1361
|
-
|
|
1362
|
-
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, CENTRIFUGE_POLL_INTERVAL_MS, type CentrifugeVault, CentrifugeVaultOfferDetail, type CentrifugeVaultResolution, 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, HttpError, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_NOT_TRADABLE_CODE, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OfferToken, 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, TokenMetadata, 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, isOndoNotTradableError, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, resolveCentrifugeVaults, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
|