@coinlist-co/react 0.12.1-rc.73e7e17 → 0.12.1-rc.9aec85a

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.
Files changed (31) hide show
  1. package/dist/{chunk-3ZZCK4IT.js → chunk-DCW7NQXH.js} +129 -3
  2. package/dist/chunk-DCW7NQXH.js.map +1 -0
  3. package/dist/{chunk-D42IQHQZ.js → chunk-MOE5S6CE.js} +1345 -257
  4. package/dist/chunk-MOE5S6CE.js.map +1 -0
  5. package/dist/{chunk-ZUVVNZJJ.js → chunk-VH34YC3Q.js} +72 -330
  6. package/dist/chunk-VH34YC3Q.js.map +1 -0
  7. package/dist/client/index.cjs +9477 -8125
  8. package/dist/client/index.cjs.map +1 -1
  9. package/dist/client/index.d.cts +398 -166
  10. package/dist/client/index.d.ts +398 -166
  11. package/dist/client/index.js +4959 -4544
  12. package/dist/client/index.js.map +1 -1
  13. package/dist/server/index.cjs +1458 -263
  14. package/dist/server/index.cjs.map +1 -1
  15. package/dist/server/index.d.cts +1 -1
  16. package/dist/server/index.d.ts +1 -1
  17. package/dist/server/index.js +5 -3
  18. package/dist/server/index.js.map +1 -1
  19. package/dist/{collections-CMoojQ9M.d.ts → token-registry-snapshot-BNBNuDu1.d.ts} +65 -2
  20. package/dist/{collections-koI4cjYa.d.cts → token-registry-snapshot-CqI6dXM_.d.cts} +65 -2
  21. package/dist/{config-BmK0t-XO.d.cts → tokens-namespace-CIWBtgt2.d.cts} +463 -229
  22. package/dist/{config-BmK0t-XO.d.ts → tokens-namespace-CIWBtgt2.d.ts} +463 -229
  23. package/dist/universal/index.cjs +1275 -450
  24. package/dist/universal/index.cjs.map +1 -1
  25. package/dist/universal/index.d.cts +431 -54
  26. package/dist/universal/index.d.ts +431 -54
  27. package/dist/universal/index.js +26 -16
  28. package/package.json +1 -1
  29. package/dist/chunk-3ZZCK4IT.js.map +0 -1
  30. package/dist/chunk-D42IQHQZ.js.map +0 -1
  31. package/dist/chunk-ZUVVNZJJ.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { aq as PaginationParams, ar as PaginatedResponse, as as DecimalString, x as StablecoinSymbol, j as OndoBuyTransaction, B as BlockchainAmount, k as OndoSellTransaction, p as Bps, at as SwapStatus, Z as AssetDecimals, b as EvmContractAddress, a as EthereumChain, i as OfferSwapContract, au as Uint256, h as AssetSymbol, q as EvmWalletAddress, av as KnownAssetSymbol, y as Erc20Asset, aw as Newtype } from '../config-BmK0t-XO.cjs';
2
- export { ax as AllowWalletParams, ay as AllowWalletResponse, az as Asset, aA as AssetCode, e as AssetId, A as AuthorizationCode, aB as Blockchain, _ as BuildOndoBuyParams, $ as BuildOndoSellParams, aC as BuildOndoSwapParamsCore, aD as Chain, an as ClientCredentialsOAuth, aE as ClientId, ao as ClientSecret, aF as CodeChallenge, C as CodeVerifier, c as CoinListTokenSaleNamespace, f as CoinListTokenSaleNamespaceImpl, u as Config, aG as ConnectExternalWalletParams, aH as CreateKycTokenParams, aI as CreateParticipationParams, aJ as CreateWalletOwnershipChallengeParams, aK as Cursor, a5 as DebugEvent, aL as DocumentFormType, Q as DocumentSubmission, aM as DocumentSubmissionStatus, aN as DocumentType, aO as ETHEREUM_CHAINS, E as Erc20Namespace, aP as Erc20NamespaceImpl, aQ as FaqItem, a6 as FrontlineEventId, aR as GetOndoQuoteParams, aS as GetOndoTradingStatusParams, aT as GetSwapAuthorizationParams, aU as GetSwapPreviewParams, aV as GetTokenAllowanceParams, aW as GetTokenBalanceParams, aX as HexEncodedTransactionData, a7 as HttpError, a8 as HttpResponse, aY as Isin, aZ as Iso2CountryCode, N as KycLevelName, a9 as KycToken, a_ as Link, a$ as ListOptionAddressesParams, aa as LogBinding, ab as LogBindings, ac as LogCause, ad as LogLevel, ae as LogScope, af as LogValue, L as Logger, b0 as MAX_ASSET_DECIMALS, b1 as MAX_UINT_256, b2 as Milestone, v as OAuthAccessToken, b3 as OAuthRefreshToken, am as OAuthSession, G as Offer, z as OfferDetail, O as OfferId, b4 as OfferOption, K as OfferOptionAddress, a3 as OfferOptionAddressId, d as OfferOptionId, b5 as OfferOptionSlug, b6 as OfferSlug, b7 as OfferToken, F as OfferType, w as OffersNamespace, b8 as OffersNamespaceImpl, g as OndoNamespace, n as OndoNamespaceImpl, a0 as OndoQuote, b9 as OndoQuoteDuration, a1 as OndoQuoteSize, ba as OndoSellOutcome, l as OndoSwapTransactionCore, Y as OndoTradingStatus, m as OrderBookSide, bb as PKCEState, bc as PaginatedResponseDto, P as Participation, bd as ParticipationId, be as ParticipationStatus, bf as ParticipationsPaginationParams, bg as Pii, bh as PiiAddress, bi as PiiJurisdiction, bj as PiiKind, X as PinoLoggerOptions, ag as ProductionLogLevel, bk as QueryParamValue, bl as QueryParamValues, ah as RedactedWalletError, bm as RedirectUri, bn as RemoveOptionAddressParams, ai as RequestId, s as Requirement, bo as RequirementActionNeededReason, M as RequirementId, H as RequirementStatusInfo, J as RequirementStatusValue, I as RequirementType, R as RequirementsNamespace, t as RequirementsNamespaceImpl, bp as SOLANA_CHAINS, bq as STABLE_DECIMALS, aj as SafeEvent, ak as SafeFields, br as SolanaChain, bs as SubmitDocumentParams, S as SuperstateSwapNamespace, r as SuperstateSwapNamespaceImpl, bt as SwapAuthorization, bu as SwapContractRef, bv as SwapPreview, bw as TermItem, bx as Ticker, by as TokenAllowance, bz as TokenBalance, a2 as TokenIdentifier, a4 as TokenLogo, bA as TokenLogoImage, bB as TokenLogoUrl, D as TokenMetadata, bC as TokenRole, T as TokensNamespace, bD as TokensNamespaceImpl, bE as Tx, al as UnredactedFields, bF as WalletAddress, V as WalletChallengeType, W as WalletError, bG as WalletOwnershipChallenge, bH as WalletProtocol, o as WalletsNamespace, bI as WalletsNamespaceImpl, bJ as apiErrorCode, bK as assertUint256, bL as isChain, bM as parseUint256 } from '../config-BmK0t-XO.cjs';
3
- import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl, d as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress } from '../collections-koI4cjYa.cjs';
4
- export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, c as EvmSigner, E as EvmWallet, P as PKCEConfig, e as PKCEParams, W as WriteContractParams, g as generatePKCEParams } from '../collections-koI4cjYa.cjs';
5
- import { TransactionReceipt, Hash } from 'viem';
1
+ import { au as PaginationParams, av as PaginatedResponse, aw as DecimalString, x as StablecoinSymbol, j as OndoBuyTransaction, B as BlockchainAmount, k as OndoSellTransaction, p as Bps, ax as SwapStatus, a0 as AssetDecimals, b as EvmContractAddress, a as EthereumChain, i as OfferSwapContract, ay as Uint256, h as AssetSymbol, q as EvmWalletAddress, az as KnownAssetSymbol, y as Erc20Asset, aA as Newtype } from '../tokens-namespace-CIWBtgt2.cjs';
2
+ export { aB as AllowWalletParams, aC as AllowWalletResponse, aD as Asset, aE as AssetCode, e as AssetId, A as AuthorizationCode, aF as Blockchain, a1 as BuildOndoBuyParams, a2 as BuildOndoSellParams, aG as BuildOndoSwapParamsCore, aH as Chain, ar as ClientCredentialsOAuth, aI as ClientId, as as ClientSecret, aJ as CodeChallenge, C as CodeVerifier, c as CoinListTokenSaleNamespace, f as CoinListTokenSaleNamespaceImpl, aK as CoinListTokenSaleOffer, H as CoinListTokenSaleOfferDetail, u as Config, aL as ConnectExternalWalletParams, aM as CreateKycTokenParams, aN as CreateParticipationParams, aO as CreateWalletOwnershipChallengeParams, aP as Cursor, a8 as DebugEvent, aQ as DocumentFormType, Y as DocumentSubmission, aR as DocumentSubmissionStatus, aS as DocumentType, aT as ETHEREUM_CHAINS, E as Erc20Namespace, aU as Erc20NamespaceImpl, aV as FaqItem, a9 as FrontlineEventId, aW as GetOndoQuoteParams, aX as GetOndoTradingStatusParams, aY as GetSwapAuthorizationParams, aZ as GetSwapPreviewParams, a_ as GetTokenAllowanceParams, a$ as GetTokenBalanceParams, b0 as HexEncodedTransactionData, aa as HttpError, ab as HttpResponse, b1 as Isin, b2 as Iso2CountryCode, X as KycLevelName, ac as KycToken, b3 as Link, b4 as ListOptionAddressesParams, ad as LogBinding, ae as LogBindings, af as LogCause, ag as LogLevel, ah as LogScope, ai as LogValue, L as Logger, b5 as MAX_ASSET_DECIMALS, b6 as MAX_UINT_256, b7 as Milestone, v as OAuthAccessToken, b8 as OAuthRefreshToken, aq as OAuthSession, J as Offer, b9 as OfferBase, z as OfferDetail, ba as OfferDetailBase, bb as OfferEditorial, O as OfferId, bc as OfferOption, Q as OfferOptionAddress, a6 as OfferOptionAddressId, d as OfferOptionId, bd as OfferOptionSlug, be as OfferSlug, bf as OfferToken, F as OfferType, w as OffersNamespace, bg as OffersNamespaceImpl, g as OndoNamespace, n as OndoNamespaceImpl, a3 as OndoQuote, bh as OndoQuoteDuration, a4 as OndoQuoteSize, bi as OndoSellOutcome, bj as OndoSwapOffer, G as OndoSwapOfferDetail, l as OndoSwapTransactionCore, $ as OndoTradingStatus, m as OrderBookSide, bk as PKCEState, bl as PaginatedResponseDto, P as Participation, bm as ParticipationId, bn as ParticipationStatus, bo as ParticipationsPaginationParams, bp as PauseFlags, bq as Pii, br as PiiAddress, bs as PiiJurisdiction, bt as PiiKind, _ as PinoLoggerOptions, aj as ProductionLogLevel, bu as QueryParamValue, bv as QueryParamValues, ak as RedactedWalletError, bw as RedirectUri, bx as RemoveOptionAddressParams, al as RequestId, s as Requirement, by as RequirementActionNeededReason, V as RequirementId, K as RequirementStatusInfo, N as RequirementStatusValue, M as RequirementType, R as RequirementsNamespace, t as RequirementsNamespaceImpl, bz as RpcConfig, am as RpcFailureReason, bA as SOLANA_CHAINS, bB as STABLE_DECIMALS, an as SafeEvent, ao as SafeFields, bC as SolanaChain, bD as SubmitDocumentParams, S as SuperstateSwapNamespace, r as SuperstateSwapNamespaceImpl, bE as SuperstateSwapOffer, I as SuperstateSwapOfferDetail, bF as SwapContractRef, bG as SwapPreview, bH as TermItem, bI as Ticker, a5 as TokenIdentifier, a7 as TokenLogo, bJ as TokenLogoImage, bK as TokenLogoUrl, D as TokenMetadata, bL as TokenRole, T as TokensNamespace, bM as TokensNamespaceImpl, bN as Tx, ap as UnredactedFields, bO as WalletAddress, Z as WalletChallengeType, W as WalletError, bP as WalletOwnershipChallenge, bQ as WalletProtocol, o as WalletsNamespace, bR as WalletsNamespaceImpl, bS as apiErrorCode, bT as assertUint256, bU as isChain, bV as isOfferType, bW as parseUint256 } from '../tokens-namespace-CIWBtgt2.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-CqI6dXM_.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-CqI6dXM_.cjs';
5
+ import { TransactionReceipt, Hash, Chain } from 'viem';
6
6
 
7
7
  /**
8
8
  * Walks every page of a cursor-paginated endpoint and returns the flattened
@@ -26,15 +26,8 @@ declare function fetchAllPages<A, P extends PaginationParams = PaginationParams>
26
26
  * asks for.
27
27
  */
28
28
  declare const ONDO_POLL_INTERVAL_MS = 15000;
29
- /**
30
- * How close to its deadline a built transaction stops being offerable.
31
- *
32
- * Placing an order is not instant - the wallet has to prompt, the user has to
33
- * confirm, and the transaction has to reach a node - so calldata with a second
34
- * left is one the contract will reject. Treating the last few seconds as
35
- * already expired turns a paid-for revert into a refresh button.
36
- */
37
- declare const ONDO_QUOTE_EXPIRY_THRESHOLD_MS = 5000;
29
+ /** Max time the review step offers a built quote. */
30
+ declare const ONDO_QUOTE_MAX_TTL_MS = 15000;
38
31
  /**
39
32
  * The order size the sidebar prices against before the user names one.
40
33
  *
@@ -133,8 +126,69 @@ declare function computeOndoBuyPrice(transaction: OndoBuyTransaction): Blockchai
133
126
  * does today. They diverge the day ENG-1718 lands.
134
127
  */
135
128
  declare function computeOndoSellPrice(transaction: OndoSellTransaction): BlockchainAmount;
129
+ /** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
130
+ declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
136
131
 
132
+ /**
133
+ * The Superstate swap contract's ABI, generated verbatim from the shared
134
+ * `TokenSwap` base contract:
135
+ *
136
+ * ```
137
+ * cd ../solidity && forge inspect TokenSwap abi --json --use 0.8.34
138
+ * ```
139
+ *
140
+ * Generated rather than hand-trimmed to the four methods the SDK calls, so
141
+ * regenerating after a contract change is one command and a paste. The custom
142
+ * errors carry their weight in particular: viem decodes a revert against them,
143
+ * so a `preview()` on a stopped contract surfaces as `IsStopped` rather than
144
+ * as an opaque `0x`-prefixed blob.
145
+ *
146
+ * `status()` returns `Status { uint32 flags; State state }` where `State` is
147
+ * `0 = Active | 1 = Paused | 2 = Stopped`. It replaced the older
148
+ * `stopped() -> uint256` bitmask, which this contract still exposes but as a
149
+ * `bool`; {@link SwapStatus} reads `status()` and nothing else.
150
+ */
137
151
  declare const SUPERSTATE_SWAP_ABI: readonly [{
152
+ readonly type: "function";
153
+ readonly name: "KIND";
154
+ readonly inputs: readonly [];
155
+ readonly outputs: readonly [{
156
+ readonly name: "";
157
+ readonly type: "uint16";
158
+ readonly internalType: "uint16";
159
+ }];
160
+ readonly stateMutability: "view";
161
+ }, {
162
+ readonly type: "function";
163
+ readonly name: "ONE_HUNDRED_P";
164
+ readonly inputs: readonly [];
165
+ readonly outputs: readonly [{
166
+ readonly name: "";
167
+ readonly type: "uint256";
168
+ readonly internalType: "uint256";
169
+ }];
170
+ readonly stateMutability: "view";
171
+ }, {
172
+ readonly type: "function";
173
+ readonly name: "SWAP_LEVEL";
174
+ readonly inputs: readonly [];
175
+ readonly outputs: readonly [{
176
+ readonly name: "";
177
+ readonly type: "uint32";
178
+ readonly internalType: "uint32";
179
+ }];
180
+ readonly stateMutability: "view";
181
+ }, {
182
+ readonly type: "function";
183
+ readonly name: "VERSION";
184
+ readonly inputs: readonly [];
185
+ readonly outputs: readonly [{
186
+ readonly name: "";
187
+ readonly type: "uint16";
188
+ readonly internalType: "uint16";
189
+ }];
190
+ readonly stateMutability: "view";
191
+ }, {
138
192
  readonly type: "function";
139
193
  readonly name: "authorized";
140
194
  readonly inputs: readonly [{
@@ -150,7 +204,21 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
150
204
  readonly stateMutability: "view";
151
205
  }, {
152
206
  readonly type: "function";
153
- readonly name: "stopped";
207
+ readonly name: "bpp";
208
+ readonly inputs: readonly [{
209
+ readonly name: "amount";
210
+ readonly type: "uint256";
211
+ readonly internalType: "uint256";
212
+ }];
213
+ readonly outputs: readonly [{
214
+ readonly name: "";
215
+ readonly type: "uint256";
216
+ readonly internalType: "uint256";
217
+ }];
218
+ readonly stateMutability: "view";
219
+ }, {
220
+ readonly type: "function";
221
+ readonly name: "bps";
154
222
  readonly inputs: readonly [];
155
223
  readonly outputs: readonly [{
156
224
  readonly name: "";
@@ -160,12 +228,128 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
160
228
  readonly stateMutability: "view";
161
229
  }, {
162
230
  readonly type: "function";
163
- readonly name: "SWAP_LEVEL";
231
+ readonly name: "cancelOwnershipHandover";
164
232
  readonly inputs: readonly [];
233
+ readonly outputs: readonly [];
234
+ readonly stateMutability: "payable";
235
+ }, {
236
+ readonly type: "function";
237
+ readonly name: "completeOwnershipHandover";
238
+ readonly inputs: readonly [{
239
+ readonly name: "pendingOwner";
240
+ readonly type: "address";
241
+ readonly internalType: "address";
242
+ }];
243
+ readonly outputs: readonly [];
244
+ readonly stateMutability: "payable";
245
+ }, {
246
+ readonly type: "function";
247
+ readonly name: "fee";
248
+ readonly inputs: readonly [{
249
+ readonly name: "amount";
250
+ readonly type: "uint256";
251
+ readonly internalType: "uint256";
252
+ }];
165
253
  readonly outputs: readonly [{
166
254
  readonly name: "";
167
255
  readonly type: "uint256";
168
256
  readonly internalType: "uint256";
257
+ }, {
258
+ readonly name: "";
259
+ readonly type: "uint256";
260
+ readonly internalType: "uint256";
261
+ }];
262
+ readonly stateMutability: "view";
263
+ }, {
264
+ readonly type: "function";
265
+ readonly name: "id";
266
+ readonly inputs: readonly [];
267
+ readonly outputs: readonly [{
268
+ readonly name: "";
269
+ readonly type: "bytes32";
270
+ readonly internalType: "bytes32";
271
+ }];
272
+ readonly stateMutability: "view";
273
+ }, {
274
+ readonly type: "function";
275
+ readonly name: "inputTokens";
276
+ readonly inputs: readonly [{
277
+ readonly name: "";
278
+ readonly type: "address";
279
+ readonly internalType: "address";
280
+ }];
281
+ readonly outputs: readonly [{
282
+ readonly name: "";
283
+ readonly type: "bool";
284
+ readonly internalType: "bool";
285
+ }];
286
+ readonly stateMutability: "view";
287
+ }, {
288
+ readonly type: "function";
289
+ readonly name: "outputToken";
290
+ readonly inputs: readonly [];
291
+ readonly outputs: readonly [{
292
+ readonly name: "";
293
+ readonly type: "address";
294
+ readonly internalType: "address";
295
+ }];
296
+ readonly stateMutability: "view";
297
+ }, {
298
+ readonly type: "function";
299
+ readonly name: "outputTokenBalance";
300
+ readonly inputs: readonly [];
301
+ readonly outputs: readonly [{
302
+ readonly name: "";
303
+ readonly type: "uint256";
304
+ readonly internalType: "uint256";
305
+ }];
306
+ readonly stateMutability: "view";
307
+ }, {
308
+ readonly type: "function";
309
+ readonly name: "owner";
310
+ readonly inputs: readonly [];
311
+ readonly outputs: readonly [{
312
+ readonly name: "result";
313
+ readonly type: "address";
314
+ readonly internalType: "address";
315
+ }];
316
+ readonly stateMutability: "view";
317
+ }, {
318
+ readonly type: "function";
319
+ readonly name: "ownershipHandoverExpiresAt";
320
+ readonly inputs: readonly [{
321
+ readonly name: "pendingOwner";
322
+ readonly type: "address";
323
+ readonly internalType: "address";
324
+ }];
325
+ readonly outputs: readonly [{
326
+ readonly name: "result";
327
+ readonly type: "uint256";
328
+ readonly internalType: "uint256";
329
+ }];
330
+ readonly stateMutability: "view";
331
+ }, {
332
+ readonly type: "function";
333
+ readonly name: "pause";
334
+ readonly inputs: readonly [{
335
+ readonly name: "level";
336
+ readonly type: "uint32";
337
+ readonly internalType: "uint32";
338
+ }];
339
+ readonly outputs: readonly [{
340
+ readonly name: "";
341
+ readonly type: "bool";
342
+ readonly internalType: "bool";
343
+ }];
344
+ readonly stateMutability: "nonpayable";
345
+ }, {
346
+ readonly type: "function";
347
+ readonly name: "paused";
348
+ readonly inputs: readonly [];
349
+ readonly outputs: readonly [{
350
+ readonly name: "";
351
+ readonly type: "uint32";
352
+ readonly internalType: "uint32";
169
353
  }];
170
354
  readonly stateMutability: "view";
171
355
  }, {
@@ -201,54 +385,117 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
201
385
  readonly stateMutability: "view";
202
386
  }, {
203
387
  readonly type: "function";
204
- readonly name: "swap";
388
+ readonly name: "renounceOwnership";
389
+ readonly inputs: readonly [];
390
+ readonly outputs: readonly [];
391
+ readonly stateMutability: "payable";
392
+ }, {
393
+ readonly type: "function";
394
+ readonly name: "requestOwnershipHandover";
395
+ readonly inputs: readonly [];
396
+ readonly outputs: readonly [];
397
+ readonly stateMutability: "payable";
398
+ }, {
399
+ readonly type: "function";
400
+ readonly name: "setBps";
205
401
  readonly inputs: readonly [{
206
- readonly name: "token";
207
- readonly type: "address";
208
- readonly internalType: "address";
209
- }, {
210
- readonly name: "amount";
211
- readonly type: "uint256";
212
- readonly internalType: "uint256";
213
- }, {
214
- readonly name: "slip";
402
+ readonly name: "points";
215
403
  readonly type: "uint256";
216
404
  readonly internalType: "uint256";
217
405
  }];
218
406
  readonly outputs: readonly [{
219
407
  readonly name: "";
220
- readonly type: "uint256";
221
- readonly internalType: "uint256";
408
+ readonly type: "bool";
409
+ readonly internalType: "bool";
222
410
  }];
223
411
  readonly stateMutability: "nonpayable";
224
412
  }, {
225
413
  readonly type: "function";
226
- readonly name: "tokenBalance";
414
+ readonly name: "setInputToken";
227
415
  readonly inputs: readonly [{
228
416
  readonly name: "token";
229
417
  readonly type: "address";
230
418
  readonly internalType: "address";
419
+ }, {
420
+ readonly name: "val";
421
+ readonly type: "bool";
422
+ readonly internalType: "bool";
231
423
  }];
232
424
  readonly outputs: readonly [{
233
425
  readonly name: "";
234
- readonly type: "uint256";
235
- readonly internalType: "uint256";
426
+ readonly type: "bool";
427
+ readonly internalType: "bool";
428
+ }];
429
+ readonly stateMutability: "nonpayable";
430
+ }, {
431
+ readonly type: "function";
432
+ readonly name: "status";
433
+ readonly inputs: readonly [];
434
+ readonly outputs: readonly [{
435
+ readonly name: "";
436
+ readonly type: "tuple";
437
+ readonly internalType: "struct Status";
438
+ readonly components: readonly [{
439
+ readonly name: "flags";
440
+ readonly type: "uint32";
441
+ readonly internalType: "uint32";
442
+ }, {
443
+ readonly name: "state";
444
+ readonly type: "uint8";
445
+ readonly internalType: "enum State";
446
+ }];
236
447
  }];
237
448
  readonly stateMutability: "view";
238
449
  }, {
239
450
  readonly type: "function";
240
- readonly name: "outputToken";
451
+ readonly name: "stop";
452
+ readonly inputs: readonly [];
453
+ readonly outputs: readonly [{
454
+ readonly name: "";
455
+ readonly type: "bool";
456
+ readonly internalType: "bool";
457
+ }];
458
+ readonly stateMutability: "nonpayable";
459
+ }, {
460
+ readonly type: "function";
461
+ readonly name: "stopped";
241
462
  readonly inputs: readonly [];
242
463
  readonly outputs: readonly [{
243
464
  readonly name: "";
465
+ readonly type: "bool";
466
+ readonly internalType: "bool";
467
+ }];
468
+ readonly stateMutability: "view";
469
+ }, {
470
+ readonly type: "function";
471
+ readonly name: "swap";
472
+ readonly inputs: readonly [{
473
+ readonly name: "token";
244
474
  readonly type: "address";
245
475
  readonly internalType: "address";
476
+ }, {
477
+ readonly name: "amount";
478
+ readonly type: "uint256";
479
+ readonly internalType: "uint256";
480
+ }, {
481
+ readonly name: "slip";
482
+ readonly type: "uint256";
483
+ readonly internalType: "uint256";
246
484
  }];
247
- readonly stateMutability: "view";
485
+ readonly outputs: readonly [{
486
+ readonly name: "";
487
+ readonly type: "uint256";
488
+ readonly internalType: "uint256";
489
+ }];
490
+ readonly stateMutability: "nonpayable";
248
491
  }, {
249
492
  readonly type: "function";
250
- readonly name: "outputTokenBalance";
251
- readonly inputs: readonly [];
493
+ readonly name: "tokenBalance";
494
+ readonly inputs: readonly [{
495
+ readonly name: "token";
496
+ readonly type: "address";
497
+ readonly internalType: "address";
498
+ }];
252
499
  readonly outputs: readonly [{
253
500
  readonly name: "";
254
501
  readonly type: "uint256";
@@ -259,6 +506,10 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
259
506
  readonly type: "function";
260
507
  readonly name: "totals";
261
508
  readonly inputs: readonly [{
509
+ readonly name: "user";
510
+ readonly type: "address";
511
+ readonly internalType: "address";
512
+ }, {
262
513
  readonly name: "token";
263
514
  readonly type: "address";
264
515
  readonly internalType: "address";
@@ -290,10 +541,6 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
290
541
  readonly type: "function";
291
542
  readonly name: "totals";
292
543
  readonly inputs: readonly [{
293
- readonly name: "user";
294
- readonly type: "address";
295
- readonly internalType: "address";
296
- }, {
297
544
  readonly name: "token";
298
545
  readonly type: "address";
299
546
  readonly internalType: "address";
@@ -363,18 +610,104 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
363
610
  readonly stateMutability: "nonpayable";
364
611
  }, {
365
612
  readonly type: "function";
366
- readonly name: "setBps";
613
+ readonly name: "transferOwnership";
367
614
  readonly inputs: readonly [{
368
- readonly name: "points";
615
+ readonly name: "newOwner";
616
+ readonly type: "address";
617
+ readonly internalType: "address";
618
+ }];
619
+ readonly outputs: readonly [];
620
+ readonly stateMutability: "payable";
621
+ }, {
622
+ readonly type: "event";
623
+ readonly name: "BpsUpdated";
624
+ readonly inputs: readonly [{
625
+ readonly name: "prev";
626
+ readonly type: "uint256";
627
+ readonly indexed: false;
628
+ readonly internalType: "uint256";
629
+ }, {
630
+ readonly name: "next";
369
631
  readonly type: "uint256";
632
+ readonly indexed: false;
370
633
  readonly internalType: "uint256";
371
634
  }];
372
- readonly outputs: readonly [{
373
- readonly name: "";
635
+ readonly anonymous: false;
636
+ }, {
637
+ readonly type: "event";
638
+ readonly name: "InputTokenUpdated";
639
+ readonly inputs: readonly [{
640
+ readonly name: "token";
641
+ readonly type: "address";
642
+ readonly indexed: true;
643
+ readonly internalType: "address";
644
+ }, {
645
+ readonly name: "prev";
374
646
  readonly type: "bool";
647
+ readonly indexed: false;
648
+ readonly internalType: "bool";
649
+ }, {
650
+ readonly name: "next";
651
+ readonly type: "bool";
652
+ readonly indexed: false;
375
653
  readonly internalType: "bool";
376
654
  }];
377
- readonly stateMutability: "nonpayable";
655
+ readonly anonymous: false;
656
+ }, {
657
+ readonly type: "event";
658
+ readonly name: "OwnershipHandoverCanceled";
659
+ readonly inputs: readonly [{
660
+ readonly name: "pendingOwner";
661
+ readonly type: "address";
662
+ readonly indexed: true;
663
+ readonly internalType: "address";
664
+ }];
665
+ readonly anonymous: false;
666
+ }, {
667
+ readonly type: "event";
668
+ readonly name: "OwnershipHandoverRequested";
669
+ readonly inputs: readonly [{
670
+ readonly name: "pendingOwner";
671
+ readonly type: "address";
672
+ readonly indexed: true;
673
+ readonly internalType: "address";
674
+ }];
675
+ readonly anonymous: false;
676
+ }, {
677
+ readonly type: "event";
678
+ readonly name: "OwnershipTransferred";
679
+ readonly inputs: readonly [{
680
+ readonly name: "oldOwner";
681
+ readonly type: "address";
682
+ readonly indexed: true;
683
+ readonly internalType: "address";
684
+ }, {
685
+ readonly name: "newOwner";
686
+ readonly type: "address";
687
+ readonly indexed: true;
688
+ readonly internalType: "address";
689
+ }];
690
+ readonly anonymous: false;
691
+ }, {
692
+ readonly type: "event";
693
+ readonly name: "Paused";
694
+ readonly inputs: readonly [{
695
+ readonly name: "previous";
696
+ readonly type: "uint32";
697
+ readonly indexed: false;
698
+ readonly internalType: "uint32";
699
+ }, {
700
+ readonly name: "next";
701
+ readonly type: "uint32";
702
+ readonly indexed: false;
703
+ readonly internalType: "uint32";
704
+ }];
705
+ readonly anonymous: false;
706
+ }, {
707
+ readonly type: "event";
708
+ readonly name: "Stopped";
709
+ readonly inputs: readonly [];
710
+ readonly anonymous: false;
378
711
  }, {
379
712
  readonly type: "event";
380
713
  readonly name: "Swapped";
@@ -398,6 +731,11 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
398
731
  readonly type: "uint256";
399
732
  readonly indexed: false;
400
733
  readonly internalType: "uint256";
734
+ }, {
735
+ readonly name: "fee";
736
+ readonly type: "uint256";
737
+ readonly indexed: false;
738
+ readonly internalType: "uint256";
401
739
  }, {
402
740
  readonly name: "outputAmount";
403
741
  readonly type: "uint256";
@@ -427,16 +765,40 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
427
765
  readonly anonymous: false;
428
766
  }, {
429
767
  readonly type: "error";
430
- readonly name: "InvalidAddress";
768
+ readonly name: "AlreadyInitialized";
431
769
  readonly inputs: readonly [];
432
770
  }, {
433
771
  readonly type: "error";
434
772
  readonly name: "InsufficientAmount";
435
773
  readonly inputs: readonly [];
774
+ }, {
775
+ readonly type: "error";
776
+ readonly name: "InvalidAddress";
777
+ readonly inputs: readonly [];
436
778
  }, {
437
779
  readonly type: "error";
438
780
  readonly name: "InvalidAmount";
439
781
  readonly inputs: readonly [];
782
+ }, {
783
+ readonly type: "error";
784
+ readonly name: "IsPaused";
785
+ readonly inputs: readonly [{
786
+ readonly name: "level";
787
+ readonly type: "uint32";
788
+ readonly internalType: "uint32";
789
+ }];
790
+ }, {
791
+ readonly type: "error";
792
+ readonly name: "IsStopped";
793
+ readonly inputs: readonly [];
794
+ }, {
795
+ readonly type: "error";
796
+ readonly name: "NewOwnerIsZeroAddress";
797
+ readonly inputs: readonly [];
798
+ }, {
799
+ readonly type: "error";
800
+ readonly name: "NoHandoverRequest";
801
+ readonly inputs: readonly [];
440
802
  }, {
441
803
  readonly type: "error";
442
804
  readonly name: "SwapFailed";
@@ -449,6 +811,10 @@ declare const SUPERSTATE_SWAP_ABI: readonly [{
449
811
  readonly type: "address";
450
812
  readonly internalType: "address";
451
813
  }];
814
+ }, {
815
+ readonly type: "error";
816
+ readonly name: "Unauthorized";
817
+ readonly inputs: readonly [];
452
818
  }];
453
819
 
454
820
  /**
@@ -469,15 +835,24 @@ declare function computePrice({ inputTokenAmount, outputTokenAmount, }: SwapQuot
469
835
  declare function computeSlip(amount: BlockchainAmount, slippage: Bps): BlockchainAmount;
470
836
 
471
837
  /**
472
- * Interprets the on-chain swap availability read from `stopped()` and
473
- * `SWAP_LEVEL()`.
838
+ * The bit `Operable.paused` sets for the swap operation, mirroring the
839
+ * contract's `SWAP_LEVEL` constant.
474
840
  *
475
- * The contract tracks paused operations as a bitmask in `stopped`. The swap is
476
- * stopped when the SWAP_LEVEL flag is set:
841
+ * A constant rather than a `SWAP_LEVEL()` read: it is `constant` in the
842
+ * contract, so reading it would spend a round-trip to be told the same number
843
+ * every time.
844
+ */
845
+ declare const SWAP_LEVEL = 2;
846
+ /**
847
+ * Whether the contract will actually accept a swap right now.
477
848
  *
478
- * (stopped & SWAP_LEVEL) != 0 -> stopped (not active)
849
+ * Not the same question as "is it active". `paused` is a bitmask over
850
+ * *operations*, so a contract can suspend something unrelated and go on
851
+ * swapping; only the {@link SWAP_LEVEL} bit stops it. Reading `state ===
852
+ * 'active'` instead would refuse swaps the contract is perfectly willing to
853
+ * make.
479
854
  */
480
- declare function isStopped(status: SwapStatus): boolean;
855
+ declare function isSwapAvailable(status: SwapStatus): boolean;
481
856
 
482
857
  /**
483
858
  * Decodes the confirmed output amount from the `Swapped` event in a swap
@@ -518,8 +893,8 @@ declare const SLIPPAGE_OPTIONS_BPS: Bps[];
518
893
  /** Default slippage tolerance (0.5%). */
519
894
  declare const DEFAULT_SLIPPAGE_BPS: Bps;
520
895
  /**
521
- * The Superstate swap contract on Ethereum Sepolia, and therefore the ERC-20
522
- * spender the user approves there.
896
+ * The deployed Superstate swap contract on Ethereum Sepolia, and therefore the
897
+ * ERC-20 spender the user approves there.
523
898
  *
524
899
  * Exported in its own right for a partner driving `coinlist.superstate.execute`
525
900
  * at Level 1, where the contract is an explicit parameter.
@@ -578,6 +953,8 @@ declare const BPS_DENOM: Bps;
578
953
  */
579
954
  declare function applyBps(amount: Uint256, bps: Bps): Uint256;
580
955
 
956
+ /** The viem chain definition the SDK reads and writes this chain through. */
957
+ declare function viemChain(chain: EthereumChain): Chain;
581
958
  declare function getChainId(chain: EthereumChain): number;
582
959
  /**
583
960
  * Resolves an EIP-155 chain id to the chain the SDK names it by — the inverse
@@ -896,4 +1273,4 @@ declare const User: {
896
1273
  fromDto: (dto: UserDto) => User;
897
1274
  };
898
1275
 
899
- export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_EXPIRY_THRESHOLD_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_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isStopped, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount };
1276
+ export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, SWAP_LEVEL, SWAP_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };