@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,86 +1,92 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet,
|
|
5
|
-
import {
|
|
6
|
-
export { E as EpochMillis, M as Millis, S as Seconds, i as isExpired } from '../time-DvgN98Q9.js';
|
|
1
|
+
import { aj as RequestId, ak as ClientId, al as RedirectUri, am as CodeChallenge, an as PKCEState, C as CodeVerifier, j as OfferSwapContract, E as EthereumChain, b as EvmContractAddress, k as OndoBuyTransaction, B as BlockchainAmount, l as OndoSellTransaction, S as SwapQuote, p as Bps, ao as SwapStatus, a7 as AssetDecimals, a as AssetSymbol, q as EvmWalletAddress, ap as KnownAssetSymbol, I as Erc20Asset, H as StablecoinSymbol } from '../time-DkU7jivQ.js';
|
|
2
|
+
export { aq as AllowWalletParams, ar as AllowWalletResponse, as as Asset, at as AssetCode, h as AssetId, N as AsyncOfferDetail, au as AsyncOfferType, A as AuthorizationCode, av as BaseEvent, aw as BuildCentrifugeVaultBuyParams, a1 as BuildOndoBuyParams, a3 as BuildOndoSellParams, ax as BuildOndoSwapParamsCore, ay as CentrifugeAssets, d as CentrifugeClaimDirection, az as CentrifugeDepositPosition, e as CentrifugeNamespace, aA as CentrifugeOrderReason, aB as CentrifugeOrderability, aC as CentrifugeRedeemPosition, aD as CentrifugeShares, aa as CentrifugeVault, c as CentrifugeVaultBuyTransaction, aE as CentrifugeVaultClaimProceedsTransaction, aF as CentrifugeVaultClaimTransaction, a9 as CentrifugeVaultLeg, K as CentrifugeVaultLegId, aG as CentrifugeVaultOffer, L as CentrifugeVaultOfferDetail, aH as CentrifugeVaultReason, a0 as CentrifugeVaultRef, aI as CentrifugeVaultResolution, $ as CentrifugeVaultStatus, aJ as CentrifugeVaultTransactionCore, aK as CentrifugeWalletParams, aL as Chain, af as ClientCredentialsOAuth, ai as ClientSecret, i as CoinListTokenSaleNamespace, aM as CoinListTokenSaleOffer, J as CoinListTokenSaleOfferDetail, w as Config, aN as ConnectExternalWalletParams, aO as CreateKycTokenParams, aP as CreateParticipationParams, aQ as CreateWalletOwnershipChallengeParams, aR as Cursor, aS as DebugEvent, aT as DecimalString, aU as DocumentFormType, ac as DocumentSubmission, aV as DocumentSubmissionStatus, aW as DocumentType, aX as ETHEREUM_CHAINS, aY as EpochMillis, z as Erc20Namespace, aZ as FaqItem, a_ as FrontlineEventId, a$ as GetCentrifugeVaultStatusParams, b0 as GetOndoQuoteParams, b1 as GetOndoTradingStatusParams, b2 as GetSwapAuthorizationParams, b3 as GetSwapPreviewParams, b4 as GetSwapQuoteParams, b5 as GetTokenAllowanceParams, b6 as GetTokenBalanceParams, b7 as HexEncodedTransactionData, b8 as Isin, b9 as Iso2CountryCode, U as KycLevelName, ba as KycToken, bb as Link, bc as ListOptionAddressesParams, bd as LogBinding, be as LogBindings, bf as LogCause, bg as LogLevel, bh as LogScope, bi as LogValue, _ as Logger, bj as MAX_ASSET_DECIMALS, bk as MAX_UINT_256, bl as Milestone, bm as Millis, bn as Newtype, x as OAuthAccessToken, bo as OAuthRefreshToken, ae as OAuthSession, D as Offer, bp as OfferBase, G as OfferDetail, bq as OfferDetailBase, br as OfferEditorial, f as OfferId, bs as OfferOption, u as OfferOptionAddress, ab as OfferOptionAddressId, g as OfferOptionId, bt as OfferOptionSlug, bu as OfferSlug, bv as OfferToken, bw as OfferType, O as OfferVaultContract, y as OffersNamespace, m as OndoNamespace, a4 as OndoQuote, bx as OndoQuoteDuration, a5 as OndoQuoteSize, by as OndoSellOutcome, bz as OndoSwapOffer, a2 as OndoSwapOfferDetail, n as OndoSwapTransactionCore, a6 as OndoTradingStatus, o as OrderBookSide, ah as PaginatedResponse, ag as PaginationParams, P as Participation, bA as ParticipationId, bB as ParticipationStatus, bC as ParticipationsPaginationParams, bD as PauseFlags, bE as Pii, bF as PiiAddress, bG as PiiJurisdiction, bH as PiiKind, Z as PinoLoggerOptions, bI as ProductionLogLevel, bJ as ReadCentrifugePositionParams, bK as RedactedWalletError, bL as RemoveOptionAddressParams, s as Requirement, bM as RequirementActionNeededReason, Y as RequirementId, Q as RequirementStatusInfo, X as RequirementStatusValue, V as RequirementType, R as RequirementsNamespace, bN as RpcConfig, bO as RpcFailureReason, bP as SOLANA_CHAINS, bQ as STABLE_DECIMALS, bR as SafeEvent, bS as SafeFields, M as Seconds, bT as SolanaChain, bU as SubmitDocumentParams, r as SuperstateSwapNamespace, bV as SuperstateSwapOffer, a8 as SuperstateSwapOfferDetail, bW as SwapContractRef, bX as SwapPreview, bY as TermItem, bZ as Ticker, ad as TokenIdentifier, b_ as TokenLogo, b$ as TokenLogoImage, c0 as TokenLogoUrl, F as TokenMetadata, c1 as TokenRole, T as TokensNamespace, c2 as Tx, c3 as Uint256, c4 as UnredactedFields, t as WalletChallengeType, W as WalletError, c5 as WalletOwnershipChallenge, c6 as WalletOwnershipChallengeParamsBase, c7 as WalletProtocol, v as WalletsNamespace, c8 as assertUint256, c9 as isChain, ca as isOfferType, cb as parseUint256, cc as resolveCentrifugeVaults } from '../time-DkU7jivQ.js';
|
|
3
|
+
import { F as FormattedAmountAssetUi, T as TxExplorerUrl, d as FormattedAmountUi, b as FormattedPercentUi, S as ShortenedWalletAddress } from '../token-registry-snapshot-D0OWXMe4.js';
|
|
4
|
+
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, e as EvmSigner, E as EvmWallet, f as ExternalWalletAdapter, N as NonEmptyArray, g as TokenKey, c as TokenRegistrySnapshot, a as WalletLabelResolver, W as WalletSelection, h as WriteContractParams, o as offerDisplayTokens } from '../token-registry-snapshot-D0OWXMe4.js';
|
|
5
|
+
import { Hash, Chain } from 'viem';
|
|
7
6
|
|
|
7
|
+
type HttpResponse<TBody = unknown> = {
|
|
8
|
+
status: number;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
body: TBody | null;
|
|
11
|
+
/**
|
|
12
|
+
* The id of the request that produced this response, stamped by
|
|
13
|
+
* {@link HttpClient} so that whoever turns a non-2xx into an
|
|
14
|
+
* {@link HttpError} can carry it without threading the request alongside.
|
|
15
|
+
* Absent when the response did not come from an `HttpClient`.
|
|
16
|
+
*/
|
|
17
|
+
requestId?: RequestId;
|
|
18
|
+
};
|
|
19
|
+
declare class HttpError<TBody = unknown> extends Error {
|
|
20
|
+
readonly response: HttpResponse<TBody>;
|
|
21
|
+
constructor(response: HttpResponse<TBody>);
|
|
22
|
+
/**
|
|
23
|
+
* Correlates this failure with the `[HTTP]` log lines for the same request,
|
|
24
|
+
* which carry the method, the URL, the duration and every retry. `null` when
|
|
25
|
+
* the response did not come from an {@link HttpClient}.
|
|
26
|
+
*
|
|
27
|
+
* Worth quoting in a bug report: it is what makes a log excerpt readable.
|
|
28
|
+
*/
|
|
29
|
+
get requestId(): RequestId | null;
|
|
30
|
+
}
|
|
8
31
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Lives in the API layer rather than beside `PaginationParams` because it
|
|
13
|
-
* drives requests: it is the auto-paginating half that `list()` is built on,
|
|
14
|
-
* while the params and the response envelope are domain models the client and
|
|
15
|
-
* the server both name.
|
|
16
|
-
*/
|
|
17
|
-
declare function fetchAllPages<A, P extends PaginationParams = PaginationParams>(fetchPage: (params: P) => Promise<PaginatedResponse<A>>, baseParams?: Omit<P, keyof PaginationParams>): Promise<A[]>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* How often the Ondo checkout refreshes what it is allowed to poll: the market
|
|
21
|
-
* status and the indicative price. Both are free - neither spends an
|
|
22
|
-
* attestation - so this is paced for a price the user can trust rather than
|
|
23
|
-
* for cost.
|
|
24
|
-
*
|
|
25
|
-
* A built transaction is deliberately not on this timer. Building spends an
|
|
26
|
-
* attestation, so it happens once per order and once per refresh the user
|
|
27
|
-
* asks for.
|
|
28
|
-
*/
|
|
29
|
-
declare const ONDO_POLL_INTERVAL_MS = 15000;
|
|
30
|
-
/** Max time the review step offers a built quote. */
|
|
31
|
-
declare const ONDO_QUOTE_MAX_TTL_MS = 15000;
|
|
32
|
-
/**
|
|
33
|
-
* The order size the sidebar prices against before the user names one.
|
|
32
|
+
* The machine-readable `code` frontline attaches to an error, or `null` for
|
|
33
|
+
* anything else - a non-HTTP failure, or an error body that carries only a
|
|
34
|
+
* message.
|
|
34
35
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* Frontline answers a failure with `{ type, message, code?, errors?,
|
|
37
|
+
* event_id? }`, and `code` is the only part of it meant to be branched on:
|
|
38
|
+
* `message` is prose that may be reworded, and `type` distinguishes
|
|
39
|
+
* `invalid_request_error` from `api_error` without saying which one.
|
|
38
40
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* coexist - and they mean different things anyway.
|
|
41
|
+
* Reach for this only where a code has a distinct remedy the user can act on.
|
|
42
|
+
* Mapping the whole vocabulary would couple the SDK to strings frontline does
|
|
43
|
+
* not version; falling back to a generic failure is the right default.
|
|
43
44
|
*/
|
|
44
|
-
declare
|
|
45
|
+
declare function apiErrorCode(error: unknown): string | null;
|
|
46
|
+
|
|
47
|
+
type PKCEParams = {
|
|
48
|
+
clientId: ClientId;
|
|
49
|
+
responseType: 'code';
|
|
50
|
+
redirectUri: RedirectUri;
|
|
51
|
+
codeChallenge: CodeChallenge;
|
|
52
|
+
codeChallengeMethod: 'S256';
|
|
53
|
+
state: PKCEState;
|
|
54
|
+
codeVerifier: CodeVerifier;
|
|
55
|
+
};
|
|
56
|
+
type PKCEConfig = {
|
|
57
|
+
clientId: ClientId;
|
|
58
|
+
redirectUri: RedirectUri;
|
|
59
|
+
};
|
|
45
60
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* this names the token and never sizes it - `receive_output_decimals` is the
|
|
50
|
-
* only authority on how many decimals the proceeds are counted in, and the two
|
|
51
|
-
* are allowed to disagree.
|
|
52
|
-
*
|
|
53
|
-
* Named apart from {@link ONDO_SUPPORTED_INPUT_ASSETS} rather than read out of
|
|
54
|
-
* it, though both are USDC today. On a buy USDC is what the user funds with
|
|
55
|
-
* and one of a list that may grow; on a sell it is what they settle into and
|
|
56
|
-
* there is one of it. Reading `ONDO_SUPPORTED_INPUT_ASSETS[0]` here would make
|
|
57
|
-
* the sell screen quietly follow whichever funding coin happened to be listed
|
|
58
|
-
* first.
|
|
61
|
+
* Generates PKCE parameters for an OAuth2 authorization code flow.
|
|
62
|
+
* Pure crypto — no React, no DOM beyond Web Crypto API. Safe to use
|
|
63
|
+
* in server-side code and Next.js middleware.
|
|
59
64
|
*/
|
|
60
|
-
declare
|
|
65
|
+
declare function generatePKCEParams(config: PKCEConfig): Promise<PKCEParams>;
|
|
66
|
+
|
|
61
67
|
/**
|
|
62
|
-
* The
|
|
68
|
+
* The CoinList contract a swap on `chain` settles through, and therefore the
|
|
69
|
+
* ERC-20 spender the user approves - or `null` where this offer cannot be
|
|
70
|
+
* swapped on that chain.
|
|
63
71
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* and leave the panel permanently blank.
|
|
72
|
+
* Read off the offer rather than held as a constant because the address varies
|
|
73
|
+
* by environment, not only by chain: beta and production both run
|
|
74
|
+
* `ethereum_sepolia` and deploy a different contract on each, and one constant
|
|
75
|
+
* cannot name both. Frontline resolves it per environment and serves the
|
|
76
|
+
* answer on the offer.
|
|
70
77
|
*
|
|
71
|
-
* The
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* The coins an Ondo buy can be funded with, in display order, with the first
|
|
77
|
-
* preselected.
|
|
78
|
+
* The array varies per *offer* as well as per chain - frontline drops a chain
|
|
79
|
+
* whose funding and swap tokens do not both resolve for this asset - so an
|
|
80
|
+
* array read for one symbol must not be reused for another. An empty array
|
|
81
|
+
* means "cannot swap here", which is an answer rather than an error.
|
|
78
82
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
83
|
+
* A capability rather than a provider slice, and named for the data it reads
|
|
84
|
+
* rather than for its first caller: `swap_contracts` is an offer field, and
|
|
85
|
+
* `universal-core-isolation-and-sharing` would stop Superstate reusing this if
|
|
86
|
+
* it lived under `checkout/ondo/`. Superstate has not migrated yet - it still
|
|
87
|
+
* reads `superstateSwapContractAddress` - so Ondo is the only caller today.
|
|
82
88
|
*/
|
|
83
|
-
declare
|
|
89
|
+
declare function swapSpender(swapContracts: OfferSwapContract[], chain: EthereumChain): EvmContractAddress | null;
|
|
84
90
|
|
|
85
91
|
/**
|
|
86
92
|
* The price of one whole asset token in a built Ondo purchase, in the funding
|
|
@@ -127,20 +133,7 @@ declare function computeOndoBuyPrice(transaction: OndoBuyTransaction): Blockchai
|
|
|
127
133
|
* does today. They diverge the day ENG-1718 lands.
|
|
128
134
|
*/
|
|
129
135
|
declare function computeOndoSellPrice(transaction: OndoSellTransaction): BlockchainAmount;
|
|
130
|
-
/** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
|
|
131
|
-
declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
|
|
132
136
|
|
|
133
|
-
/**
|
|
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
137
|
/**
|
|
145
138
|
* Whether `error` is the CoinList API refusing an Ondo quote because the
|
|
146
139
|
* market is not open, as opposed to a request that failed.
|
|
@@ -151,701 +144,14 @@ declare const ONDO_NOT_TRADABLE_CODE = "not_tradable";
|
|
|
151
144
|
declare function isOndoNotTradableError(error: unknown): error is HttpError;
|
|
152
145
|
|
|
153
146
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
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.
|
|
147
|
+
* Price of 1 output token in USD, assuming the input token is a $1 stablecoin:
|
|
148
|
+
* the quote's input divided by its output, via {@link pricePerShare}.
|
|
149
|
+
* Returned decimals match the input token decimals (always the stablecoin's 6).
|
|
843
150
|
*
|
|
844
|
-
* `
|
|
151
|
+
* `null` for a quote that fills nothing, which is an answer here rather than
|
|
152
|
+
* a corrupt amount: there is no price to show for it.
|
|
845
153
|
*
|
|
846
|
-
*
|
|
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).
|
|
154
|
+
* @throws MathError when the price is out of uint256 bounds.
|
|
849
155
|
*/
|
|
850
156
|
declare function computePrice({ inputTokenAmount, outputTokenAmount, }: SwapQuote): BlockchainAmount | null;
|
|
851
157
|
/**
|
|
@@ -875,52 +181,10 @@ declare const SWAP_LEVEL = 2;
|
|
|
875
181
|
*/
|
|
876
182
|
declare function isSwapAvailable(status: SwapStatus): boolean;
|
|
877
183
|
|
|
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
184
|
/** Slippage tolerances offered in the review step, in basis points. */
|
|
913
185
|
declare const SLIPPAGE_OPTIONS_BPS: Bps[];
|
|
914
186
|
/** Default slippage tolerance (0.5%). */
|
|
915
187
|
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
188
|
/**
|
|
925
189
|
* The Superstate swap contract on `chain`, or `null` where none is deployed.
|
|
926
190
|
*
|
|
@@ -941,39 +205,6 @@ declare function superstateSwapContractAddress(chain: EthereumChain): EvmContrac
|
|
|
941
205
|
*/
|
|
942
206
|
declare function formattedPricePerShare(quote: SwapQuote | null, locale: string): FormattedAmountAssetUi;
|
|
943
207
|
|
|
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
208
|
/** The viem chain definition the SDK reads and writes this chain through. */
|
|
978
209
|
declare function viemChain(chain: EthereumChain): Chain;
|
|
979
210
|
declare function getChainId(chain: EthereumChain): number;
|
|
@@ -988,158 +219,6 @@ declare function chainFromId(chainId: string): EthereumChain;
|
|
|
988
219
|
declare function getNetworkName(chain: EthereumChain): string;
|
|
989
220
|
declare function txExplorerUrl(chain: EthereumChain, txHash: Hash): TxExplorerUrl;
|
|
990
221
|
|
|
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
222
|
declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
|
|
1144
223
|
type FormatAmountOptions = {
|
|
1145
224
|
maxFractionDigits?: AssetDecimals;
|
|
@@ -1294,336 +373,4 @@ declare class MathError extends Error {
|
|
|
1294
373
|
constructor(message: string);
|
|
1295
374
|
}
|
|
1296
375
|
|
|
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 };
|
|
376
|
+
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BlockchainAmount, Bps, ClientId, CodeChallenge, CodeVerifier, DEFAULT_SLIPPAGE_BPS, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, HttpError, type HttpResponse, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NotAuthenticatedError, NotImplementedError, OfferSwapContract, OndoBuyTransaction, OndoSellTransaction, type PKCEConfig, type PKCEParams, PKCEState, RedirectUri, RequestId, SLIPPAGE_OPTIONS_BPS, SWAP_LEVEL, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, ValidationError, apiErrorCode, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, generatePKCEParams, getChainId, getNetworkName, isOndoNotTradableError, isSwapAvailable, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
|