@coinlist-co/react 0.12.2-rc.7b430dd → 0.12.2-rc.a59b344
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DCW7NQXH.js → chunk-4IZ2F732.js} +52 -19
- package/dist/chunk-4IZ2F732.js.map +1 -0
- package/dist/{chunk-MOE5S6CE.js → chunk-NBO5E2RO.js} +152 -6
- package/dist/chunk-NBO5E2RO.js.map +1 -0
- package/dist/{chunk-VH34YC3Q.js → chunk-UJYSXXJF.js} +168 -3
- package/dist/chunk-UJYSXXJF.js.map +1 -0
- package/dist/client/index.cjs +469 -145
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +114 -35
- package/dist/client/index.d.ts +114 -35
- package/dist/client/index.js +297 -114
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.cjs +507 -116
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +65 -41
- package/dist/server/index.d.ts +65 -41
- package/dist/server/index.js +321 -65
- package/dist/server/index.js.map +1 -1
- package/dist/time-CFocgYyl.d.cts +50 -0
- package/dist/time-DvgN98Q9.d.ts +50 -0
- package/dist/{token-registry-snapshot-BNBNuDu1.d.ts → token-registry-snapshot-BsAfBL_b.d.ts} +9 -7
- package/dist/{token-registry-snapshot-CqI6dXM_.d.cts → token-registry-snapshot-Cc_eA5zM.d.cts} +9 -7
- package/dist/{tokens-namespace-CIWBtgt2.d.cts → tokens-namespace-D_XSpiS-.d.cts} +154 -19
- package/dist/{tokens-namespace-CIWBtgt2.d.ts → tokens-namespace-D_XSpiS-.d.ts} +154 -19
- package/dist/universal/index.cjs +333 -40
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.d.cts +358 -5
- package/dist/universal/index.d.ts +358 -5
- package/dist/universal/index.js +28 -2
- package/package.json +1 -1
- package/dist/chunk-DCW7NQXH.js.map +0 -1
- package/dist/chunk-MOE5S6CE.js.map +0 -1
- package/dist/chunk-VH34YC3Q.js.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { au as PaginationParams, av as PaginatedResponse,
|
|
2
|
-
export {
|
|
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-
|
|
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-
|
|
1
|
+
import { au as PaginationParams, av as PaginatedResponse, ax as DecimalString, x as StablecoinSymbol, j as OndoBuyTransaction, B as BlockchainAmount, k as OndoSellTransaction, ab as HttpError, p as Bps, ay as SwapStatus, a1 as AssetDecimals, b as EvmContractAddress, a as EthereumChain, i as OfferSwapContract, az as Uint256, h as AssetSymbol, q as EvmWalletAddress, aA as KnownAssetSymbol, y as Erc20Asset, aB as Tx, aC as Newtype } from '../tokens-namespace-D_XSpiS-.js';
|
|
2
|
+
export { aD as AllowWalletParams, aE as AllowWalletResponse, aF as Asset, aG as AssetCode, e as AssetId, A as AuthorizationCode, aH as Blockchain, a2 as BuildOndoBuyParams, a3 as BuildOndoSellParams, aI as BuildOndoSwapParamsCore, aJ as CentrifugeVaultOffer, F as CentrifugeVaultOfferDetail, aK as Chain, as as ClientCredentialsOAuth, aL as ClientId, aw as ClientSecret, aM as CodeChallenge, C as CodeVerifier, c as CoinListTokenSaleNamespace, f as CoinListTokenSaleNamespaceImpl, aN as CoinListTokenSaleOffer, I as CoinListTokenSaleOfferDetail, u as Config, aO as ConnectExternalWalletParams, aP as CreateKycTokenParams, aQ as CreateParticipationParams, aR as CreateWalletOwnershipChallengeParams, aS as Cursor, a9 as DebugEvent, aT as DocumentFormType, Z as DocumentSubmission, aU as DocumentSubmissionStatus, aV as DocumentType, aW as ETHEREUM_CHAINS, E as Erc20Namespace, aX as Erc20NamespaceImpl, aY as FaqItem, aa as FrontlineEventId, aZ as GetOndoQuoteParams, a_ as GetOndoTradingStatusParams, a$ as GetSwapAuthorizationParams, b0 as GetSwapPreviewParams, b1 as GetTokenAllowanceParams, b2 as GetTokenBalanceParams, b3 as HexEncodedTransactionData, ac as HttpResponse, b4 as Isin, b5 as Iso2CountryCode, Y as KycLevelName, ad as KycToken, b6 as Link, b7 as ListOptionAddressesParams, ae as LogBinding, af as LogBindings, ag as LogCause, ah as LogLevel, ai as LogScope, aj as LogValue, L as Logger, b8 as MAX_ASSET_DECIMALS, b9 as MAX_UINT_256, ba as Milestone, v as OAuthAccessToken, bb as OAuthRefreshToken, ar as OAuthSession, K as Offer, bc as OfferBase, z as OfferDetail, bd as OfferDetailBase, be as OfferEditorial, O as OfferId, bf as OfferOption, V as OfferOptionAddress, a7 as OfferOptionAddressId, d as OfferOptionId, bg as OfferOptionSlug, bh as OfferSlug, bi as OfferToken, G as OfferType, bj as OfferVaultContract, w as OffersNamespace, bk as OffersNamespaceImpl, g as OndoNamespace, n as OndoNamespaceImpl, a4 as OndoQuote, bl as OndoQuoteDuration, a5 as OndoQuoteSize, bm as OndoSellOutcome, bn as OndoSwapOffer, H as OndoSwapOfferDetail, l as OndoSwapTransactionCore, a0 as OndoTradingStatus, m as OrderBookSide, bo as PKCEState, bp as PaginatedResponseDto, P as Participation, bq as ParticipationId, br as ParticipationStatus, bs as ParticipationsPaginationParams, bt as PauseFlags, bu as Pii, bv as PiiAddress, bw as PiiJurisdiction, bx as PiiKind, $ as PinoLoggerOptions, ak as ProductionLogLevel, by as QueryParamValue, bz as QueryParamValues, al as RedactedWalletError, bA as RedirectUri, bB as RemoveOptionAddressParams, am as RequestId, s as Requirement, bC as RequirementActionNeededReason, X as RequirementId, M as RequirementStatusInfo, Q as RequirementStatusValue, N as RequirementType, R as RequirementsNamespace, t as RequirementsNamespaceImpl, bD as RpcConfig, an as RpcFailureReason, bE as SOLANA_CHAINS, bF as STABLE_DECIMALS, ao as SafeEvent, ap as SafeFields, bG as SolanaChain, bH as SubmitDocumentParams, S as SuperstateSwapNamespace, r as SuperstateSwapNamespaceImpl, bI as SuperstateSwapOffer, J as SuperstateSwapOfferDetail, bJ as SwapContractRef, bK as SwapPreview, bL as TermItem, bM as Ticker, a6 as TokenIdentifier, a8 as TokenLogo, bN as TokenLogoImage, bO as TokenLogoUrl, D as TokenMetadata, bP as TokenRole, T as TokensNamespace, bQ as TokensNamespaceImpl, aq as UnredactedFields, bR as WalletAddress, _ as WalletChallengeType, W as WalletError, bS as WalletOwnershipChallenge, bT as WalletProtocol, o as WalletsNamespace, bU as WalletsNamespaceImpl, bV as apiErrorCode, bW as assertUint256, bX as isChain, bY as isOfferType, bZ as parseUint256 } from '../tokens-namespace-D_XSpiS-.js';
|
|
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-BsAfBL_b.js';
|
|
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-BsAfBL_b.js';
|
|
5
5
|
import { TransactionReceipt, Hash, Chain } from 'viem';
|
|
6
|
+
export { E as EpochMillis, M as Millis, S as Seconds, i as isExpired } from '../time-DvgN98Q9.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Walks every page of a cursor-paginated endpoint and returns the flattened
|
|
@@ -129,6 +130,26 @@ declare function computeOndoSellPrice(transaction: OndoSellTransaction): Blockch
|
|
|
129
130
|
/** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
|
|
130
131
|
declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
|
|
131
132
|
|
|
133
|
+
/**
|
|
134
|
+
* The CoinList API's error code for an Ondo quote refused because the asset
|
|
135
|
+
* cannot be traded right now: the market is closed or paused, or the asset is
|
|
136
|
+
* paused or closed for the session. It arrives on a 409.
|
|
137
|
+
*
|
|
138
|
+
* One code for all four of Ondo's reasons, because the remedy is the same:
|
|
139
|
+
* wait for the market to open. Ondo pauses for a moment at every US session
|
|
140
|
+
* change (04:00 and 16:00 ET), so a poll can land on one even while
|
|
141
|
+
* `getTradingStatus` reported the asset tradable a second earlier.
|
|
142
|
+
*/
|
|
143
|
+
declare const ONDO_NOT_TRADABLE_CODE = "not_tradable";
|
|
144
|
+
/**
|
|
145
|
+
* Whether `error` is the CoinList API refusing an Ondo quote because the
|
|
146
|
+
* market is not open, as opposed to a request that failed.
|
|
147
|
+
*
|
|
148
|
+
* Total: anything that is not an `HttpError` carrying
|
|
149
|
+
* {@link ONDO_NOT_TRADABLE_CODE} is `false`.
|
|
150
|
+
*/
|
|
151
|
+
declare function isOndoNotTradableError(error: unknown): error is HttpError;
|
|
152
|
+
|
|
132
153
|
/**
|
|
133
154
|
* The Superstate swap contract's ABI, generated verbatim from the shared
|
|
134
155
|
* `TokenSwap` base contract:
|
|
@@ -1122,6 +1143,13 @@ declare const ERC20_ABI: readonly [{
|
|
|
1122
1143
|
declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
|
|
1123
1144
|
type FormatAmountOptions = {
|
|
1124
1145
|
maxFractionDigits?: AssetDecimals;
|
|
1146
|
+
/**
|
|
1147
|
+
* Trailing zeros are kept down to this many places. Defaults to
|
|
1148
|
+
* `maxFractionDigits` when that is set, otherwise 2 (or the token's own
|
|
1149
|
+
* decimals, when fewer). A figure that wants a cap and a shorter floor —
|
|
1150
|
+
* a share headline — passes both.
|
|
1151
|
+
*/
|
|
1152
|
+
minFractionDigits?: AssetDecimals;
|
|
1125
1153
|
};
|
|
1126
1154
|
declare function formatAmount(amount: BlockchainAmount, locale: string, options?: FormatAmountOptions): FormattedAmountUi;
|
|
1127
1155
|
declare function formatRawAmount(amount: BlockchainAmount): string;
|
|
@@ -1137,6 +1165,16 @@ declare function usdAmount(amount: FormattedAmountUi): FormattedAmountAssetUi;
|
|
|
1137
1165
|
declare function assetAmount(amount: FormattedAmountUi, symbol: AssetSymbol): FormattedAmountAssetUi;
|
|
1138
1166
|
/** Placeholder shown when an amount is unavailable (e.g. a loading quote). */
|
|
1139
1167
|
declare const NA_AMOUNT_ASSET_UI: FormattedAmountAssetUi;
|
|
1168
|
+
/**
|
|
1169
|
+
* A share quantity for a headline: at most 6 decimal places, at least 2, with
|
|
1170
|
+
* the zeros between those dropped.
|
|
1171
|
+
*
|
|
1172
|
+
* An 18-decimal fill (`0.002689383776381483`) otherwise takes the whole
|
|
1173
|
+
* confirmation row and the fund name collapses to an ellipsis. Places past 6
|
|
1174
|
+
* are dust at share scale. The chain amount is unchanged, and the transaction
|
|
1175
|
+
* link still carries the exact figure.
|
|
1176
|
+
*/
|
|
1177
|
+
declare function formatShareAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
|
|
1140
1178
|
/**
|
|
1141
1179
|
* Formats a USD amount capped at 2 fractional digits, falling back to the
|
|
1142
1180
|
* {@link NA_AMOUNT_ASSET_UI} placeholder when the amount is absent.
|
|
@@ -1256,6 +1294,321 @@ declare class MathError extends Error {
|
|
|
1256
1294
|
constructor(message: string);
|
|
1257
1295
|
}
|
|
1258
1296
|
|
|
1297
|
+
/**
|
|
1298
|
+
* Wire shapes for frontline's `/v1/centrifuge/vault/*` endpoints, as published
|
|
1299
|
+
* in frontline's OpenAPI schema (ENG-1936). Every uint256 crosses as a decimal
|
|
1300
|
+
* string, every price as a decimal string, every timestamp as ISO 8601.
|
|
1301
|
+
*
|
|
1302
|
+
* **A vault deposit does not settle in the transaction that places it.** The
|
|
1303
|
+
* fund fulfils requests on its own epoch, in whole or in part, at a price set
|
|
1304
|
+
* then, and the user claims the resulting shares in a second transaction. So
|
|
1305
|
+
* every share figure before a fill is an estimate.
|
|
1306
|
+
*
|
|
1307
|
+
* The three GETs are free to poll. The two POSTs return calldata to broadcast:
|
|
1308
|
+
* `buy` is signed for one wallet and called once on confirmation, `claim`
|
|
1309
|
+
* collects everything claimable and carries no amount.
|
|
1310
|
+
*/
|
|
1311
|
+
/**
|
|
1312
|
+
* Why a deposit cannot be placed right now. A closed set, so a client can
|
|
1313
|
+
* branch on every value. `vault_unlinked` is terminal for the offer's proxy on
|
|
1314
|
+
* that chain; the rest clear on their own or by hand.
|
|
1315
|
+
*
|
|
1316
|
+
* `below_minimum` is the one reason that depends on an amount, so only a quote
|
|
1317
|
+
* can report it - see {@link CentrifugeVaultReasonDto}.
|
|
1318
|
+
*/
|
|
1319
|
+
type CentrifugeOrderReasonDto = 'vault_unlinked' | 'vault_halted' | 'proxy_not_permissioned' | 'price_unavailable' | 'below_minimum';
|
|
1320
|
+
/** What a vault status can report: every reason but the amount-dependent one. */
|
|
1321
|
+
type CentrifugeVaultReasonDto = Exclude<CentrifugeOrderReasonDto, 'below_minimum'>;
|
|
1322
|
+
/**
|
|
1323
|
+
* Where a wallet stands on a vault, derived from its amounts rather than
|
|
1324
|
+
* stored. Not a lifecycle: a new request moves any of these back to `pending`
|
|
1325
|
+
* while earlier shares stay claimed.
|
|
1326
|
+
*/
|
|
1327
|
+
type CentrifugePositionStatusDto = 'none' | 'pending' | 'partially_filled' | 'filled' | 'claimed';
|
|
1328
|
+
/** `GET /v1/centrifuge/vault/quote?symbol&chain&amount`. Indicative only. */
|
|
1329
|
+
type CentrifugeVaultQuoteDto = {
|
|
1330
|
+
object: 'centrifuge_vault_quote';
|
|
1331
|
+
/** The vault's share token symbol, e.g. `deJTRSY`. */
|
|
1332
|
+
symbol: string;
|
|
1333
|
+
chain: string;
|
|
1334
|
+
/** The amount priced, echoed back, in `spend_input_decimals`. No fee. */
|
|
1335
|
+
spend_input_amount: string;
|
|
1336
|
+
spend_input_decimals: number;
|
|
1337
|
+
/** An estimate, not a floor: the fill can price either side of it. */
|
|
1338
|
+
estimated_shares: string;
|
|
1339
|
+
share_decimals: number;
|
|
1340
|
+
/** Funding token per whole share. Null when the vault has no price. */
|
|
1341
|
+
indicative_price: string | null;
|
|
1342
|
+
/** In `spend_input_decimals`. Null when the offer sets no minimum. */
|
|
1343
|
+
minimum_input_amount: string | null;
|
|
1344
|
+
can_order: boolean;
|
|
1345
|
+
/** Empty exactly when `can_order` is true. */
|
|
1346
|
+
reasons: CentrifugeOrderReasonDto[];
|
|
1347
|
+
};
|
|
1348
|
+
/**
|
|
1349
|
+
* `GET /v1/centrifuge/vault/status?symbol&chain`. The vault's own state, read
|
|
1350
|
+
* from the chain on every call; the gate to poll, because Centrifuge announces
|
|
1351
|
+
* none of these changes.
|
|
1352
|
+
*/
|
|
1353
|
+
type CentrifugeVaultStatusDto = {
|
|
1354
|
+
object: 'centrifuge_vault_status';
|
|
1355
|
+
symbol: string;
|
|
1356
|
+
chain: string;
|
|
1357
|
+
/** Centrifuge's vault, read from the proxy. Fixed for the proxy's life. */
|
|
1358
|
+
vault_address: string;
|
|
1359
|
+
/** False is terminal for this proxy: a replacement has to be deployed. */
|
|
1360
|
+
linked: boolean;
|
|
1361
|
+
/** Whether the proxy is on the share token's memberlist. */
|
|
1362
|
+
permissioned: boolean;
|
|
1363
|
+
membership_valid_until: string | null;
|
|
1364
|
+
/** Set by the proxy after a force-cancel; cleared only by hand. */
|
|
1365
|
+
halted: boolean;
|
|
1366
|
+
price_updated_at: string | null;
|
|
1367
|
+
can_order: boolean;
|
|
1368
|
+
reasons: CentrifugeVaultReasonDto[];
|
|
1369
|
+
as_of: string;
|
|
1370
|
+
};
|
|
1371
|
+
/**
|
|
1372
|
+
* What both POSTs return: calldata for the wallet to broadcast verbatim.
|
|
1373
|
+
* Unlike Ondo's, `expires_at` is nullable - a claim carries no signature, so
|
|
1374
|
+
* it is always null there.
|
|
1375
|
+
*/
|
|
1376
|
+
type CentrifugeBroadcastDto = {
|
|
1377
|
+
action: 'broadcast_transaction';
|
|
1378
|
+
/** The offer's proxy on the chain. Lower case: compare case-insensitively. */
|
|
1379
|
+
to: string;
|
|
1380
|
+
data: string;
|
|
1381
|
+
expires_at: string | null;
|
|
1382
|
+
};
|
|
1383
|
+
/**
|
|
1384
|
+
* `POST /v1/centrifuge/vault/buy` with `{ symbol, chain, wallet_address,
|
|
1385
|
+
* amount }`. Broadcasting it places a request in the vault's queue and buys
|
|
1386
|
+
* nothing yet.
|
|
1387
|
+
*/
|
|
1388
|
+
type CentrifugeVaultBuyDto = CentrifugeBroadcastDto & {
|
|
1389
|
+
/** Exactly what the approval has to cover: no fee comes off it. */
|
|
1390
|
+
spend_input_amount: string;
|
|
1391
|
+
spend_input_decimals: number;
|
|
1392
|
+
/** Not a quantity purchased: the fill prices later. */
|
|
1393
|
+
estimated_shares: string;
|
|
1394
|
+
share_decimals: number;
|
|
1395
|
+
};
|
|
1396
|
+
/**
|
|
1397
|
+
* `GET /v1/centrifuge/vault/position?symbol&chain&wallet_address`. The six
|
|
1398
|
+
* amounts are independent: a wallet can hold a pending request, a claimable
|
|
1399
|
+
* balance and claimed shares at once. There is no per-fulfilment breakdown;
|
|
1400
|
+
* settlement pools every fulfilment into one rate.
|
|
1401
|
+
*/
|
|
1402
|
+
type CentrifugeVaultPositionDto = {
|
|
1403
|
+
object: 'centrifuge_vault_position';
|
|
1404
|
+
symbol: string;
|
|
1405
|
+
chain: string;
|
|
1406
|
+
wallet_address: string;
|
|
1407
|
+
status: CentrifugePositionStatusDto;
|
|
1408
|
+
/** Funding token ever requested, in `asset_decimals`. */
|
|
1409
|
+
requested: string;
|
|
1410
|
+
/** Of that, still queued. */
|
|
1411
|
+
pending: string;
|
|
1412
|
+
/** Of that, fulfilled. */
|
|
1413
|
+
filled_assets: string;
|
|
1414
|
+
/** Shares the fulfilments earned, in `share_decimals`. Held by the proxy until claimed. */
|
|
1415
|
+
earned_shares: string;
|
|
1416
|
+
claimed_shares: string;
|
|
1417
|
+
/** Non-zero means the claim endpoint will return calldata. */
|
|
1418
|
+
claimable_shares: string;
|
|
1419
|
+
/** Read from the share token; can exceed `claimed_shares`. */
|
|
1420
|
+
share_balance: string;
|
|
1421
|
+
asset_decimals: number;
|
|
1422
|
+
share_decimals: number;
|
|
1423
|
+
/** Null before the first claim. */
|
|
1424
|
+
average_price: string | null;
|
|
1425
|
+
/** Centrifuge froze the wallet on the share token; blocks claiming. */
|
|
1426
|
+
frozen: boolean;
|
|
1427
|
+
as_of: string;
|
|
1428
|
+
};
|
|
1429
|
+
/**
|
|
1430
|
+
* `POST /v1/centrifuge/vault/claim` with `{ symbol, chain, wallet_address }`.
|
|
1431
|
+
* The wallet named must be the one that broadcasts: the proxy credits the
|
|
1432
|
+
* sender.
|
|
1433
|
+
*/
|
|
1434
|
+
type CentrifugeVaultClaimDto = CentrifugeBroadcastDto & {
|
|
1435
|
+
/** A floor: a fill landing before the broadcast raises it. */
|
|
1436
|
+
claimable_shares: string;
|
|
1437
|
+
share_decimals: number;
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* Why a deposit cannot be placed on a vault right now. Kept verbatim from the
|
|
1442
|
+
* wire: frontline publishes it as a closed set for clients to branch on.
|
|
1443
|
+
*/
|
|
1444
|
+
type CentrifugeOrderReason = CentrifugeOrderReasonDto;
|
|
1445
|
+
/** The reasons a vault status can report - all but `below_minimum`. */
|
|
1446
|
+
type CentrifugeVaultReason = CentrifugeVaultReasonDto;
|
|
1447
|
+
/**
|
|
1448
|
+
* Where a wallet stands on a vault. Not a lifecycle - see
|
|
1449
|
+
* {@link CentrifugeVaultPosition.status}.
|
|
1450
|
+
*/
|
|
1451
|
+
type CentrifugePositionStatus = CentrifugePositionStatusDto;
|
|
1452
|
+
/**
|
|
1453
|
+
* Whether a deposit can be placed, as one union rather than the wire's
|
|
1454
|
+
* `can_order` beside `reasons`: a blocked answer always says why, and an
|
|
1455
|
+
* orderable one has nothing to say. The wire pair can contradict itself; this
|
|
1456
|
+
* cannot, because `fromDto` refuses the payloads that do.
|
|
1457
|
+
*/
|
|
1458
|
+
type CentrifugeOrderability<R extends CentrifugeOrderReason> = {
|
|
1459
|
+
type: 'orderable';
|
|
1460
|
+
} | {
|
|
1461
|
+
type: 'blocked';
|
|
1462
|
+
reasons: [R, ...R[]];
|
|
1463
|
+
};
|
|
1464
|
+
/**
|
|
1465
|
+
* What a deposit of a given size would buy, and whether it can be placed.
|
|
1466
|
+
*
|
|
1467
|
+
* **Indicative only.** The price is read from the vault now and the fund
|
|
1468
|
+
* prices the fulfilment on its own epoch, so neither {@link indicativePrice}
|
|
1469
|
+
* nor {@link estimatedShares} is a commitment. Free to poll while the user
|
|
1470
|
+
* sizes a deposit.
|
|
1471
|
+
*/
|
|
1472
|
+
type CentrifugeVaultQuote = {
|
|
1473
|
+
chain: EthereumChain;
|
|
1474
|
+
/** The vault's share token symbol, e.g. `deJTRSY`. */
|
|
1475
|
+
symbol: AssetSymbol;
|
|
1476
|
+
/** The amount priced, in the funding token's decimals. No fee is taken. */
|
|
1477
|
+
spendInputAmount: BlockchainAmount;
|
|
1478
|
+
/** Shares at the indicative price, in the share token's decimals. */
|
|
1479
|
+
estimatedShares: BlockchainAmount;
|
|
1480
|
+
/** Funding token per whole share. Null when the vault publishes no price. */
|
|
1481
|
+
indicativePrice: DecimalString | null;
|
|
1482
|
+
/** Null when the offer sets no minimum. Same decimals as the spend. */
|
|
1483
|
+
minimumInputAmount: BlockchainAmount | null;
|
|
1484
|
+
orderability: CentrifugeOrderability<CentrifugeOrderReason>;
|
|
1485
|
+
};
|
|
1486
|
+
declare const CentrifugeVaultQuote: {
|
|
1487
|
+
fromDto: (dto: CentrifugeVaultQuoteDto) => CentrifugeVaultQuote;
|
|
1488
|
+
};
|
|
1489
|
+
/**
|
|
1490
|
+
* A vault's own state, independent of any wallet or amount: the gate to poll.
|
|
1491
|
+
* Centrifuge announces none of these changes, and an unlinked vault leaves the
|
|
1492
|
+
* offer's proxy permanently dead, so a cached answer goes wrong silently.
|
|
1493
|
+
*/
|
|
1494
|
+
type CentrifugeVaultStatus = {
|
|
1495
|
+
chain: EthereumChain;
|
|
1496
|
+
symbol: AssetSymbol;
|
|
1497
|
+
/** Centrifuge's vault behind the proxy. Fixed for the proxy's life. */
|
|
1498
|
+
vaultAddress: EvmContractAddress;
|
|
1499
|
+
/**
|
|
1500
|
+
* Whether Centrifuge still links the vault to its pool. False is terminal
|
|
1501
|
+
* for this proxy: no request or claim succeeds until a new one is deployed.
|
|
1502
|
+
*/
|
|
1503
|
+
linked: boolean;
|
|
1504
|
+
/**
|
|
1505
|
+
* Whether the proxy is on the share token's memberlist. It holds shares for
|
|
1506
|
+
* every wallet, so one expired entry stops the whole offer.
|
|
1507
|
+
*/
|
|
1508
|
+
permissioned: boolean;
|
|
1509
|
+
/** Watch it: {@link permissioned} goes false the moment it passes. */
|
|
1510
|
+
membershipValidUntil: Date | null;
|
|
1511
|
+
/** The proxy halted itself after a force-cancel; cleared only by hand. */
|
|
1512
|
+
halted: boolean;
|
|
1513
|
+
/** A stale value is the signal that a quote's price is old. */
|
|
1514
|
+
priceUpdatedAt: Date | null;
|
|
1515
|
+
orderability: CentrifugeOrderability<CentrifugeVaultReason>;
|
|
1516
|
+
/** When the chain was read: how old everything above is. */
|
|
1517
|
+
asOf: Date;
|
|
1518
|
+
};
|
|
1519
|
+
declare const CentrifugeVaultStatus: {
|
|
1520
|
+
fromDto: (dto: CentrifugeVaultStatusDto) => CentrifugeVaultStatus;
|
|
1521
|
+
};
|
|
1522
|
+
/**
|
|
1523
|
+
* What both vault transactions share: calldata to broadcast verbatim, and the
|
|
1524
|
+
* deadline on it.
|
|
1525
|
+
*/
|
|
1526
|
+
type CentrifugeVaultTransactionCore = {
|
|
1527
|
+
/** The `to` is the offer's proxy: the spender the deposit was approved to. */
|
|
1528
|
+
tx: Tx;
|
|
1529
|
+
/**
|
|
1530
|
+
* When the calldata stops being accepted, or null when it carries no
|
|
1531
|
+
* deadline - always the case for a claim, which nobody signs.
|
|
1532
|
+
*/
|
|
1533
|
+
expiresAt: Date | null;
|
|
1534
|
+
};
|
|
1535
|
+
/**
|
|
1536
|
+
* A signed deposit request, ready to broadcast.
|
|
1537
|
+
*
|
|
1538
|
+
* **Broadcasting it buys nothing yet.** It places a request in the vault's
|
|
1539
|
+
* queue; the fund fulfils it later at a price set then, and the user comes
|
|
1540
|
+
* back to claim. {@link estimatedShares} is therefore never a quantity
|
|
1541
|
+
* purchased. Single-use: built once on confirmation, never on a timer.
|
|
1542
|
+
*/
|
|
1543
|
+
type CentrifugeVaultBuyTransaction = CentrifugeVaultTransactionCore & {
|
|
1544
|
+
/** Exactly what the approval has to cover: no fee comes off it. */
|
|
1545
|
+
spendInputAmount: BlockchainAmount;
|
|
1546
|
+
/** At the price read when the calldata was built. An estimate, not a floor. */
|
|
1547
|
+
estimatedShares: BlockchainAmount;
|
|
1548
|
+
};
|
|
1549
|
+
declare const CentrifugeVaultBuyTransaction: {
|
|
1550
|
+
fromDto: (dto: CentrifugeVaultBuyDto) => CentrifugeVaultBuyTransaction;
|
|
1551
|
+
};
|
|
1552
|
+
/**
|
|
1553
|
+
* The claim that moves fulfilled shares from the proxy to the wallet: the
|
|
1554
|
+
* second transaction every vault purchase needs. The wallet that broadcasts it
|
|
1555
|
+
* is the one credited.
|
|
1556
|
+
*/
|
|
1557
|
+
type CentrifugeVaultClaimTransaction = CentrifugeVaultTransactionCore & {
|
|
1558
|
+
/**
|
|
1559
|
+
* Read when the calldata was built. A floor: a fill landing before the
|
|
1560
|
+
* broadcast raises it, and the claim still collects everything.
|
|
1561
|
+
*/
|
|
1562
|
+
claimableShares: BlockchainAmount;
|
|
1563
|
+
};
|
|
1564
|
+
declare const CentrifugeVaultClaimTransaction: {
|
|
1565
|
+
fromDto: (dto: CentrifugeVaultClaimDto) => CentrifugeVaultClaimTransaction;
|
|
1566
|
+
};
|
|
1567
|
+
/**
|
|
1568
|
+
* One wallet's standing on one vault: what it put in, what has settled, and
|
|
1569
|
+
* what it can claim. The endpoint a returning user lands on, and the one that
|
|
1570
|
+
* says whether to offer the claim.
|
|
1571
|
+
*
|
|
1572
|
+
* The amounts are independent of each other: each piece of a request settles
|
|
1573
|
+
* and is claimed on its own, so a wallet can be pending, claimable and claimed
|
|
1574
|
+
* at once. There is no per-fulfilment breakdown; settlement pools every
|
|
1575
|
+
* fulfilment into one {@link averagePrice}.
|
|
1576
|
+
*/
|
|
1577
|
+
type CentrifugeVaultPosition = {
|
|
1578
|
+
chain: EthereumChain;
|
|
1579
|
+
symbol: AssetSymbol;
|
|
1580
|
+
walletAddress: EvmWalletAddress;
|
|
1581
|
+
/**
|
|
1582
|
+
* Derived by frontline from the amounts. Not a lifecycle: a new request
|
|
1583
|
+
* moves it back to `pending` while earlier shares stay claimed.
|
|
1584
|
+
*/
|
|
1585
|
+
status: CentrifugePositionStatus;
|
|
1586
|
+
/** Funding token ever requested. */
|
|
1587
|
+
requested: BlockchainAmount;
|
|
1588
|
+
/** Of {@link requested}, what is still queued. */
|
|
1589
|
+
pending: BlockchainAmount;
|
|
1590
|
+
/** Of {@link requested}, what has been fulfilled. */
|
|
1591
|
+
filledAssets: BlockchainAmount;
|
|
1592
|
+
/** Shares the fulfilments earned. Held by the proxy until claimed. */
|
|
1593
|
+
earnedShares: BlockchainAmount;
|
|
1594
|
+
claimedShares: BlockchainAmount;
|
|
1595
|
+
/** Non-zero means a claim will return calldata. */
|
|
1596
|
+
claimableShares: BlockchainAmount;
|
|
1597
|
+
/**
|
|
1598
|
+
* What the wallet holds on the share token. Can exceed
|
|
1599
|
+
* {@link claimedShares}: shares acquired any other way count here.
|
|
1600
|
+
*/
|
|
1601
|
+
shareBalance: BlockchainAmount;
|
|
1602
|
+
/** Pooled rate over everything claimed. Null before the first claim. */
|
|
1603
|
+
averagePrice: DecimalString | null;
|
|
1604
|
+
/** Centrifuge froze this wallet on the share token. Blocks claiming. */
|
|
1605
|
+
frozen: boolean;
|
|
1606
|
+
asOf: Date;
|
|
1607
|
+
};
|
|
1608
|
+
declare const CentrifugeVaultPosition: {
|
|
1609
|
+
fromDto: (dto: CentrifugeVaultPositionDto) => CentrifugeVaultPosition;
|
|
1610
|
+
};
|
|
1611
|
+
|
|
1259
1612
|
type UserDto = {
|
|
1260
1613
|
id: string;
|
|
1261
1614
|
email: string;
|
|
@@ -1273,4 +1626,4 @@ declare const User: {
|
|
|
1273
1626
|
fromDto: (dto: UserDto) => User;
|
|
1274
1627
|
};
|
|
1275
1628
|
|
|
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 };
|
|
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 };
|
package/dist/universal/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AuthorizationCode,
|
|
3
3
|
BPS_DENOM,
|
|
4
|
+
CentrifugeVaultBuyTransaction,
|
|
5
|
+
CentrifugeVaultClaimTransaction,
|
|
6
|
+
CentrifugeVaultPosition,
|
|
7
|
+
CentrifugeVaultQuote,
|
|
8
|
+
CentrifugeVaultStatus,
|
|
4
9
|
ClientId,
|
|
5
10
|
ClientSecret,
|
|
6
11
|
CodeChallenge,
|
|
@@ -9,6 +14,7 @@ import {
|
|
|
9
14
|
DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE,
|
|
10
15
|
DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE,
|
|
11
16
|
DEFAULT_SLIPPAGE_BPS,
|
|
17
|
+
ONDO_NOT_TRADABLE_CODE,
|
|
12
18
|
ONDO_POLL_INTERVAL_MS,
|
|
13
19
|
ONDO_QUOTE_MAX_TTL_MS,
|
|
14
20
|
ONDO_SETTLEMENT_ASSET,
|
|
@@ -41,12 +47,13 @@ import {
|
|
|
41
47
|
decodeSwappedOutputAmount,
|
|
42
48
|
formattedPricePerShare,
|
|
43
49
|
generatePKCEParams,
|
|
50
|
+
isOndoNotTradableError,
|
|
44
51
|
isSwapAvailable,
|
|
45
52
|
offerDisplayTokens,
|
|
46
53
|
ondoQuoteOfferDeadline,
|
|
47
54
|
superstateSwapContractAddress,
|
|
48
55
|
swapSpender
|
|
49
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-UJYSXXJF.js";
|
|
50
57
|
import {
|
|
51
58
|
AllowWalletResponse,
|
|
52
59
|
Asset,
|
|
@@ -69,6 +76,7 @@ import {
|
|
|
69
76
|
DocumentSubmission,
|
|
70
77
|
ERC20_ABI,
|
|
71
78
|
ETHEREUM_CHAINS,
|
|
79
|
+
EpochMillis,
|
|
72
80
|
Erc20NamespaceImpl,
|
|
73
81
|
EthereumChain,
|
|
74
82
|
EvmContractAddress,
|
|
@@ -89,6 +97,7 @@ import {
|
|
|
89
97
|
MAX_UINT_256,
|
|
90
98
|
MathError,
|
|
91
99
|
Milestone,
|
|
100
|
+
Millis,
|
|
92
101
|
NA_AMOUNT_ASSET_UI,
|
|
93
102
|
NotAuthenticatedError,
|
|
94
103
|
NotImplementedError,
|
|
@@ -106,6 +115,7 @@ import {
|
|
|
106
115
|
OfferSlug,
|
|
107
116
|
OfferSwapContract,
|
|
108
117
|
OfferToken,
|
|
118
|
+
OfferVaultContract,
|
|
109
119
|
OndoBuyTransaction,
|
|
110
120
|
OndoNamespaceImpl,
|
|
111
121
|
OndoQuote,
|
|
@@ -127,6 +137,7 @@ import {
|
|
|
127
137
|
SOLANA_CHAINS,
|
|
128
138
|
STABLE_DECIMALS,
|
|
129
139
|
SUPERSTATE_SWAP_ABI,
|
|
140
|
+
Seconds,
|
|
130
141
|
ShortenedWalletAddress,
|
|
131
142
|
SolanaChain,
|
|
132
143
|
StablecoinSymbol,
|
|
@@ -154,10 +165,12 @@ import {
|
|
|
154
165
|
formatBpsAsPercent,
|
|
155
166
|
formatCompactAmount,
|
|
156
167
|
formatRawAmount,
|
|
168
|
+
formatShareAmount,
|
|
157
169
|
formattedUsdPrice,
|
|
158
170
|
getChainId,
|
|
159
171
|
getNetworkName,
|
|
160
172
|
isChain,
|
|
173
|
+
isExpired,
|
|
161
174
|
isOfferType,
|
|
162
175
|
parseBlockchainAmount,
|
|
163
176
|
parseUint256,
|
|
@@ -165,7 +178,7 @@ import {
|
|
|
165
178
|
txExplorerUrl,
|
|
166
179
|
usdAmount,
|
|
167
180
|
viemChain
|
|
168
|
-
} from "../chunk-
|
|
181
|
+
} from "../chunk-NBO5E2RO.js";
|
|
169
182
|
export {
|
|
170
183
|
AllowWalletResponse,
|
|
171
184
|
Asset,
|
|
@@ -179,6 +192,11 @@ export {
|
|
|
179
192
|
Blockchain,
|
|
180
193
|
BlockchainAmount,
|
|
181
194
|
Bps,
|
|
195
|
+
CentrifugeVaultBuyTransaction,
|
|
196
|
+
CentrifugeVaultClaimTransaction,
|
|
197
|
+
CentrifugeVaultPosition,
|
|
198
|
+
CentrifugeVaultQuote,
|
|
199
|
+
CentrifugeVaultStatus,
|
|
182
200
|
Chain,
|
|
183
201
|
ClientCredentialsOAuth,
|
|
184
202
|
ClientId,
|
|
@@ -198,6 +216,7 @@ export {
|
|
|
198
216
|
DocumentSubmission,
|
|
199
217
|
ERC20_ABI,
|
|
200
218
|
ETHEREUM_CHAINS,
|
|
219
|
+
EpochMillis,
|
|
201
220
|
Erc20NamespaceImpl,
|
|
202
221
|
EthereumChain,
|
|
203
222
|
EvmContractAddress,
|
|
@@ -218,11 +237,13 @@ export {
|
|
|
218
237
|
MAX_UINT_256,
|
|
219
238
|
MathError,
|
|
220
239
|
Milestone,
|
|
240
|
+
Millis,
|
|
221
241
|
NA_AMOUNT_ASSET_UI,
|
|
222
242
|
NotAuthenticatedError,
|
|
223
243
|
NotImplementedError,
|
|
224
244
|
OAuthRefreshToken,
|
|
225
245
|
OAuthSession,
|
|
246
|
+
ONDO_NOT_TRADABLE_CODE,
|
|
226
247
|
ONDO_POLL_INTERVAL_MS,
|
|
227
248
|
ONDO_QUOTE_MAX_TTL_MS,
|
|
228
249
|
ONDO_SETTLEMENT_ASSET,
|
|
@@ -239,6 +260,7 @@ export {
|
|
|
239
260
|
OfferSlug,
|
|
240
261
|
OfferSwapContract,
|
|
241
262
|
OfferToken,
|
|
263
|
+
OfferVaultContract,
|
|
242
264
|
OffersNamespaceImpl,
|
|
243
265
|
OndoBuyTransaction,
|
|
244
266
|
OndoNamespaceImpl,
|
|
@@ -270,6 +292,7 @@ export {
|
|
|
270
292
|
SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA,
|
|
271
293
|
SWAP_LEVEL,
|
|
272
294
|
SWAP_POLL_INTERVAL_MS,
|
|
295
|
+
Seconds,
|
|
273
296
|
ShortenedWalletAddress,
|
|
274
297
|
SolanaChain,
|
|
275
298
|
StablecoinSymbol,
|
|
@@ -313,13 +336,16 @@ export {
|
|
|
313
336
|
formatBpsAsPercent,
|
|
314
337
|
formatCompactAmount,
|
|
315
338
|
formatRawAmount,
|
|
339
|
+
formatShareAmount,
|
|
316
340
|
formattedPricePerShare,
|
|
317
341
|
formattedUsdPrice,
|
|
318
342
|
generatePKCEParams,
|
|
319
343
|
getChainId,
|
|
320
344
|
getNetworkName,
|
|
321
345
|
isChain,
|
|
346
|
+
isExpired,
|
|
322
347
|
isOfferType,
|
|
348
|
+
isOndoNotTradableError,
|
|
323
349
|
isSwapAvailable,
|
|
324
350
|
offerDisplayTokens,
|
|
325
351
|
ondoQuoteOfferDeadline,
|