@coinlist-co/react 0.12.2-rc.31c2f50 → 0.12.2-rc.3de3751
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-NBO5E2RO.js → chunk-HMLWCXAP.js} +1329 -945
- package/dist/chunk-HMLWCXAP.js.map +1 -0
- package/dist/{chunk-4IZ2F732.js → chunk-L7SVKXXW.js} +10 -10
- package/dist/chunk-L7SVKXXW.js.map +1 -0
- package/dist/chunk-MJ6YXZWH.js +22 -0
- package/dist/chunk-MJ6YXZWH.js.map +1 -0
- package/dist/{chunk-UJYSXXJF.js → chunk-RLOYYAMO.js} +193 -364
- package/dist/chunk-RLOYYAMO.js.map +1 -0
- package/dist/client/index.d.ts +3302 -4561
- package/dist/client/index.js +9396 -7549
- 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-D_XSpiS-.d.ts → time-DkU7jivQ.d.ts} +2179 -2906
- package/dist/{token-registry-snapshot-BsAfBL_b.d.ts → token-registry-snapshot-D0OWXMe4.d.ts} +62 -34
- package/dist/universal/index.d.ts +84 -1337
- package/dist/universal/index.js +39 -47
- package/package.json +18 -14
- package/dist/chunk-4IZ2F732.js.map +0 -1
- package/dist/chunk-NBO5E2RO.js.map +0 -1
- package/dist/chunk-UJYSXXJF.js.map +0 -1
- package/dist/client/index.cjs +0 -17133
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.d.cts +0 -6671
- package/dist/server/index.cjs +0 -4269
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.d.cts +0 -378
- package/dist/time-CFocgYyl.d.cts +0 -50
- package/dist/time-DvgN98Q9.d.ts +0 -50
- package/dist/token-registry-snapshot-Cc_eA5zM.d.cts +0 -181
- package/dist/tokens-namespace-D_XSpiS-.d.cts +0 -3436
- package/dist/universal/index.cjs +0 -4321
- package/dist/universal/index.cjs.map +0 -1
- package/dist/universal/index.d.cts +0 -1629
|
@@ -1,1629 +0,0 @@
|
|
|
1
|
-
import { au as PaginationParams, av as PaginatedResponse, ax as DecimalString, x as StablecoinSymbol, j as OndoBuyTransaction, B as BlockchainAmount, k as OndoSellTransaction, ab as HttpError, p as Bps, ay as SwapStatus, a1 as AssetDecimals, b as EvmContractAddress, a as EthereumChain, i as OfferSwapContract, az as Uint256, h as AssetSymbol, q as EvmWalletAddress, aA as KnownAssetSymbol, y as Erc20Asset, aB as Tx, aC as Newtype } from '../tokens-namespace-D_XSpiS-.cjs';
|
|
2
|
-
export { aD as AllowWalletParams, aE as AllowWalletResponse, aF as Asset, aG as AssetCode, e as AssetId, A as AuthorizationCode, aH as Blockchain, a2 as BuildOndoBuyParams, a3 as BuildOndoSellParams, aI as BuildOndoSwapParamsCore, aJ as CentrifugeVaultOffer, F as CentrifugeVaultOfferDetail, aK as Chain, as as ClientCredentialsOAuth, aL as ClientId, aw as ClientSecret, aM as CodeChallenge, C as CodeVerifier, c as CoinListTokenSaleNamespace, f as CoinListTokenSaleNamespaceImpl, aN as CoinListTokenSaleOffer, I as CoinListTokenSaleOfferDetail, u as Config, aO as ConnectExternalWalletParams, aP as CreateKycTokenParams, aQ as CreateParticipationParams, aR as CreateWalletOwnershipChallengeParams, aS as Cursor, a9 as DebugEvent, aT as DocumentFormType, Z as DocumentSubmission, aU as DocumentSubmissionStatus, aV as DocumentType, aW as ETHEREUM_CHAINS, E as Erc20Namespace, aX as Erc20NamespaceImpl, aY as FaqItem, aa as FrontlineEventId, aZ as GetOndoQuoteParams, a_ as GetOndoTradingStatusParams, a$ as GetSwapAuthorizationParams, b0 as GetSwapPreviewParams, b1 as GetTokenAllowanceParams, b2 as GetTokenBalanceParams, b3 as HexEncodedTransactionData, ac as HttpResponse, b4 as Isin, b5 as Iso2CountryCode, Y as KycLevelName, ad as KycToken, b6 as Link, b7 as ListOptionAddressesParams, ae as LogBinding, af as LogBindings, ag as LogCause, ah as LogLevel, ai as LogScope, aj as LogValue, L as Logger, b8 as MAX_ASSET_DECIMALS, b9 as MAX_UINT_256, ba as Milestone, v as OAuthAccessToken, bb as OAuthRefreshToken, ar as OAuthSession, K as Offer, bc as OfferBase, z as OfferDetail, bd as OfferDetailBase, be as OfferEditorial, O as OfferId, bf as OfferOption, V as OfferOptionAddress, a7 as OfferOptionAddressId, d as OfferOptionId, bg as OfferOptionSlug, bh as OfferSlug, bi as OfferToken, G as OfferType, bj as OfferVaultContract, w as OffersNamespace, bk as OffersNamespaceImpl, g as OndoNamespace, n as OndoNamespaceImpl, a4 as OndoQuote, bl as OndoQuoteDuration, a5 as OndoQuoteSize, bm as OndoSellOutcome, bn as OndoSwapOffer, H as OndoSwapOfferDetail, l as OndoSwapTransactionCore, a0 as OndoTradingStatus, m as OrderBookSide, bo as PKCEState, bp as PaginatedResponseDto, P as Participation, bq as ParticipationId, br as ParticipationStatus, bs as ParticipationsPaginationParams, bt as PauseFlags, bu as Pii, bv as PiiAddress, bw as PiiJurisdiction, bx as PiiKind, $ as PinoLoggerOptions, ak as ProductionLogLevel, by as QueryParamValue, bz as QueryParamValues, al as RedactedWalletError, bA as RedirectUri, bB as RemoveOptionAddressParams, am as RequestId, s as Requirement, bC as RequirementActionNeededReason, X as RequirementId, M as RequirementStatusInfo, Q as RequirementStatusValue, N as RequirementType, R as RequirementsNamespace, t as RequirementsNamespaceImpl, bD as RpcConfig, an as RpcFailureReason, bE as SOLANA_CHAINS, bF as STABLE_DECIMALS, ao as SafeEvent, ap as SafeFields, bG as SolanaChain, bH as SubmitDocumentParams, S as SuperstateSwapNamespace, r as SuperstateSwapNamespaceImpl, bI as SuperstateSwapOffer, J as SuperstateSwapOfferDetail, bJ as SwapContractRef, bK as SwapPreview, bL as TermItem, bM as Ticker, a6 as TokenIdentifier, a8 as TokenLogo, bN as TokenLogoImage, bO as TokenLogoUrl, D as TokenMetadata, bP as TokenRole, T as TokensNamespace, bQ as TokensNamespaceImpl, aq as UnredactedFields, bR as WalletAddress, _ as WalletChallengeType, W as WalletError, bS as WalletOwnershipChallenge, bT as WalletProtocol, o as WalletsNamespace, bU as WalletsNamespaceImpl, bV as apiErrorCode, bW as assertUint256, bX as isChain, bY as isOfferType, bZ as parseUint256 } from '../tokens-namespace-D_XSpiS-.cjs';
|
|
3
|
-
import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl, e as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress } from '../token-registry-snapshot-Cc_eA5zM.cjs';
|
|
4
|
-
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, d as EvmSigner, E as EvmWallet, P as PKCEConfig, f as PKCEParams, c as TokenRegistrySnapshot, W as WriteContractParams, g as generatePKCEParams, o as offerDisplayTokens } from '../token-registry-snapshot-Cc_eA5zM.cjs';
|
|
5
|
-
import { TransactionReceipt, Hash, Chain } from 'viem';
|
|
6
|
-
export { E as EpochMillis, M as Millis, S as Seconds, i as isExpired } from '../time-CFocgYyl.cjs';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Walks every page of a cursor-paginated endpoint and returns the flattened
|
|
10
|
-
* result.
|
|
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.
|
|
34
|
-
*
|
|
35
|
-
* Ondo prices by size, so some amount has to be sent. $1,000 is a plausible
|
|
36
|
-
* order rather than a token one: a size so small that Ondo's minimum rejects
|
|
37
|
-
* it would leave the panel permanently blank.
|
|
38
|
-
*
|
|
39
|
-
* Named distinctly from `DEFAULT_AMOUNT_TO_COMPUTE_PRICE` in the swap
|
|
40
|
-
* constants, which is a raw `bigint` of USDC base units for a different
|
|
41
|
-
* endpoint. Both barrels are flat, so two constants of the same name could not
|
|
42
|
-
* coexist - and they mean different things anyway.
|
|
43
|
-
*/
|
|
44
|
-
declare const DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE: DecimalString;
|
|
45
|
-
/**
|
|
46
|
-
* The coin an Ondo sell settles into, for display only.
|
|
47
|
-
*
|
|
48
|
-
* The scale of every amount on a built transaction comes off the response, so
|
|
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.
|
|
59
|
-
*/
|
|
60
|
-
declare const ONDO_SETTLEMENT_ASSET: StablecoinSymbol;
|
|
61
|
-
/**
|
|
62
|
-
* The order size the sidebar prices a sell against before the user names one.
|
|
63
|
-
*
|
|
64
|
-
* Sells are quoted by token amount rather than by notional: the fee comes out
|
|
65
|
-
* of dollars, and Ondo's price is size-aware, so a buy's quantity depends on
|
|
66
|
-
* the quote being asked for while a sell is sized by what the user already
|
|
67
|
-
* holds. One whole share is a size Ondo will price - small enough to be
|
|
68
|
-
* plausible for any asset, large enough that Ondo's minimum does not reject it
|
|
69
|
-
* and leave the panel permanently blank.
|
|
70
|
-
*
|
|
71
|
-
* The buy counterpart is {@link DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE}, which
|
|
72
|
-
* is a dollar figure for the same reason in reverse.
|
|
73
|
-
*/
|
|
74
|
-
declare const DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE = 1;
|
|
75
|
-
/**
|
|
76
|
-
* The coins an Ondo buy can be funded with, in display order, with the first
|
|
77
|
-
* preselected.
|
|
78
|
-
*
|
|
79
|
-
* USDC alone today: it is what the Sepolia integration contract accepts. The
|
|
80
|
-
* amount step renders a single entry as a plain card and two or more as a
|
|
81
|
-
* picker, so adding one here is all it takes.
|
|
82
|
-
*/
|
|
83
|
-
declare const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* The price of one whole asset token in a built Ondo purchase, in the funding
|
|
87
|
-
* token's units - USD per share.
|
|
88
|
-
*
|
|
89
|
-
* Neither builder publishes a price. Frontline drops Ninshubur's deliberately,
|
|
90
|
-
* because `GET /v1/ondo/swap/quote` already serves one under that name at a
|
|
91
|
-
* different scale, and echoing both would leave a caller to guess which was
|
|
92
|
-
* which.
|
|
93
|
-
*
|
|
94
|
-
* Dividing the two amounts the response *does* carry is better than reading
|
|
95
|
-
* the indicative one anyway: it is the price this transaction fills at, rather
|
|
96
|
-
* than a poll that has since moved and was struck against a different size.
|
|
97
|
-
*
|
|
98
|
-
* **Fee-exclusive.** `notionalValue` is the deposit after CoinList's fee comes
|
|
99
|
-
* off, so this is the price Ondo filled at, not the buyer's all-in cost per
|
|
100
|
-
* token - that would be `spendInputAmount / receiveOutputAmount`, and it is
|
|
101
|
-
* higher. Fee-exclusive is what the review screen wants, because it renders
|
|
102
|
-
* the fee on its own line: price x quantity, plus fee, comes to the total.
|
|
103
|
-
* Making this all-in would double-count the fee against that breakdown.
|
|
104
|
-
*
|
|
105
|
-
* The two are equal until ENG-1718 turns a fee on, which frontline rejects
|
|
106
|
-
* today. They diverge the moment it does, so the choice is load-bearing rather
|
|
107
|
-
* than academic.
|
|
108
|
-
*/
|
|
109
|
-
declare function computeOndoBuyPrice(transaction: OndoBuyTransaction): BlockchainAmount;
|
|
110
|
-
/**
|
|
111
|
-
* The price of one whole asset token in a built Ondo sale, in the settlement
|
|
112
|
-
* token's units - USD per share, the same thing
|
|
113
|
-
* {@link computeOndoBuyPrice} answers with the ratio inverted.
|
|
114
|
-
*
|
|
115
|
-
* **Fee-exclusive, and it takes arithmetic to be so.** `expected.quantity` is
|
|
116
|
-
* published already net of `expected.fee`, so the proceeds are added back
|
|
117
|
-
* before dividing: what comes out is the price Ondo filled at, which is the
|
|
118
|
-
* buy arm's meaning rather than a second one. That is what lets one review row
|
|
119
|
-
* render on either screen, and what keeps the sell breakdown honest - the fee
|
|
120
|
-
* sits on its own line beside this, and a net price would count it twice.
|
|
121
|
-
*
|
|
122
|
-
* Read against {@link OndoSellTransaction.expected} alone. The `minimum` arm
|
|
123
|
-
* describes the same trade at a different outcome, and pricing that one would
|
|
124
|
-
* answer "the worst price this could fill at", which no screen asks for.
|
|
125
|
-
*
|
|
126
|
-
* The two readings coincide while frontline forces the fee to zero, which it
|
|
127
|
-
* does today. They diverge the day ENG-1718 lands.
|
|
128
|
-
*/
|
|
129
|
-
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
|
-
|
|
133
|
-
/**
|
|
134
|
-
* The CoinList API's error code for an Ondo quote refused because the asset
|
|
135
|
-
* cannot be traded right now: the market is closed or paused, or the asset is
|
|
136
|
-
* paused or closed for the session. It arrives on a 409.
|
|
137
|
-
*
|
|
138
|
-
* One code for all four of Ondo's reasons, because the remedy is the same:
|
|
139
|
-
* wait for the market to open. Ondo pauses for a moment at every US session
|
|
140
|
-
* change (04:00 and 16:00 ET), so a poll can land on one even while
|
|
141
|
-
* `getTradingStatus` reported the asset tradable a second earlier.
|
|
142
|
-
*/
|
|
143
|
-
declare const ONDO_NOT_TRADABLE_CODE = "not_tradable";
|
|
144
|
-
/**
|
|
145
|
-
* Whether `error` is the CoinList API refusing an Ondo quote because the
|
|
146
|
-
* market is not open, as opposed to a request that failed.
|
|
147
|
-
*
|
|
148
|
-
* Total: anything that is not an `HttpError` carrying
|
|
149
|
-
* {@link ONDO_NOT_TRADABLE_CODE} is `false`.
|
|
150
|
-
*/
|
|
151
|
-
declare function isOndoNotTradableError(error: unknown): error is HttpError;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* The Superstate swap contract's ABI, generated verbatim from the shared
|
|
155
|
-
* `TokenSwap` base contract:
|
|
156
|
-
*
|
|
157
|
-
* ```
|
|
158
|
-
* cd ../solidity && forge inspect TokenSwap abi --json --use 0.8.34
|
|
159
|
-
* ```
|
|
160
|
-
*
|
|
161
|
-
* Generated rather than hand-trimmed to the four methods the SDK calls, so
|
|
162
|
-
* regenerating after a contract change is one command and a paste. The custom
|
|
163
|
-
* errors carry their weight in particular: viem decodes a revert against them,
|
|
164
|
-
* so a `preview()` on a stopped contract surfaces as `IsStopped` rather than
|
|
165
|
-
* as an opaque `0x`-prefixed blob.
|
|
166
|
-
*
|
|
167
|
-
* `status()` returns `Status { uint32 flags; State state }` where `State` is
|
|
168
|
-
* `0 = Active | 1 = Paused | 2 = Stopped`. It replaced the older
|
|
169
|
-
* `stopped() -> uint256` bitmask, which this contract still exposes but as a
|
|
170
|
-
* `bool`; {@link SwapStatus} reads `status()` and nothing else.
|
|
171
|
-
*/
|
|
172
|
-
declare const SUPERSTATE_SWAP_ABI: readonly [{
|
|
173
|
-
readonly type: "function";
|
|
174
|
-
readonly name: "KIND";
|
|
175
|
-
readonly inputs: readonly [];
|
|
176
|
-
readonly outputs: readonly [{
|
|
177
|
-
readonly name: "";
|
|
178
|
-
readonly type: "uint16";
|
|
179
|
-
readonly internalType: "uint16";
|
|
180
|
-
}];
|
|
181
|
-
readonly stateMutability: "view";
|
|
182
|
-
}, {
|
|
183
|
-
readonly type: "function";
|
|
184
|
-
readonly name: "ONE_HUNDRED_P";
|
|
185
|
-
readonly inputs: readonly [];
|
|
186
|
-
readonly outputs: readonly [{
|
|
187
|
-
readonly name: "";
|
|
188
|
-
readonly type: "uint256";
|
|
189
|
-
readonly internalType: "uint256";
|
|
190
|
-
}];
|
|
191
|
-
readonly stateMutability: "view";
|
|
192
|
-
}, {
|
|
193
|
-
readonly type: "function";
|
|
194
|
-
readonly name: "SWAP_LEVEL";
|
|
195
|
-
readonly inputs: readonly [];
|
|
196
|
-
readonly outputs: readonly [{
|
|
197
|
-
readonly name: "";
|
|
198
|
-
readonly type: "uint32";
|
|
199
|
-
readonly internalType: "uint32";
|
|
200
|
-
}];
|
|
201
|
-
readonly stateMutability: "view";
|
|
202
|
-
}, {
|
|
203
|
-
readonly type: "function";
|
|
204
|
-
readonly name: "VERSION";
|
|
205
|
-
readonly inputs: readonly [];
|
|
206
|
-
readonly outputs: readonly [{
|
|
207
|
-
readonly name: "";
|
|
208
|
-
readonly type: "uint16";
|
|
209
|
-
readonly internalType: "uint16";
|
|
210
|
-
}];
|
|
211
|
-
readonly stateMutability: "view";
|
|
212
|
-
}, {
|
|
213
|
-
readonly type: "function";
|
|
214
|
-
readonly name: "authorized";
|
|
215
|
-
readonly inputs: readonly [{
|
|
216
|
-
readonly name: "user";
|
|
217
|
-
readonly type: "address";
|
|
218
|
-
readonly internalType: "address";
|
|
219
|
-
}];
|
|
220
|
-
readonly outputs: readonly [{
|
|
221
|
-
readonly name: "";
|
|
222
|
-
readonly type: "bool";
|
|
223
|
-
readonly internalType: "bool";
|
|
224
|
-
}];
|
|
225
|
-
readonly stateMutability: "view";
|
|
226
|
-
}, {
|
|
227
|
-
readonly type: "function";
|
|
228
|
-
readonly name: "bpp";
|
|
229
|
-
readonly inputs: readonly [{
|
|
230
|
-
readonly name: "amount";
|
|
231
|
-
readonly type: "uint256";
|
|
232
|
-
readonly internalType: "uint256";
|
|
233
|
-
}];
|
|
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: "bps";
|
|
243
|
-
readonly inputs: readonly [];
|
|
244
|
-
readonly outputs: readonly [{
|
|
245
|
-
readonly name: "";
|
|
246
|
-
readonly type: "uint256";
|
|
247
|
-
readonly internalType: "uint256";
|
|
248
|
-
}];
|
|
249
|
-
readonly stateMutability: "view";
|
|
250
|
-
}, {
|
|
251
|
-
readonly type: "function";
|
|
252
|
-
readonly name: "cancelOwnershipHandover";
|
|
253
|
-
readonly inputs: readonly [];
|
|
254
|
-
readonly outputs: readonly [];
|
|
255
|
-
readonly stateMutability: "payable";
|
|
256
|
-
}, {
|
|
257
|
-
readonly type: "function";
|
|
258
|
-
readonly name: "completeOwnershipHandover";
|
|
259
|
-
readonly inputs: readonly [{
|
|
260
|
-
readonly name: "pendingOwner";
|
|
261
|
-
readonly type: "address";
|
|
262
|
-
readonly internalType: "address";
|
|
263
|
-
}];
|
|
264
|
-
readonly outputs: readonly [];
|
|
265
|
-
readonly stateMutability: "payable";
|
|
266
|
-
}, {
|
|
267
|
-
readonly type: "function";
|
|
268
|
-
readonly name: "fee";
|
|
269
|
-
readonly inputs: readonly [{
|
|
270
|
-
readonly name: "amount";
|
|
271
|
-
readonly type: "uint256";
|
|
272
|
-
readonly internalType: "uint256";
|
|
273
|
-
}];
|
|
274
|
-
readonly outputs: readonly [{
|
|
275
|
-
readonly name: "";
|
|
276
|
-
readonly type: "uint256";
|
|
277
|
-
readonly internalType: "uint256";
|
|
278
|
-
}, {
|
|
279
|
-
readonly name: "";
|
|
280
|
-
readonly type: "uint256";
|
|
281
|
-
readonly internalType: "uint256";
|
|
282
|
-
}];
|
|
283
|
-
readonly stateMutability: "view";
|
|
284
|
-
}, {
|
|
285
|
-
readonly type: "function";
|
|
286
|
-
readonly name: "id";
|
|
287
|
-
readonly inputs: readonly [];
|
|
288
|
-
readonly outputs: readonly [{
|
|
289
|
-
readonly name: "";
|
|
290
|
-
readonly type: "bytes32";
|
|
291
|
-
readonly internalType: "bytes32";
|
|
292
|
-
}];
|
|
293
|
-
readonly stateMutability: "view";
|
|
294
|
-
}, {
|
|
295
|
-
readonly type: "function";
|
|
296
|
-
readonly name: "inputTokens";
|
|
297
|
-
readonly inputs: readonly [{
|
|
298
|
-
readonly name: "";
|
|
299
|
-
readonly type: "address";
|
|
300
|
-
readonly internalType: "address";
|
|
301
|
-
}];
|
|
302
|
-
readonly outputs: readonly [{
|
|
303
|
-
readonly name: "";
|
|
304
|
-
readonly type: "bool";
|
|
305
|
-
readonly internalType: "bool";
|
|
306
|
-
}];
|
|
307
|
-
readonly stateMutability: "view";
|
|
308
|
-
}, {
|
|
309
|
-
readonly type: "function";
|
|
310
|
-
readonly name: "outputToken";
|
|
311
|
-
readonly inputs: readonly [];
|
|
312
|
-
readonly outputs: readonly [{
|
|
313
|
-
readonly name: "";
|
|
314
|
-
readonly type: "address";
|
|
315
|
-
readonly internalType: "address";
|
|
316
|
-
}];
|
|
317
|
-
readonly stateMutability: "view";
|
|
318
|
-
}, {
|
|
319
|
-
readonly type: "function";
|
|
320
|
-
readonly name: "outputTokenBalance";
|
|
321
|
-
readonly inputs: readonly [];
|
|
322
|
-
readonly outputs: readonly [{
|
|
323
|
-
readonly name: "";
|
|
324
|
-
readonly type: "uint256";
|
|
325
|
-
readonly internalType: "uint256";
|
|
326
|
-
}];
|
|
327
|
-
readonly stateMutability: "view";
|
|
328
|
-
}, {
|
|
329
|
-
readonly type: "function";
|
|
330
|
-
readonly name: "owner";
|
|
331
|
-
readonly inputs: readonly [];
|
|
332
|
-
readonly outputs: readonly [{
|
|
333
|
-
readonly name: "result";
|
|
334
|
-
readonly type: "address";
|
|
335
|
-
readonly internalType: "address";
|
|
336
|
-
}];
|
|
337
|
-
readonly stateMutability: "view";
|
|
338
|
-
}, {
|
|
339
|
-
readonly type: "function";
|
|
340
|
-
readonly name: "ownershipHandoverExpiresAt";
|
|
341
|
-
readonly inputs: readonly [{
|
|
342
|
-
readonly name: "pendingOwner";
|
|
343
|
-
readonly type: "address";
|
|
344
|
-
readonly internalType: "address";
|
|
345
|
-
}];
|
|
346
|
-
readonly outputs: readonly [{
|
|
347
|
-
readonly name: "result";
|
|
348
|
-
readonly type: "uint256";
|
|
349
|
-
readonly internalType: "uint256";
|
|
350
|
-
}];
|
|
351
|
-
readonly stateMutability: "view";
|
|
352
|
-
}, {
|
|
353
|
-
readonly type: "function";
|
|
354
|
-
readonly name: "pause";
|
|
355
|
-
readonly inputs: readonly [{
|
|
356
|
-
readonly name: "level";
|
|
357
|
-
readonly type: "uint32";
|
|
358
|
-
readonly internalType: "uint32";
|
|
359
|
-
}];
|
|
360
|
-
readonly outputs: readonly [{
|
|
361
|
-
readonly name: "";
|
|
362
|
-
readonly type: "bool";
|
|
363
|
-
readonly internalType: "bool";
|
|
364
|
-
}];
|
|
365
|
-
readonly stateMutability: "nonpayable";
|
|
366
|
-
}, {
|
|
367
|
-
readonly type: "function";
|
|
368
|
-
readonly name: "paused";
|
|
369
|
-
readonly inputs: readonly [];
|
|
370
|
-
readonly outputs: readonly [{
|
|
371
|
-
readonly name: "";
|
|
372
|
-
readonly type: "uint32";
|
|
373
|
-
readonly internalType: "uint32";
|
|
374
|
-
}];
|
|
375
|
-
readonly stateMutability: "view";
|
|
376
|
-
}, {
|
|
377
|
-
readonly type: "function";
|
|
378
|
-
readonly name: "preview";
|
|
379
|
-
readonly inputs: readonly [{
|
|
380
|
-
readonly name: "token";
|
|
381
|
-
readonly type: "address";
|
|
382
|
-
readonly internalType: "address";
|
|
383
|
-
}, {
|
|
384
|
-
readonly name: "amount";
|
|
385
|
-
readonly type: "uint256";
|
|
386
|
-
readonly internalType: "uint256";
|
|
387
|
-
}];
|
|
388
|
-
readonly outputs: readonly [{
|
|
389
|
-
readonly name: "";
|
|
390
|
-
readonly type: "tuple";
|
|
391
|
-
readonly internalType: "struct Preview";
|
|
392
|
-
readonly components: readonly [{
|
|
393
|
-
readonly name: "input";
|
|
394
|
-
readonly type: "uint256";
|
|
395
|
-
readonly internalType: "uint256";
|
|
396
|
-
}, {
|
|
397
|
-
readonly name: "fee";
|
|
398
|
-
readonly type: "uint256";
|
|
399
|
-
readonly internalType: "uint256";
|
|
400
|
-
}, {
|
|
401
|
-
readonly name: "output";
|
|
402
|
-
readonly type: "uint256";
|
|
403
|
-
readonly internalType: "uint256";
|
|
404
|
-
}];
|
|
405
|
-
}];
|
|
406
|
-
readonly stateMutability: "view";
|
|
407
|
-
}, {
|
|
408
|
-
readonly type: "function";
|
|
409
|
-
readonly name: "renounceOwnership";
|
|
410
|
-
readonly inputs: readonly [];
|
|
411
|
-
readonly outputs: readonly [];
|
|
412
|
-
readonly stateMutability: "payable";
|
|
413
|
-
}, {
|
|
414
|
-
readonly type: "function";
|
|
415
|
-
readonly name: "requestOwnershipHandover";
|
|
416
|
-
readonly inputs: readonly [];
|
|
417
|
-
readonly outputs: readonly [];
|
|
418
|
-
readonly stateMutability: "payable";
|
|
419
|
-
}, {
|
|
420
|
-
readonly type: "function";
|
|
421
|
-
readonly name: "setBps";
|
|
422
|
-
readonly inputs: readonly [{
|
|
423
|
-
readonly name: "points";
|
|
424
|
-
readonly type: "uint256";
|
|
425
|
-
readonly internalType: "uint256";
|
|
426
|
-
}];
|
|
427
|
-
readonly outputs: readonly [{
|
|
428
|
-
readonly name: "";
|
|
429
|
-
readonly type: "bool";
|
|
430
|
-
readonly internalType: "bool";
|
|
431
|
-
}];
|
|
432
|
-
readonly stateMutability: "nonpayable";
|
|
433
|
-
}, {
|
|
434
|
-
readonly type: "function";
|
|
435
|
-
readonly name: "setInputToken";
|
|
436
|
-
readonly inputs: readonly [{
|
|
437
|
-
readonly name: "token";
|
|
438
|
-
readonly type: "address";
|
|
439
|
-
readonly internalType: "address";
|
|
440
|
-
}, {
|
|
441
|
-
readonly name: "val";
|
|
442
|
-
readonly type: "bool";
|
|
443
|
-
readonly internalType: "bool";
|
|
444
|
-
}];
|
|
445
|
-
readonly outputs: readonly [{
|
|
446
|
-
readonly name: "";
|
|
447
|
-
readonly type: "bool";
|
|
448
|
-
readonly internalType: "bool";
|
|
449
|
-
}];
|
|
450
|
-
readonly stateMutability: "nonpayable";
|
|
451
|
-
}, {
|
|
452
|
-
readonly type: "function";
|
|
453
|
-
readonly name: "status";
|
|
454
|
-
readonly inputs: readonly [];
|
|
455
|
-
readonly outputs: readonly [{
|
|
456
|
-
readonly name: "";
|
|
457
|
-
readonly type: "tuple";
|
|
458
|
-
readonly internalType: "struct Status";
|
|
459
|
-
readonly components: readonly [{
|
|
460
|
-
readonly name: "flags";
|
|
461
|
-
readonly type: "uint32";
|
|
462
|
-
readonly internalType: "uint32";
|
|
463
|
-
}, {
|
|
464
|
-
readonly name: "state";
|
|
465
|
-
readonly type: "uint8";
|
|
466
|
-
readonly internalType: "enum State";
|
|
467
|
-
}];
|
|
468
|
-
}];
|
|
469
|
-
readonly stateMutability: "view";
|
|
470
|
-
}, {
|
|
471
|
-
readonly type: "function";
|
|
472
|
-
readonly name: "stop";
|
|
473
|
-
readonly inputs: readonly [];
|
|
474
|
-
readonly outputs: readonly [{
|
|
475
|
-
readonly name: "";
|
|
476
|
-
readonly type: "bool";
|
|
477
|
-
readonly internalType: "bool";
|
|
478
|
-
}];
|
|
479
|
-
readonly stateMutability: "nonpayable";
|
|
480
|
-
}, {
|
|
481
|
-
readonly type: "function";
|
|
482
|
-
readonly name: "stopped";
|
|
483
|
-
readonly inputs: readonly [];
|
|
484
|
-
readonly outputs: readonly [{
|
|
485
|
-
readonly name: "";
|
|
486
|
-
readonly type: "bool";
|
|
487
|
-
readonly internalType: "bool";
|
|
488
|
-
}];
|
|
489
|
-
readonly stateMutability: "view";
|
|
490
|
-
}, {
|
|
491
|
-
readonly type: "function";
|
|
492
|
-
readonly name: "swap";
|
|
493
|
-
readonly inputs: readonly [{
|
|
494
|
-
readonly name: "token";
|
|
495
|
-
readonly type: "address";
|
|
496
|
-
readonly internalType: "address";
|
|
497
|
-
}, {
|
|
498
|
-
readonly name: "amount";
|
|
499
|
-
readonly type: "uint256";
|
|
500
|
-
readonly internalType: "uint256";
|
|
501
|
-
}, {
|
|
502
|
-
readonly name: "slip";
|
|
503
|
-
readonly type: "uint256";
|
|
504
|
-
readonly internalType: "uint256";
|
|
505
|
-
}];
|
|
506
|
-
readonly outputs: readonly [{
|
|
507
|
-
readonly name: "";
|
|
508
|
-
readonly type: "uint256";
|
|
509
|
-
readonly internalType: "uint256";
|
|
510
|
-
}];
|
|
511
|
-
readonly stateMutability: "nonpayable";
|
|
512
|
-
}, {
|
|
513
|
-
readonly type: "function";
|
|
514
|
-
readonly name: "tokenBalance";
|
|
515
|
-
readonly inputs: readonly [{
|
|
516
|
-
readonly name: "token";
|
|
517
|
-
readonly type: "address";
|
|
518
|
-
readonly internalType: "address";
|
|
519
|
-
}];
|
|
520
|
-
readonly outputs: readonly [{
|
|
521
|
-
readonly name: "";
|
|
522
|
-
readonly type: "uint256";
|
|
523
|
-
readonly internalType: "uint256";
|
|
524
|
-
}];
|
|
525
|
-
readonly stateMutability: "view";
|
|
526
|
-
}, {
|
|
527
|
-
readonly type: "function";
|
|
528
|
-
readonly name: "totals";
|
|
529
|
-
readonly inputs: readonly [{
|
|
530
|
-
readonly name: "user";
|
|
531
|
-
readonly type: "address";
|
|
532
|
-
readonly internalType: "address";
|
|
533
|
-
}, {
|
|
534
|
-
readonly name: "token";
|
|
535
|
-
readonly type: "address";
|
|
536
|
-
readonly internalType: "address";
|
|
537
|
-
}];
|
|
538
|
-
readonly outputs: readonly [{
|
|
539
|
-
readonly name: "";
|
|
540
|
-
readonly type: "tuple";
|
|
541
|
-
readonly internalType: "struct SwapTotal";
|
|
542
|
-
readonly components: readonly [{
|
|
543
|
-
readonly name: "inputSum";
|
|
544
|
-
readonly type: "uint256";
|
|
545
|
-
readonly internalType: "uint256";
|
|
546
|
-
}, {
|
|
547
|
-
readonly name: "feeSum";
|
|
548
|
-
readonly type: "uint256";
|
|
549
|
-
readonly internalType: "uint256";
|
|
550
|
-
}, {
|
|
551
|
-
readonly name: "outputSum";
|
|
552
|
-
readonly type: "uint256";
|
|
553
|
-
readonly internalType: "uint256";
|
|
554
|
-
}, {
|
|
555
|
-
readonly name: "count";
|
|
556
|
-
readonly type: "uint256";
|
|
557
|
-
readonly internalType: "uint256";
|
|
558
|
-
}];
|
|
559
|
-
}];
|
|
560
|
-
readonly stateMutability: "view";
|
|
561
|
-
}, {
|
|
562
|
-
readonly type: "function";
|
|
563
|
-
readonly name: "totals";
|
|
564
|
-
readonly inputs: readonly [{
|
|
565
|
-
readonly name: "token";
|
|
566
|
-
readonly type: "address";
|
|
567
|
-
readonly internalType: "address";
|
|
568
|
-
}];
|
|
569
|
-
readonly outputs: readonly [{
|
|
570
|
-
readonly name: "";
|
|
571
|
-
readonly type: "tuple";
|
|
572
|
-
readonly internalType: "struct SwapTotal";
|
|
573
|
-
readonly components: readonly [{
|
|
574
|
-
readonly name: "inputSum";
|
|
575
|
-
readonly type: "uint256";
|
|
576
|
-
readonly internalType: "uint256";
|
|
577
|
-
}, {
|
|
578
|
-
readonly name: "feeSum";
|
|
579
|
-
readonly type: "uint256";
|
|
580
|
-
readonly internalType: "uint256";
|
|
581
|
-
}, {
|
|
582
|
-
readonly name: "outputSum";
|
|
583
|
-
readonly type: "uint256";
|
|
584
|
-
readonly internalType: "uint256";
|
|
585
|
-
}, {
|
|
586
|
-
readonly name: "count";
|
|
587
|
-
readonly type: "uint256";
|
|
588
|
-
readonly internalType: "uint256";
|
|
589
|
-
}];
|
|
590
|
-
}];
|
|
591
|
-
readonly stateMutability: "view";
|
|
592
|
-
}, {
|
|
593
|
-
readonly type: "function";
|
|
594
|
-
readonly name: "transfer";
|
|
595
|
-
readonly inputs: readonly [{
|
|
596
|
-
readonly name: "to";
|
|
597
|
-
readonly type: "address";
|
|
598
|
-
readonly internalType: "address";
|
|
599
|
-
}, {
|
|
600
|
-
readonly name: "amount";
|
|
601
|
-
readonly type: "uint256";
|
|
602
|
-
readonly internalType: "uint256";
|
|
603
|
-
}];
|
|
604
|
-
readonly outputs: readonly [{
|
|
605
|
-
readonly name: "";
|
|
606
|
-
readonly type: "bool";
|
|
607
|
-
readonly internalType: "bool";
|
|
608
|
-
}];
|
|
609
|
-
readonly stateMutability: "nonpayable";
|
|
610
|
-
}, {
|
|
611
|
-
readonly type: "function";
|
|
612
|
-
readonly name: "transfer";
|
|
613
|
-
readonly inputs: readonly [{
|
|
614
|
-
readonly name: "to";
|
|
615
|
-
readonly type: "address";
|
|
616
|
-
readonly internalType: "address";
|
|
617
|
-
}, {
|
|
618
|
-
readonly name: "token";
|
|
619
|
-
readonly type: "address";
|
|
620
|
-
readonly internalType: "address";
|
|
621
|
-
}, {
|
|
622
|
-
readonly name: "amount";
|
|
623
|
-
readonly type: "uint256";
|
|
624
|
-
readonly internalType: "uint256";
|
|
625
|
-
}];
|
|
626
|
-
readonly outputs: readonly [{
|
|
627
|
-
readonly name: "";
|
|
628
|
-
readonly type: "bool";
|
|
629
|
-
readonly internalType: "bool";
|
|
630
|
-
}];
|
|
631
|
-
readonly stateMutability: "nonpayable";
|
|
632
|
-
}, {
|
|
633
|
-
readonly type: "function";
|
|
634
|
-
readonly name: "transferOwnership";
|
|
635
|
-
readonly inputs: readonly [{
|
|
636
|
-
readonly name: "newOwner";
|
|
637
|
-
readonly type: "address";
|
|
638
|
-
readonly internalType: "address";
|
|
639
|
-
}];
|
|
640
|
-
readonly outputs: readonly [];
|
|
641
|
-
readonly stateMutability: "payable";
|
|
642
|
-
}, {
|
|
643
|
-
readonly type: "event";
|
|
644
|
-
readonly name: "BpsUpdated";
|
|
645
|
-
readonly inputs: readonly [{
|
|
646
|
-
readonly name: "prev";
|
|
647
|
-
readonly type: "uint256";
|
|
648
|
-
readonly indexed: false;
|
|
649
|
-
readonly internalType: "uint256";
|
|
650
|
-
}, {
|
|
651
|
-
readonly name: "next";
|
|
652
|
-
readonly type: "uint256";
|
|
653
|
-
readonly indexed: false;
|
|
654
|
-
readonly internalType: "uint256";
|
|
655
|
-
}];
|
|
656
|
-
readonly anonymous: false;
|
|
657
|
-
}, {
|
|
658
|
-
readonly type: "event";
|
|
659
|
-
readonly name: "InputTokenUpdated";
|
|
660
|
-
readonly inputs: readonly [{
|
|
661
|
-
readonly name: "token";
|
|
662
|
-
readonly type: "address";
|
|
663
|
-
readonly indexed: true;
|
|
664
|
-
readonly internalType: "address";
|
|
665
|
-
}, {
|
|
666
|
-
readonly name: "prev";
|
|
667
|
-
readonly type: "bool";
|
|
668
|
-
readonly indexed: false;
|
|
669
|
-
readonly internalType: "bool";
|
|
670
|
-
}, {
|
|
671
|
-
readonly name: "next";
|
|
672
|
-
readonly type: "bool";
|
|
673
|
-
readonly indexed: false;
|
|
674
|
-
readonly internalType: "bool";
|
|
675
|
-
}];
|
|
676
|
-
readonly anonymous: false;
|
|
677
|
-
}, {
|
|
678
|
-
readonly type: "event";
|
|
679
|
-
readonly name: "OwnershipHandoverCanceled";
|
|
680
|
-
readonly inputs: readonly [{
|
|
681
|
-
readonly name: "pendingOwner";
|
|
682
|
-
readonly type: "address";
|
|
683
|
-
readonly indexed: true;
|
|
684
|
-
readonly internalType: "address";
|
|
685
|
-
}];
|
|
686
|
-
readonly anonymous: false;
|
|
687
|
-
}, {
|
|
688
|
-
readonly type: "event";
|
|
689
|
-
readonly name: "OwnershipHandoverRequested";
|
|
690
|
-
readonly inputs: readonly [{
|
|
691
|
-
readonly name: "pendingOwner";
|
|
692
|
-
readonly type: "address";
|
|
693
|
-
readonly indexed: true;
|
|
694
|
-
readonly internalType: "address";
|
|
695
|
-
}];
|
|
696
|
-
readonly anonymous: false;
|
|
697
|
-
}, {
|
|
698
|
-
readonly type: "event";
|
|
699
|
-
readonly name: "OwnershipTransferred";
|
|
700
|
-
readonly inputs: readonly [{
|
|
701
|
-
readonly name: "oldOwner";
|
|
702
|
-
readonly type: "address";
|
|
703
|
-
readonly indexed: true;
|
|
704
|
-
readonly internalType: "address";
|
|
705
|
-
}, {
|
|
706
|
-
readonly name: "newOwner";
|
|
707
|
-
readonly type: "address";
|
|
708
|
-
readonly indexed: true;
|
|
709
|
-
readonly internalType: "address";
|
|
710
|
-
}];
|
|
711
|
-
readonly anonymous: false;
|
|
712
|
-
}, {
|
|
713
|
-
readonly type: "event";
|
|
714
|
-
readonly name: "Paused";
|
|
715
|
-
readonly inputs: readonly [{
|
|
716
|
-
readonly name: "previous";
|
|
717
|
-
readonly type: "uint32";
|
|
718
|
-
readonly indexed: false;
|
|
719
|
-
readonly internalType: "uint32";
|
|
720
|
-
}, {
|
|
721
|
-
readonly name: "next";
|
|
722
|
-
readonly type: "uint32";
|
|
723
|
-
readonly indexed: false;
|
|
724
|
-
readonly internalType: "uint32";
|
|
725
|
-
}];
|
|
726
|
-
readonly anonymous: false;
|
|
727
|
-
}, {
|
|
728
|
-
readonly type: "event";
|
|
729
|
-
readonly name: "Stopped";
|
|
730
|
-
readonly inputs: readonly [];
|
|
731
|
-
readonly anonymous: false;
|
|
732
|
-
}, {
|
|
733
|
-
readonly type: "event";
|
|
734
|
-
readonly name: "Swapped";
|
|
735
|
-
readonly inputs: readonly [{
|
|
736
|
-
readonly name: "user";
|
|
737
|
-
readonly type: "address";
|
|
738
|
-
readonly indexed: true;
|
|
739
|
-
readonly internalType: "address";
|
|
740
|
-
}, {
|
|
741
|
-
readonly name: "inputToken";
|
|
742
|
-
readonly type: "address";
|
|
743
|
-
readonly indexed: true;
|
|
744
|
-
readonly internalType: "address";
|
|
745
|
-
}, {
|
|
746
|
-
readonly name: "outputToken";
|
|
747
|
-
readonly type: "address";
|
|
748
|
-
readonly indexed: true;
|
|
749
|
-
readonly internalType: "address";
|
|
750
|
-
}, {
|
|
751
|
-
readonly name: "inputAmount";
|
|
752
|
-
readonly type: "uint256";
|
|
753
|
-
readonly indexed: false;
|
|
754
|
-
readonly internalType: "uint256";
|
|
755
|
-
}, {
|
|
756
|
-
readonly name: "fee";
|
|
757
|
-
readonly type: "uint256";
|
|
758
|
-
readonly indexed: false;
|
|
759
|
-
readonly internalType: "uint256";
|
|
760
|
-
}, {
|
|
761
|
-
readonly name: "outputAmount";
|
|
762
|
-
readonly type: "uint256";
|
|
763
|
-
readonly indexed: false;
|
|
764
|
-
readonly internalType: "uint256";
|
|
765
|
-
}];
|
|
766
|
-
readonly anonymous: false;
|
|
767
|
-
}, {
|
|
768
|
-
readonly type: "event";
|
|
769
|
-
readonly name: "Transferred";
|
|
770
|
-
readonly inputs: readonly [{
|
|
771
|
-
readonly name: "to";
|
|
772
|
-
readonly type: "address";
|
|
773
|
-
readonly indexed: true;
|
|
774
|
-
readonly internalType: "address";
|
|
775
|
-
}, {
|
|
776
|
-
readonly name: "token";
|
|
777
|
-
readonly type: "address";
|
|
778
|
-
readonly indexed: true;
|
|
779
|
-
readonly internalType: "address";
|
|
780
|
-
}, {
|
|
781
|
-
readonly name: "amount";
|
|
782
|
-
readonly type: "uint256";
|
|
783
|
-
readonly indexed: false;
|
|
784
|
-
readonly internalType: "uint256";
|
|
785
|
-
}];
|
|
786
|
-
readonly anonymous: false;
|
|
787
|
-
}, {
|
|
788
|
-
readonly type: "error";
|
|
789
|
-
readonly name: "AlreadyInitialized";
|
|
790
|
-
readonly inputs: readonly [];
|
|
791
|
-
}, {
|
|
792
|
-
readonly type: "error";
|
|
793
|
-
readonly name: "InsufficientAmount";
|
|
794
|
-
readonly inputs: readonly [];
|
|
795
|
-
}, {
|
|
796
|
-
readonly type: "error";
|
|
797
|
-
readonly name: "InvalidAddress";
|
|
798
|
-
readonly inputs: readonly [];
|
|
799
|
-
}, {
|
|
800
|
-
readonly type: "error";
|
|
801
|
-
readonly name: "InvalidAmount";
|
|
802
|
-
readonly inputs: readonly [];
|
|
803
|
-
}, {
|
|
804
|
-
readonly type: "error";
|
|
805
|
-
readonly name: "IsPaused";
|
|
806
|
-
readonly inputs: readonly [{
|
|
807
|
-
readonly name: "level";
|
|
808
|
-
readonly type: "uint32";
|
|
809
|
-
readonly internalType: "uint32";
|
|
810
|
-
}];
|
|
811
|
-
}, {
|
|
812
|
-
readonly type: "error";
|
|
813
|
-
readonly name: "IsStopped";
|
|
814
|
-
readonly inputs: readonly [];
|
|
815
|
-
}, {
|
|
816
|
-
readonly type: "error";
|
|
817
|
-
readonly name: "NewOwnerIsZeroAddress";
|
|
818
|
-
readonly inputs: readonly [];
|
|
819
|
-
}, {
|
|
820
|
-
readonly type: "error";
|
|
821
|
-
readonly name: "NoHandoverRequest";
|
|
822
|
-
readonly inputs: readonly [];
|
|
823
|
-
}, {
|
|
824
|
-
readonly type: "error";
|
|
825
|
-
readonly name: "SwapFailed";
|
|
826
|
-
readonly inputs: readonly [{
|
|
827
|
-
readonly name: "user";
|
|
828
|
-
readonly type: "address";
|
|
829
|
-
readonly internalType: "address";
|
|
830
|
-
}, {
|
|
831
|
-
readonly name: "token";
|
|
832
|
-
readonly type: "address";
|
|
833
|
-
readonly internalType: "address";
|
|
834
|
-
}];
|
|
835
|
-
}, {
|
|
836
|
-
readonly type: "error";
|
|
837
|
-
readonly name: "Unauthorized";
|
|
838
|
-
readonly inputs: readonly [];
|
|
839
|
-
}];
|
|
840
|
-
|
|
841
|
-
/**
|
|
842
|
-
* Price of 1 output token in USD, assuming the input token is a $1 stablecoin.
|
|
843
|
-
*
|
|
844
|
-
* `raw_price = inputTokenAmount.raw × 10^outputDecimals ÷ outputTokenAmount.raw`
|
|
845
|
-
*
|
|
846
|
-
* The multiplication happens before the division so we never lose precision to
|
|
847
|
-
* integer truncation early. This mirrors standard fixed-point practice on-chain.
|
|
848
|
-
* Returned decimals match the input token decimals (always the stablecoin's 6).
|
|
849
|
-
*/
|
|
850
|
-
declare function computePrice({ inputTokenAmount, outputTokenAmount, }: SwapQuote): BlockchainAmount | null;
|
|
851
|
-
/**
|
|
852
|
-
* Applies slippage to an amount, returning the minimum acceptable amount:
|
|
853
|
-
* `amount × (BPS_DENOM − slippage) / BPS_DENOM`. Throws when `slippage` exceeds
|
|
854
|
-
* `BPS_DENOM` (the retained fraction would be negative).
|
|
855
|
-
*/
|
|
856
|
-
declare function computeSlip(amount: BlockchainAmount, slippage: Bps): BlockchainAmount;
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* The bit `Operable.paused` sets for the swap operation, mirroring the
|
|
860
|
-
* contract's `SWAP_LEVEL` constant.
|
|
861
|
-
*
|
|
862
|
-
* A constant rather than a `SWAP_LEVEL()` read: it is `constant` in the
|
|
863
|
-
* contract, so reading it would spend a round-trip to be told the same number
|
|
864
|
-
* every time.
|
|
865
|
-
*/
|
|
866
|
-
declare const SWAP_LEVEL = 2;
|
|
867
|
-
/**
|
|
868
|
-
* Whether the contract will actually accept a swap right now.
|
|
869
|
-
*
|
|
870
|
-
* Not the same question as "is it active". `paused` is a bitmask over
|
|
871
|
-
* *operations*, so a contract can suspend something unrelated and go on
|
|
872
|
-
* swapping; only the {@link SWAP_LEVEL} bit stops it. Reading `state ===
|
|
873
|
-
* 'active'` instead would refuse swaps the contract is perfectly willing to
|
|
874
|
-
* make.
|
|
875
|
-
*/
|
|
876
|
-
declare function isSwapAvailable(status: SwapStatus): boolean;
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* Decodes the confirmed output amount from the `Swapped` event in a swap
|
|
880
|
-
* transaction receipt.
|
|
881
|
-
*
|
|
882
|
-
* Returns `null` when the event is absent or the amount is not a valid uint256
|
|
883
|
-
* so callers can fall back to the quote's expected output — the swap already
|
|
884
|
-
* confirmed on-chain, so a missing/undecodable event should not fail the flow.
|
|
885
|
-
*/
|
|
886
|
-
declare function decodeSwappedOutputAmount(receipt: TransactionReceipt, outputDecimals: AssetDecimals): BlockchainAmount | null;
|
|
887
|
-
|
|
888
|
-
/**
|
|
889
|
-
* Who issues the asset a Superstate swap pays out.
|
|
890
|
-
*
|
|
891
|
-
* A constant rather than a field off the offer: no frontline endpoint carries
|
|
892
|
-
* an issuer, and every offer this checkout serves is Superstate's by
|
|
893
|
-
* definition — `CheckoutContainer` routes here on `superstate::swap` alone.
|
|
894
|
-
*/
|
|
895
|
-
declare const SUPERSTATE_ISSUER_NAME = "Superstate";
|
|
896
|
-
/**
|
|
897
|
-
* The coins a Superstate swap can be funded with, in display order, with the
|
|
898
|
-
* first preselected.
|
|
899
|
-
*
|
|
900
|
-
* USDC alone today: it is what the deployed swap contract accepts. The amount
|
|
901
|
-
* step renders a single entry as a plain card and two or more as a picker, so
|
|
902
|
-
* adding one here is all it takes.
|
|
903
|
-
*/
|
|
904
|
-
declare const SUPERSTATE_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
905
|
-
/** Poll interval for refreshing on-chain swap quotes and balances. */
|
|
906
|
-
declare const SWAP_POLL_INTERVAL_MS = 15000;
|
|
907
|
-
/**
|
|
908
|
-
* Notional input used to derive a display price-per-share when the user has
|
|
909
|
-
* not yet entered an amount (1 USDC at 6 decimals).
|
|
910
|
-
*/
|
|
911
|
-
declare const DEFAULT_AMOUNT_TO_COMPUTE_PRICE = 1000000n;
|
|
912
|
-
/** Slippage tolerances offered in the review step, in basis points. */
|
|
913
|
-
declare const SLIPPAGE_OPTIONS_BPS: Bps[];
|
|
914
|
-
/** Default slippage tolerance (0.5%). */
|
|
915
|
-
declare const DEFAULT_SLIPPAGE_BPS: Bps;
|
|
916
|
-
/**
|
|
917
|
-
* The deployed Superstate swap contract on Ethereum Sepolia, and therefore the
|
|
918
|
-
* ERC-20 spender the user approves there.
|
|
919
|
-
*
|
|
920
|
-
* Exported in its own right for a partner driving `coinlist.superstate.execute`
|
|
921
|
-
* at Level 1, where the contract is an explicit parameter.
|
|
922
|
-
*/
|
|
923
|
-
declare const SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA: EvmContractAddress;
|
|
924
|
-
/**
|
|
925
|
-
* The Superstate swap contract on `chain`, or `null` where none is deployed.
|
|
926
|
-
*
|
|
927
|
-
* TODO(ENG-1734): Ondo now reads its spender off the offer's `swap_contracts`
|
|
928
|
-
* via `swapSpender`, which is why that helper sits in `shared/core/offers/`
|
|
929
|
-
* rather than under a provider. Superstate still resolves from this table, so
|
|
930
|
-
* two mechanisms answer one question. Migrate once frontline serves
|
|
931
|
-
* `swap_contracts` on Superstate offers too.
|
|
932
|
-
*/
|
|
933
|
-
declare function superstateSwapContractAddress(chain: EthereumChain): EvmContractAddress | null;
|
|
934
|
-
|
|
935
|
-
/**
|
|
936
|
-
* Formats a quote's implied price per output token as a USD amount.
|
|
937
|
-
*
|
|
938
|
-
* Lives with the provider rather than in `@/universal/core/shared/blockchain/formatters`
|
|
939
|
-
* because {@link SwapQuote} and {@link computePrice} are Superstate's: the
|
|
940
|
-
* shared formatters stay provider-agnostic.
|
|
941
|
-
*/
|
|
942
|
-
declare function formattedPricePerShare(quote: SwapQuote | null, locale: string): FormattedAmountAssetUi;
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* The CoinList contract a swap on `chain` settles through, and therefore the
|
|
946
|
-
* ERC-20 spender the user approves - or `null` where this offer cannot be
|
|
947
|
-
* swapped on that chain.
|
|
948
|
-
*
|
|
949
|
-
* Read off the offer rather than held as a constant because the address varies
|
|
950
|
-
* by environment, not only by chain: beta and production both run
|
|
951
|
-
* `ethereum_sepolia` and deploy a different contract on each, and one constant
|
|
952
|
-
* cannot name both. Frontline resolves it per environment and serves the
|
|
953
|
-
* answer on the offer.
|
|
954
|
-
*
|
|
955
|
-
* The array varies per *offer* as well as per chain - frontline drops a chain
|
|
956
|
-
* whose funding and swap tokens do not both resolve for this asset - so an
|
|
957
|
-
* array read for one symbol must not be reused for another. An empty array
|
|
958
|
-
* means "cannot swap here", which is an answer rather than an error.
|
|
959
|
-
*
|
|
960
|
-
* A capability rather than a provider slice, and named for the data it reads
|
|
961
|
-
* rather than for its first caller: `swap_contracts` is an offer field, and
|
|
962
|
-
* `universal-core-isolation-and-sharing` would stop Superstate reusing this if
|
|
963
|
-
* it lived under `checkout/ondo/`. Superstate has not migrated yet - it still
|
|
964
|
-
* reads `superstateSwapContractAddress` - so Ondo is the only caller today.
|
|
965
|
-
*/
|
|
966
|
-
declare function swapSpender(swapContracts: OfferSwapContract[], chain: EthereumChain): EvmContractAddress | null;
|
|
967
|
-
|
|
968
|
-
/** Basis-point denominator: 10_000 bps = 100%. */
|
|
969
|
-
declare const BPS_DENOM: Bps;
|
|
970
|
-
/**
|
|
971
|
-
* Applies a basis-point fraction to an amount, flooring the result.
|
|
972
|
-
* `floor((amount × bps) / BPS_DENOM)`. The result is bounds-checked, so an
|
|
973
|
-
* overflow (bps far above BPS_DENOM) or a negative product is rejected.
|
|
974
|
-
*/
|
|
975
|
-
declare function applyBps(amount: Uint256, bps: Bps): Uint256;
|
|
976
|
-
|
|
977
|
-
/** The viem chain definition the SDK reads and writes this chain through. */
|
|
978
|
-
declare function viemChain(chain: EthereumChain): Chain;
|
|
979
|
-
declare function getChainId(chain: EthereumChain): number;
|
|
980
|
-
/**
|
|
981
|
-
* Resolves an EIP-155 chain id to the chain the SDK names it by — the inverse
|
|
982
|
-
* of {@link getChainId}, for backends that report a bare `chain_id`.
|
|
983
|
-
*
|
|
984
|
-
* @throws ValidationError on an unrecognised id. Defaulting to mainnet would
|
|
985
|
-
* let a testnet response read as a live one.
|
|
986
|
-
*/
|
|
987
|
-
declare function chainFromId(chainId: string): EthereumChain;
|
|
988
|
-
declare function getNetworkName(chain: EthereumChain): string;
|
|
989
|
-
declare function txExplorerUrl(chain: EthereumChain, txHash: Hash): TxExplorerUrl;
|
|
990
|
-
|
|
991
|
-
/**
|
|
992
|
-
* Minimal ERC-20 ABI the SDK writes against (mirrors viem's `erc20Abi`). The
|
|
993
|
-
* swap flow uses `approve`; `allowance`/`balanceOf`/`decimals`/`symbol`/`name`
|
|
994
|
-
* are included so reads share a single SDK-owned ABI.
|
|
995
|
-
*/
|
|
996
|
-
declare const ERC20_ABI: readonly [{
|
|
997
|
-
readonly type: "function";
|
|
998
|
-
readonly name: "allowance";
|
|
999
|
-
readonly inputs: readonly [{
|
|
1000
|
-
readonly name: "owner";
|
|
1001
|
-
readonly type: "address";
|
|
1002
|
-
}, {
|
|
1003
|
-
readonly name: "spender";
|
|
1004
|
-
readonly type: "address";
|
|
1005
|
-
}];
|
|
1006
|
-
readonly outputs: readonly [{
|
|
1007
|
-
readonly name: "";
|
|
1008
|
-
readonly type: "uint256";
|
|
1009
|
-
}];
|
|
1010
|
-
readonly stateMutability: "view";
|
|
1011
|
-
}, {
|
|
1012
|
-
readonly type: "function";
|
|
1013
|
-
readonly name: "approve";
|
|
1014
|
-
readonly inputs: readonly [{
|
|
1015
|
-
readonly name: "spender";
|
|
1016
|
-
readonly type: "address";
|
|
1017
|
-
}, {
|
|
1018
|
-
readonly name: "amount";
|
|
1019
|
-
readonly type: "uint256";
|
|
1020
|
-
}];
|
|
1021
|
-
readonly outputs: readonly [{
|
|
1022
|
-
readonly name: "";
|
|
1023
|
-
readonly type: "bool";
|
|
1024
|
-
}];
|
|
1025
|
-
readonly stateMutability: "nonpayable";
|
|
1026
|
-
}, {
|
|
1027
|
-
readonly type: "function";
|
|
1028
|
-
readonly name: "balanceOf";
|
|
1029
|
-
readonly inputs: readonly [{
|
|
1030
|
-
readonly name: "account";
|
|
1031
|
-
readonly type: "address";
|
|
1032
|
-
}];
|
|
1033
|
-
readonly outputs: readonly [{
|
|
1034
|
-
readonly name: "";
|
|
1035
|
-
readonly type: "uint256";
|
|
1036
|
-
}];
|
|
1037
|
-
readonly stateMutability: "view";
|
|
1038
|
-
}, {
|
|
1039
|
-
readonly type: "function";
|
|
1040
|
-
readonly name: "decimals";
|
|
1041
|
-
readonly inputs: readonly [];
|
|
1042
|
-
readonly outputs: readonly [{
|
|
1043
|
-
readonly name: "";
|
|
1044
|
-
readonly type: "uint8";
|
|
1045
|
-
}];
|
|
1046
|
-
readonly stateMutability: "view";
|
|
1047
|
-
}, {
|
|
1048
|
-
readonly type: "function";
|
|
1049
|
-
readonly name: "name";
|
|
1050
|
-
readonly inputs: readonly [];
|
|
1051
|
-
readonly outputs: readonly [{
|
|
1052
|
-
readonly name: "";
|
|
1053
|
-
readonly type: "string";
|
|
1054
|
-
}];
|
|
1055
|
-
readonly stateMutability: "view";
|
|
1056
|
-
}, {
|
|
1057
|
-
readonly type: "function";
|
|
1058
|
-
readonly name: "symbol";
|
|
1059
|
-
readonly inputs: readonly [];
|
|
1060
|
-
readonly outputs: readonly [{
|
|
1061
|
-
readonly name: "";
|
|
1062
|
-
readonly type: "string";
|
|
1063
|
-
}];
|
|
1064
|
-
readonly stateMutability: "view";
|
|
1065
|
-
}, {
|
|
1066
|
-
readonly type: "function";
|
|
1067
|
-
readonly name: "totalSupply";
|
|
1068
|
-
readonly inputs: readonly [];
|
|
1069
|
-
readonly outputs: readonly [{
|
|
1070
|
-
readonly name: "";
|
|
1071
|
-
readonly type: "uint256";
|
|
1072
|
-
}];
|
|
1073
|
-
readonly stateMutability: "view";
|
|
1074
|
-
}, {
|
|
1075
|
-
readonly type: "function";
|
|
1076
|
-
readonly name: "transfer";
|
|
1077
|
-
readonly inputs: readonly [{
|
|
1078
|
-
readonly name: "recipient";
|
|
1079
|
-
readonly type: "address";
|
|
1080
|
-
}, {
|
|
1081
|
-
readonly name: "amount";
|
|
1082
|
-
readonly type: "uint256";
|
|
1083
|
-
}];
|
|
1084
|
-
readonly outputs: readonly [{
|
|
1085
|
-
readonly name: "";
|
|
1086
|
-
readonly type: "bool";
|
|
1087
|
-
}];
|
|
1088
|
-
readonly stateMutability: "nonpayable";
|
|
1089
|
-
}, {
|
|
1090
|
-
readonly type: "function";
|
|
1091
|
-
readonly name: "transferFrom";
|
|
1092
|
-
readonly inputs: readonly [{
|
|
1093
|
-
readonly name: "sender";
|
|
1094
|
-
readonly type: "address";
|
|
1095
|
-
}, {
|
|
1096
|
-
readonly name: "recipient";
|
|
1097
|
-
readonly type: "address";
|
|
1098
|
-
}, {
|
|
1099
|
-
readonly name: "amount";
|
|
1100
|
-
readonly type: "uint256";
|
|
1101
|
-
}];
|
|
1102
|
-
readonly outputs: readonly [{
|
|
1103
|
-
readonly name: "";
|
|
1104
|
-
readonly type: "bool";
|
|
1105
|
-
}];
|
|
1106
|
-
readonly stateMutability: "nonpayable";
|
|
1107
|
-
}, {
|
|
1108
|
-
readonly type: "event";
|
|
1109
|
-
readonly name: "Approval";
|
|
1110
|
-
readonly inputs: readonly [{
|
|
1111
|
-
readonly name: "owner";
|
|
1112
|
-
readonly type: "address";
|
|
1113
|
-
readonly indexed: true;
|
|
1114
|
-
}, {
|
|
1115
|
-
readonly name: "spender";
|
|
1116
|
-
readonly type: "address";
|
|
1117
|
-
readonly indexed: true;
|
|
1118
|
-
}, {
|
|
1119
|
-
readonly name: "value";
|
|
1120
|
-
readonly type: "uint256";
|
|
1121
|
-
readonly indexed: false;
|
|
1122
|
-
}];
|
|
1123
|
-
readonly anonymous: false;
|
|
1124
|
-
}, {
|
|
1125
|
-
readonly type: "event";
|
|
1126
|
-
readonly name: "Transfer";
|
|
1127
|
-
readonly inputs: readonly [{
|
|
1128
|
-
readonly name: "from";
|
|
1129
|
-
readonly type: "address";
|
|
1130
|
-
readonly indexed: true;
|
|
1131
|
-
}, {
|
|
1132
|
-
readonly name: "to";
|
|
1133
|
-
readonly type: "address";
|
|
1134
|
-
readonly indexed: true;
|
|
1135
|
-
}, {
|
|
1136
|
-
readonly name: "value";
|
|
1137
|
-
readonly type: "uint256";
|
|
1138
|
-
readonly indexed: false;
|
|
1139
|
-
}];
|
|
1140
|
-
readonly anonymous: false;
|
|
1141
|
-
}];
|
|
1142
|
-
|
|
1143
|
-
declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
|
|
1144
|
-
type FormatAmountOptions = {
|
|
1145
|
-
maxFractionDigits?: AssetDecimals;
|
|
1146
|
-
/**
|
|
1147
|
-
* Trailing zeros are kept down to this many places. Defaults to
|
|
1148
|
-
* `maxFractionDigits` when that is set, otherwise 2 (or the token's own
|
|
1149
|
-
* decimals, when fewer). A figure that wants a cap and a shorter floor —
|
|
1150
|
-
* a share headline — passes both.
|
|
1151
|
-
*/
|
|
1152
|
-
minFractionDigits?: AssetDecimals;
|
|
1153
|
-
};
|
|
1154
|
-
declare function formatAmount(amount: BlockchainAmount, locale: string, options?: FormatAmountOptions): FormattedAmountUi;
|
|
1155
|
-
declare function formatRawAmount(amount: BlockchainAmount): string;
|
|
1156
|
-
/**
|
|
1157
|
-
* Formats a {@link BlockchainAmount} using compact notation (e.g. `1.37B`,
|
|
1158
|
-
* `5M`). Compact notation only surfaces a couple of significant decimals, so
|
|
1159
|
-
* the bigint → number narrowing here is intentional and safe: full precision
|
|
1160
|
-
* is deliberately dropped in favour of a human-readable summary value.
|
|
1161
|
-
*/
|
|
1162
|
-
declare function formatCompactAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
|
|
1163
|
-
declare function formatBpsAsPercent(bps: Bps, locale: string): FormattedPercentUi;
|
|
1164
|
-
declare function usdAmount(amount: FormattedAmountUi): FormattedAmountAssetUi;
|
|
1165
|
-
declare function assetAmount(amount: FormattedAmountUi, symbol: AssetSymbol): FormattedAmountAssetUi;
|
|
1166
|
-
/** Placeholder shown when an amount is unavailable (e.g. a loading quote). */
|
|
1167
|
-
declare const NA_AMOUNT_ASSET_UI: FormattedAmountAssetUi;
|
|
1168
|
-
/**
|
|
1169
|
-
* A share quantity for a headline: at most 6 decimal places, at least 2, with
|
|
1170
|
-
* the zeros between those dropped.
|
|
1171
|
-
*
|
|
1172
|
-
* An 18-decimal fill (`0.002689383776381483`) otherwise takes the whole
|
|
1173
|
-
* confirmation row and the fund name collapses to an ellipsis. Places past 6
|
|
1174
|
-
* are dust at share scale. The chain amount is unchanged, and the transaction
|
|
1175
|
-
* link still carries the exact figure.
|
|
1176
|
-
*/
|
|
1177
|
-
declare function formatShareAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
|
|
1178
|
-
/**
|
|
1179
|
-
* Formats a USD amount capped at 2 fractional digits, falling back to the
|
|
1180
|
-
* {@link NA_AMOUNT_ASSET_UI} placeholder when the amount is absent.
|
|
1181
|
-
*/
|
|
1182
|
-
declare function formattedUsdPrice(amount: BlockchainAmount | null, locale: string): FormattedAmountAssetUi;
|
|
1183
|
-
|
|
1184
|
-
/** A typed, i18n-agnostic reason a raw amount string failed to parse. */
|
|
1185
|
-
type AmountParseErrorReason = {
|
|
1186
|
-
type: 'empty';
|
|
1187
|
-
} | {
|
|
1188
|
-
type: 'negative';
|
|
1189
|
-
} | {
|
|
1190
|
-
type: 'invalid-format';
|
|
1191
|
-
} | {
|
|
1192
|
-
type: 'too-many-decimals';
|
|
1193
|
-
maxDecimals: AssetDecimals;
|
|
1194
|
-
}
|
|
1195
|
-
/** Scaled up by `decimals`, the amount no longer fits a uint256. */
|
|
1196
|
-
| {
|
|
1197
|
-
type: 'overflow';
|
|
1198
|
-
};
|
|
1199
|
-
type AmountParseResult = {
|
|
1200
|
-
valid: true;
|
|
1201
|
-
amount: BlockchainAmount;
|
|
1202
|
-
} | {
|
|
1203
|
-
valid: false;
|
|
1204
|
-
reason: AmountParseErrorReason;
|
|
1205
|
-
};
|
|
1206
|
-
/**
|
|
1207
|
-
* Wraps a raw uint256 base-unit string — what Ondo and the on-chain reads
|
|
1208
|
-
* return ("100000000" is 100 USDC, not 100 wei-of-nothing) — in a
|
|
1209
|
-
* {@link BlockchainAmount} at the given decimals. The value is already scaled,
|
|
1210
|
-
* so `decimals` is only the unit tag that travels with it.
|
|
1211
|
-
*
|
|
1212
|
-
* Distinct from {@link parseBlockchainAmount}, which takes a *human decimal*
|
|
1213
|
-
* string and scales it up. Feeding a raw amount to that one silently
|
|
1214
|
-
* multiplies it by 10^decimals — pick by what the backend sends, not by which
|
|
1215
|
-
* one is closer at hand.
|
|
1216
|
-
*
|
|
1217
|
-
* @throws ValidationError when the string is not a non-negative uint256
|
|
1218
|
-
* integer. A backend that regresses to decimal strings fails loudly here
|
|
1219
|
-
* rather than truncating.
|
|
1220
|
-
*/
|
|
1221
|
-
declare function blockchainAmountFromRawOrThrow({ label, raw, decimals, }: {
|
|
1222
|
-
label: string;
|
|
1223
|
-
raw: string;
|
|
1224
|
-
decimals: AssetDecimals;
|
|
1225
|
-
}): BlockchainAmount;
|
|
1226
|
-
/**
|
|
1227
|
-
* Parses a user-entered decimal string into a {@link BlockchainAmount} at the
|
|
1228
|
-
* given token decimals. Rejects scientific notation, negatives, malformed
|
|
1229
|
-
* input, more fractional digits than the token supports, and amounts that
|
|
1230
|
-
* scale past uint256 — surfacing a typed {@link AmountParseErrorReason} so
|
|
1231
|
-
* callers own the display copy.
|
|
1232
|
-
*/
|
|
1233
|
-
declare function parseBlockchainAmount(amount: string, decimals: AssetDecimals): AmountParseResult;
|
|
1234
|
-
|
|
1235
|
-
declare const USDC_SYMBOL: StablecoinSymbol;
|
|
1236
|
-
declare const USDC: Erc20Asset;
|
|
1237
|
-
declare const USDT_SYMBOL: StablecoinSymbol;
|
|
1238
|
-
declare const USDT: Erc20Asset;
|
|
1239
|
-
/** Lookups for the stablecoins the SDK's swap flows support out of the box. */
|
|
1240
|
-
declare const TOKEN_REGISTRY: {
|
|
1241
|
-
erc20: (symbol: KnownAssetSymbol) => Erc20Asset;
|
|
1242
|
-
/**
|
|
1243
|
-
* USDC's contract on `chain`. USDC is deployed on every chain the SDK
|
|
1244
|
-
* models, so the table is total and the answer is never `null`.
|
|
1245
|
-
*/
|
|
1246
|
-
usdcAddress: (chain: EthereumChain) => EvmContractAddress;
|
|
1247
|
-
/**
|
|
1248
|
-
* USDT's contract on `chain`, or `null` where Tether publishes none —
|
|
1249
|
-
* Base Sepolia today. The honest answer, never a fake address a balance
|
|
1250
|
-
* read would call.
|
|
1251
|
-
*/
|
|
1252
|
-
usdtAddress: (chain: EthereumChain) => EvmContractAddress | null;
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
/**
|
|
1256
|
-
* Error thrown when a feature or code path is not yet implemented.
|
|
1257
|
-
*/
|
|
1258
|
-
declare class NotImplementedError extends Error {
|
|
1259
|
-
constructor(message?: string);
|
|
1260
|
-
}
|
|
1261
|
-
/**
|
|
1262
|
-
* Error thrown when accessing a feature that requires authentication
|
|
1263
|
-
* without being authenticated.
|
|
1264
|
-
*/
|
|
1265
|
-
declare class NotAuthenticatedError extends Error {
|
|
1266
|
-
constructor(message?: string);
|
|
1267
|
-
}
|
|
1268
|
-
declare class ValidationError extends Error {
|
|
1269
|
-
constructor(message: string);
|
|
1270
|
-
}
|
|
1271
|
-
/**
|
|
1272
|
-
* Error thrown when the SDK computes something impossible: a value outside
|
|
1273
|
-
* uint256 after its own arithmetic, a symbol missing from a registry the SDK
|
|
1274
|
-
* itself ships. Distinct from {@link ValidationError}, which means the backend
|
|
1275
|
-
* sent a shape the SDK does not understand.
|
|
1276
|
-
*
|
|
1277
|
-
* The two have different remedies, which is the whole reason they are separate
|
|
1278
|
-
* types: a {@link ValidationError} is worth reporting to CoinList, an
|
|
1279
|
-
* `InvariantError` is an SDK bug worth reporting against the SDK.
|
|
1280
|
-
*/
|
|
1281
|
-
declare class InvariantError extends Error {
|
|
1282
|
-
constructor(message: string);
|
|
1283
|
-
}
|
|
1284
|
-
/**
|
|
1285
|
-
* Error thrown when an arithmetic operation has no answer to give: a division
|
|
1286
|
-
* by zero, or a result that falls outside the range its type can represent.
|
|
1287
|
-
*
|
|
1288
|
-
* Distinct from {@link ValidationError}, which says a value arrived malformed.
|
|
1289
|
-
* A `MathError` says every operand was well-formed and the operation on them
|
|
1290
|
-
* still has no result, so the two are worth catching apart: one points at the
|
|
1291
|
-
* response, the other at the arithmetic we asked for.
|
|
1292
|
-
*/
|
|
1293
|
-
declare class MathError extends Error {
|
|
1294
|
-
constructor(message: string);
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
/**
|
|
1298
|
-
* Wire shapes for frontline's `/v1/centrifuge/vault/*` endpoints, as published
|
|
1299
|
-
* in frontline's OpenAPI schema (ENG-1936). Every uint256 crosses as a decimal
|
|
1300
|
-
* string, every price as a decimal string, every timestamp as ISO 8601.
|
|
1301
|
-
*
|
|
1302
|
-
* **A vault deposit does not settle in the transaction that places it.** The
|
|
1303
|
-
* fund fulfils requests on its own epoch, in whole or in part, at a price set
|
|
1304
|
-
* then, and the user claims the resulting shares in a second transaction. So
|
|
1305
|
-
* every share figure before a fill is an estimate.
|
|
1306
|
-
*
|
|
1307
|
-
* The three GETs are free to poll. The two POSTs return calldata to broadcast:
|
|
1308
|
-
* `buy` is signed for one wallet and called once on confirmation, `claim`
|
|
1309
|
-
* collects everything claimable and carries no amount.
|
|
1310
|
-
*/
|
|
1311
|
-
/**
|
|
1312
|
-
* Why a deposit cannot be placed right now. A closed set, so a client can
|
|
1313
|
-
* branch on every value. `vault_unlinked` is terminal for the offer's proxy on
|
|
1314
|
-
* that chain; the rest clear on their own or by hand.
|
|
1315
|
-
*
|
|
1316
|
-
* `below_minimum` is the one reason that depends on an amount, so only a quote
|
|
1317
|
-
* can report it - see {@link CentrifugeVaultReasonDto}.
|
|
1318
|
-
*/
|
|
1319
|
-
type CentrifugeOrderReasonDto = 'vault_unlinked' | 'vault_halted' | 'proxy_not_permissioned' | 'price_unavailable' | 'below_minimum';
|
|
1320
|
-
/** What a vault status can report: every reason but the amount-dependent one. */
|
|
1321
|
-
type CentrifugeVaultReasonDto = Exclude<CentrifugeOrderReasonDto, 'below_minimum'>;
|
|
1322
|
-
/**
|
|
1323
|
-
* Where a wallet stands on a vault, derived from its amounts rather than
|
|
1324
|
-
* stored. Not a lifecycle: a new request moves any of these back to `pending`
|
|
1325
|
-
* while earlier shares stay claimed.
|
|
1326
|
-
*/
|
|
1327
|
-
type CentrifugePositionStatusDto = 'none' | 'pending' | 'partially_filled' | 'filled' | 'claimed';
|
|
1328
|
-
/** `GET /v1/centrifuge/vault/quote?symbol&chain&amount`. Indicative only. */
|
|
1329
|
-
type CentrifugeVaultQuoteDto = {
|
|
1330
|
-
object: 'centrifuge_vault_quote';
|
|
1331
|
-
/** The vault's share token symbol, e.g. `deJTRSY`. */
|
|
1332
|
-
symbol: string;
|
|
1333
|
-
chain: string;
|
|
1334
|
-
/** The amount priced, echoed back, in `spend_input_decimals`. No fee. */
|
|
1335
|
-
spend_input_amount: string;
|
|
1336
|
-
spend_input_decimals: number;
|
|
1337
|
-
/** An estimate, not a floor: the fill can price either side of it. */
|
|
1338
|
-
estimated_shares: string;
|
|
1339
|
-
share_decimals: number;
|
|
1340
|
-
/** Funding token per whole share. Null when the vault has no price. */
|
|
1341
|
-
indicative_price: string | null;
|
|
1342
|
-
/** In `spend_input_decimals`. Null when the offer sets no minimum. */
|
|
1343
|
-
minimum_input_amount: string | null;
|
|
1344
|
-
can_order: boolean;
|
|
1345
|
-
/** Empty exactly when `can_order` is true. */
|
|
1346
|
-
reasons: CentrifugeOrderReasonDto[];
|
|
1347
|
-
};
|
|
1348
|
-
/**
|
|
1349
|
-
* `GET /v1/centrifuge/vault/status?symbol&chain`. The vault's own state, read
|
|
1350
|
-
* from the chain on every call; the gate to poll, because Centrifuge announces
|
|
1351
|
-
* none of these changes.
|
|
1352
|
-
*/
|
|
1353
|
-
type CentrifugeVaultStatusDto = {
|
|
1354
|
-
object: 'centrifuge_vault_status';
|
|
1355
|
-
symbol: string;
|
|
1356
|
-
chain: string;
|
|
1357
|
-
/** Centrifuge's vault, read from the proxy. Fixed for the proxy's life. */
|
|
1358
|
-
vault_address: string;
|
|
1359
|
-
/** False is terminal for this proxy: a replacement has to be deployed. */
|
|
1360
|
-
linked: boolean;
|
|
1361
|
-
/** Whether the proxy is on the share token's memberlist. */
|
|
1362
|
-
permissioned: boolean;
|
|
1363
|
-
membership_valid_until: string | null;
|
|
1364
|
-
/** Set by the proxy after a force-cancel; cleared only by hand. */
|
|
1365
|
-
halted: boolean;
|
|
1366
|
-
price_updated_at: string | null;
|
|
1367
|
-
can_order: boolean;
|
|
1368
|
-
reasons: CentrifugeVaultReasonDto[];
|
|
1369
|
-
as_of: string;
|
|
1370
|
-
};
|
|
1371
|
-
/**
|
|
1372
|
-
* What both POSTs return: calldata for the wallet to broadcast verbatim.
|
|
1373
|
-
* Unlike Ondo's, `expires_at` is nullable - a claim carries no signature, so
|
|
1374
|
-
* it is always null there.
|
|
1375
|
-
*/
|
|
1376
|
-
type CentrifugeBroadcastDto = {
|
|
1377
|
-
action: 'broadcast_transaction';
|
|
1378
|
-
/** The offer's proxy on the chain. Lower case: compare case-insensitively. */
|
|
1379
|
-
to: string;
|
|
1380
|
-
data: string;
|
|
1381
|
-
expires_at: string | null;
|
|
1382
|
-
};
|
|
1383
|
-
/**
|
|
1384
|
-
* `POST /v1/centrifuge/vault/buy` with `{ symbol, chain, wallet_address,
|
|
1385
|
-
* amount }`. Broadcasting it places a request in the vault's queue and buys
|
|
1386
|
-
* nothing yet.
|
|
1387
|
-
*/
|
|
1388
|
-
type CentrifugeVaultBuyDto = CentrifugeBroadcastDto & {
|
|
1389
|
-
/** Exactly what the approval has to cover: no fee comes off it. */
|
|
1390
|
-
spend_input_amount: string;
|
|
1391
|
-
spend_input_decimals: number;
|
|
1392
|
-
/** Not a quantity purchased: the fill prices later. */
|
|
1393
|
-
estimated_shares: string;
|
|
1394
|
-
share_decimals: number;
|
|
1395
|
-
};
|
|
1396
|
-
/**
|
|
1397
|
-
* `GET /v1/centrifuge/vault/position?symbol&chain&wallet_address`. The six
|
|
1398
|
-
* amounts are independent: a wallet can hold a pending request, a claimable
|
|
1399
|
-
* balance and claimed shares at once. There is no per-fulfilment breakdown;
|
|
1400
|
-
* settlement pools every fulfilment into one rate.
|
|
1401
|
-
*/
|
|
1402
|
-
type CentrifugeVaultPositionDto = {
|
|
1403
|
-
object: 'centrifuge_vault_position';
|
|
1404
|
-
symbol: string;
|
|
1405
|
-
chain: string;
|
|
1406
|
-
wallet_address: string;
|
|
1407
|
-
status: CentrifugePositionStatusDto;
|
|
1408
|
-
/** Funding token ever requested, in `asset_decimals`. */
|
|
1409
|
-
requested: string;
|
|
1410
|
-
/** Of that, still queued. */
|
|
1411
|
-
pending: string;
|
|
1412
|
-
/** Of that, fulfilled. */
|
|
1413
|
-
filled_assets: string;
|
|
1414
|
-
/** Shares the fulfilments earned, in `share_decimals`. Held by the proxy until claimed. */
|
|
1415
|
-
earned_shares: string;
|
|
1416
|
-
claimed_shares: string;
|
|
1417
|
-
/** Non-zero means the claim endpoint will return calldata. */
|
|
1418
|
-
claimable_shares: string;
|
|
1419
|
-
/** Read from the share token; can exceed `claimed_shares`. */
|
|
1420
|
-
share_balance: string;
|
|
1421
|
-
asset_decimals: number;
|
|
1422
|
-
share_decimals: number;
|
|
1423
|
-
/** Null before the first claim. */
|
|
1424
|
-
average_price: string | null;
|
|
1425
|
-
/** Centrifuge froze the wallet on the share token; blocks claiming. */
|
|
1426
|
-
frozen: boolean;
|
|
1427
|
-
as_of: string;
|
|
1428
|
-
};
|
|
1429
|
-
/**
|
|
1430
|
-
* `POST /v1/centrifuge/vault/claim` with `{ symbol, chain, wallet_address }`.
|
|
1431
|
-
* The wallet named must be the one that broadcasts: the proxy credits the
|
|
1432
|
-
* sender.
|
|
1433
|
-
*/
|
|
1434
|
-
type CentrifugeVaultClaimDto = CentrifugeBroadcastDto & {
|
|
1435
|
-
/** A floor: a fill landing before the broadcast raises it. */
|
|
1436
|
-
claimable_shares: string;
|
|
1437
|
-
share_decimals: number;
|
|
1438
|
-
};
|
|
1439
|
-
|
|
1440
|
-
/**
|
|
1441
|
-
* Why a deposit cannot be placed on a vault right now. Kept verbatim from the
|
|
1442
|
-
* wire: frontline publishes it as a closed set for clients to branch on.
|
|
1443
|
-
*/
|
|
1444
|
-
type CentrifugeOrderReason = CentrifugeOrderReasonDto;
|
|
1445
|
-
/** The reasons a vault status can report - all but `below_minimum`. */
|
|
1446
|
-
type CentrifugeVaultReason = CentrifugeVaultReasonDto;
|
|
1447
|
-
/**
|
|
1448
|
-
* Where a wallet stands on a vault. Not a lifecycle - see
|
|
1449
|
-
* {@link CentrifugeVaultPosition.status}.
|
|
1450
|
-
*/
|
|
1451
|
-
type CentrifugePositionStatus = CentrifugePositionStatusDto;
|
|
1452
|
-
/**
|
|
1453
|
-
* Whether a deposit can be placed, as one union rather than the wire's
|
|
1454
|
-
* `can_order` beside `reasons`: a blocked answer always says why, and an
|
|
1455
|
-
* orderable one has nothing to say. The wire pair can contradict itself; this
|
|
1456
|
-
* cannot, because `fromDto` refuses the payloads that do.
|
|
1457
|
-
*/
|
|
1458
|
-
type CentrifugeOrderability<R extends CentrifugeOrderReason> = {
|
|
1459
|
-
type: 'orderable';
|
|
1460
|
-
} | {
|
|
1461
|
-
type: 'blocked';
|
|
1462
|
-
reasons: [R, ...R[]];
|
|
1463
|
-
};
|
|
1464
|
-
/**
|
|
1465
|
-
* What a deposit of a given size would buy, and whether it can be placed.
|
|
1466
|
-
*
|
|
1467
|
-
* **Indicative only.** The price is read from the vault now and the fund
|
|
1468
|
-
* prices the fulfilment on its own epoch, so neither {@link indicativePrice}
|
|
1469
|
-
* nor {@link estimatedShares} is a commitment. Free to poll while the user
|
|
1470
|
-
* sizes a deposit.
|
|
1471
|
-
*/
|
|
1472
|
-
type CentrifugeVaultQuote = {
|
|
1473
|
-
chain: EthereumChain;
|
|
1474
|
-
/** The vault's share token symbol, e.g. `deJTRSY`. */
|
|
1475
|
-
symbol: AssetSymbol;
|
|
1476
|
-
/** The amount priced, in the funding token's decimals. No fee is taken. */
|
|
1477
|
-
spendInputAmount: BlockchainAmount;
|
|
1478
|
-
/** Shares at the indicative price, in the share token's decimals. */
|
|
1479
|
-
estimatedShares: BlockchainAmount;
|
|
1480
|
-
/** Funding token per whole share. Null when the vault publishes no price. */
|
|
1481
|
-
indicativePrice: DecimalString | null;
|
|
1482
|
-
/** Null when the offer sets no minimum. Same decimals as the spend. */
|
|
1483
|
-
minimumInputAmount: BlockchainAmount | null;
|
|
1484
|
-
orderability: CentrifugeOrderability<CentrifugeOrderReason>;
|
|
1485
|
-
};
|
|
1486
|
-
declare const CentrifugeVaultQuote: {
|
|
1487
|
-
fromDto: (dto: CentrifugeVaultQuoteDto) => CentrifugeVaultQuote;
|
|
1488
|
-
};
|
|
1489
|
-
/**
|
|
1490
|
-
* A vault's own state, independent of any wallet or amount: the gate to poll.
|
|
1491
|
-
* Centrifuge announces none of these changes, and an unlinked vault leaves the
|
|
1492
|
-
* offer's proxy permanently dead, so a cached answer goes wrong silently.
|
|
1493
|
-
*/
|
|
1494
|
-
type CentrifugeVaultStatus = {
|
|
1495
|
-
chain: EthereumChain;
|
|
1496
|
-
symbol: AssetSymbol;
|
|
1497
|
-
/** Centrifuge's vault behind the proxy. Fixed for the proxy's life. */
|
|
1498
|
-
vaultAddress: EvmContractAddress;
|
|
1499
|
-
/**
|
|
1500
|
-
* Whether Centrifuge still links the vault to its pool. False is terminal
|
|
1501
|
-
* for this proxy: no request or claim succeeds until a new one is deployed.
|
|
1502
|
-
*/
|
|
1503
|
-
linked: boolean;
|
|
1504
|
-
/**
|
|
1505
|
-
* Whether the proxy is on the share token's memberlist. It holds shares for
|
|
1506
|
-
* every wallet, so one expired entry stops the whole offer.
|
|
1507
|
-
*/
|
|
1508
|
-
permissioned: boolean;
|
|
1509
|
-
/** Watch it: {@link permissioned} goes false the moment it passes. */
|
|
1510
|
-
membershipValidUntil: Date | null;
|
|
1511
|
-
/** The proxy halted itself after a force-cancel; cleared only by hand. */
|
|
1512
|
-
halted: boolean;
|
|
1513
|
-
/** A stale value is the signal that a quote's price is old. */
|
|
1514
|
-
priceUpdatedAt: Date | null;
|
|
1515
|
-
orderability: CentrifugeOrderability<CentrifugeVaultReason>;
|
|
1516
|
-
/** When the chain was read: how old everything above is. */
|
|
1517
|
-
asOf: Date;
|
|
1518
|
-
};
|
|
1519
|
-
declare const CentrifugeVaultStatus: {
|
|
1520
|
-
fromDto: (dto: CentrifugeVaultStatusDto) => CentrifugeVaultStatus;
|
|
1521
|
-
};
|
|
1522
|
-
/**
|
|
1523
|
-
* What both vault transactions share: calldata to broadcast verbatim, and the
|
|
1524
|
-
* deadline on it.
|
|
1525
|
-
*/
|
|
1526
|
-
type CentrifugeVaultTransactionCore = {
|
|
1527
|
-
/** The `to` is the offer's proxy: the spender the deposit was approved to. */
|
|
1528
|
-
tx: Tx;
|
|
1529
|
-
/**
|
|
1530
|
-
* When the calldata stops being accepted, or null when it carries no
|
|
1531
|
-
* deadline - always the case for a claim, which nobody signs.
|
|
1532
|
-
*/
|
|
1533
|
-
expiresAt: Date | null;
|
|
1534
|
-
};
|
|
1535
|
-
/**
|
|
1536
|
-
* A signed deposit request, ready to broadcast.
|
|
1537
|
-
*
|
|
1538
|
-
* **Broadcasting it buys nothing yet.** It places a request in the vault's
|
|
1539
|
-
* queue; the fund fulfils it later at a price set then, and the user comes
|
|
1540
|
-
* back to claim. {@link estimatedShares} is therefore never a quantity
|
|
1541
|
-
* purchased. Single-use: built once on confirmation, never on a timer.
|
|
1542
|
-
*/
|
|
1543
|
-
type CentrifugeVaultBuyTransaction = CentrifugeVaultTransactionCore & {
|
|
1544
|
-
/** Exactly what the approval has to cover: no fee comes off it. */
|
|
1545
|
-
spendInputAmount: BlockchainAmount;
|
|
1546
|
-
/** At the price read when the calldata was built. An estimate, not a floor. */
|
|
1547
|
-
estimatedShares: BlockchainAmount;
|
|
1548
|
-
};
|
|
1549
|
-
declare const CentrifugeVaultBuyTransaction: {
|
|
1550
|
-
fromDto: (dto: CentrifugeVaultBuyDto) => CentrifugeVaultBuyTransaction;
|
|
1551
|
-
};
|
|
1552
|
-
/**
|
|
1553
|
-
* The claim that moves fulfilled shares from the proxy to the wallet: the
|
|
1554
|
-
* second transaction every vault purchase needs. The wallet that broadcasts it
|
|
1555
|
-
* is the one credited.
|
|
1556
|
-
*/
|
|
1557
|
-
type CentrifugeVaultClaimTransaction = CentrifugeVaultTransactionCore & {
|
|
1558
|
-
/**
|
|
1559
|
-
* Read when the calldata was built. A floor: a fill landing before the
|
|
1560
|
-
* broadcast raises it, and the claim still collects everything.
|
|
1561
|
-
*/
|
|
1562
|
-
claimableShares: BlockchainAmount;
|
|
1563
|
-
};
|
|
1564
|
-
declare const CentrifugeVaultClaimTransaction: {
|
|
1565
|
-
fromDto: (dto: CentrifugeVaultClaimDto) => CentrifugeVaultClaimTransaction;
|
|
1566
|
-
};
|
|
1567
|
-
/**
|
|
1568
|
-
* One wallet's standing on one vault: what it put in, what has settled, and
|
|
1569
|
-
* what it can claim. The endpoint a returning user lands on, and the one that
|
|
1570
|
-
* says whether to offer the claim.
|
|
1571
|
-
*
|
|
1572
|
-
* The amounts are independent of each other: each piece of a request settles
|
|
1573
|
-
* and is claimed on its own, so a wallet can be pending, claimable and claimed
|
|
1574
|
-
* at once. There is no per-fulfilment breakdown; settlement pools every
|
|
1575
|
-
* fulfilment into one {@link averagePrice}.
|
|
1576
|
-
*/
|
|
1577
|
-
type CentrifugeVaultPosition = {
|
|
1578
|
-
chain: EthereumChain;
|
|
1579
|
-
symbol: AssetSymbol;
|
|
1580
|
-
walletAddress: EvmWalletAddress;
|
|
1581
|
-
/**
|
|
1582
|
-
* Derived by frontline from the amounts. Not a lifecycle: a new request
|
|
1583
|
-
* moves it back to `pending` while earlier shares stay claimed.
|
|
1584
|
-
*/
|
|
1585
|
-
status: CentrifugePositionStatus;
|
|
1586
|
-
/** Funding token ever requested. */
|
|
1587
|
-
requested: BlockchainAmount;
|
|
1588
|
-
/** Of {@link requested}, what is still queued. */
|
|
1589
|
-
pending: BlockchainAmount;
|
|
1590
|
-
/** Of {@link requested}, what has been fulfilled. */
|
|
1591
|
-
filledAssets: BlockchainAmount;
|
|
1592
|
-
/** Shares the fulfilments earned. Held by the proxy until claimed. */
|
|
1593
|
-
earnedShares: BlockchainAmount;
|
|
1594
|
-
claimedShares: BlockchainAmount;
|
|
1595
|
-
/** Non-zero means a claim will return calldata. */
|
|
1596
|
-
claimableShares: BlockchainAmount;
|
|
1597
|
-
/**
|
|
1598
|
-
* What the wallet holds on the share token. Can exceed
|
|
1599
|
-
* {@link claimedShares}: shares acquired any other way count here.
|
|
1600
|
-
*/
|
|
1601
|
-
shareBalance: BlockchainAmount;
|
|
1602
|
-
/** Pooled rate over everything claimed. Null before the first claim. */
|
|
1603
|
-
averagePrice: DecimalString | null;
|
|
1604
|
-
/** Centrifuge froze this wallet on the share token. Blocks claiming. */
|
|
1605
|
-
frozen: boolean;
|
|
1606
|
-
asOf: Date;
|
|
1607
|
-
};
|
|
1608
|
-
declare const CentrifugeVaultPosition: {
|
|
1609
|
-
fromDto: (dto: CentrifugeVaultPositionDto) => CentrifugeVaultPosition;
|
|
1610
|
-
};
|
|
1611
|
-
|
|
1612
|
-
type UserDto = {
|
|
1613
|
-
id: string;
|
|
1614
|
-
email: string;
|
|
1615
|
-
};
|
|
1616
|
-
|
|
1617
|
-
type UserId = Newtype<string, 'UserId'>;
|
|
1618
|
-
declare const UserId: (value: string) => UserId;
|
|
1619
|
-
type UserEmail = Newtype<string, 'UserEmail'>;
|
|
1620
|
-
declare const UserEmail: (value: string) => UserEmail;
|
|
1621
|
-
type User = {
|
|
1622
|
-
id: UserId;
|
|
1623
|
-
email: UserEmail;
|
|
1624
|
-
};
|
|
1625
|
-
declare const User: {
|
|
1626
|
-
fromDto: (dto: UserDto) => User;
|
|
1627
|
-
};
|
|
1628
|
-
|
|
1629
|
-
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, type CentrifugeOrderReason, type CentrifugeOrderability, type CentrifugePositionStatus, CentrifugeVaultBuyTransaction, CentrifugeVaultClaimTransaction, CentrifugeVaultPosition, CentrifugeVaultQuote, type CentrifugeVaultReason, CentrifugeVaultStatus, type CentrifugeVaultTransactionCore, 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, 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, Tx, 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, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
|