@coinlist-co/react 0.12.1-rc.14ac67e → 0.12.1-rc.a230abc
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-3ATIDGVR.js → chunk-GFLU5OMP.js} +19 -5
- package/dist/chunk-GFLU5OMP.js.map +1 -0
- package/dist/{chunk-SOMNMOBU.js → chunk-HLL7IBIS.js} +2 -2
- package/dist/{chunk-2XBPKC4C.js → chunk-RPE7XIBV.js} +2 -2
- package/dist/client/index.cjs +414 -273
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +212 -85
- package/dist/client/index.d.ts +212 -85
- package/dist/client/index.js +365 -242
- package/dist/client/index.js.map +1 -1
- package/dist/{collections-DNbBE6Pk.d.cts → collections-CAfs2Eww.d.cts} +1 -1
- package/dist/{collections-DVCh4jUp.d.ts → collections-DZZFrizd.d.ts} +1 -1
- package/dist/{config-DFYAM0GD.d.cts → config-D19ktBr0.d.cts} +19 -1
- package/dist/{config-DFYAM0GD.d.ts → config-D19ktBr0.d.ts} +19 -1
- package/dist/server/index.cjs +17 -4
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +2 -2
- package/dist/shared/index.cjs +19 -4
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +4 -4
- package/dist/shared/index.d.ts +4 -4
- package/dist/shared/index.js +4 -2
- package/package.json +1 -1
- package/dist/chunk-3ATIDGVR.js.map +0 -1
- /package/dist/{chunk-SOMNMOBU.js.map → chunk-HLL7IBIS.js.map} +0 -0
- /package/dist/{chunk-2XBPKC4C.js.map → chunk-RPE7XIBV.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aE as ClientId, bl as RedirectUri, aF as CodeChallenge, ba as PKCEState, C as CodeVerifier, r as EvmWalletAddress, a as EthereumChain, bD as Tx, B as BlockchainAmount, bu as SwapPreview, Z as AssetDecimals, aw as Newtype } from './config-D19ktBr0.cjs';
|
|
2
2
|
import { Hex, Abi, Hash, TransactionReceipt } from 'viem';
|
|
3
3
|
|
|
4
4
|
type PKCEParams = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aE as ClientId, bl as RedirectUri, aF as CodeChallenge, ba as PKCEState, C as CodeVerifier, r as EvmWalletAddress, a as EthereumChain, bD as Tx, B as BlockchainAmount, bu as SwapPreview, Z as AssetDecimals, aw as Newtype } from './config-D19ktBr0.js';
|
|
2
2
|
import { Hex, Abi, Hash, TransactionReceipt } from 'viem';
|
|
3
3
|
|
|
4
4
|
type PKCEParams = {
|
|
@@ -580,6 +580,12 @@ type SolanaChain = 'solana_mainnet' | 'solana_devnet';
|
|
|
580
580
|
* caused it.
|
|
581
581
|
*/
|
|
582
582
|
declare const SolanaChain: (value: string) => SolanaChain;
|
|
583
|
+
/**
|
|
584
|
+
* {@link Chain}'s check without the throw, for a mapper over a list that drops
|
|
585
|
+
* the entries it cannot name rather than rejecting the whole list. Frontline's
|
|
586
|
+
* chain registry may carry chains this SDK does not model yet.
|
|
587
|
+
*/
|
|
588
|
+
declare const isChain: (value: string) => value is Chain;
|
|
583
589
|
type Chain = EthereumChain | SolanaChain;
|
|
584
590
|
declare const Chain: (value: string) => Chain;
|
|
585
591
|
/**
|
|
@@ -1196,6 +1202,18 @@ type OfferToken = {
|
|
|
1196
1202
|
};
|
|
1197
1203
|
declare const OfferToken: {
|
|
1198
1204
|
fromDto: (dto: OfferTokenDto) => OfferToken;
|
|
1205
|
+
/**
|
|
1206
|
+
* Maps an offer's token list, dropping every token on a chain this SDK does
|
|
1207
|
+
* not name. Frontline's chain registry runs ahead of {@link Chain}, and a
|
|
1208
|
+
* plain `.map` would throw out of `Offer.fromDto` and, through
|
|
1209
|
+
* `PaginatedResponse.fromDto`, reject the whole offers page - which is how
|
|
1210
|
+
* one Base token blanked production's offers list. Dropping costs that
|
|
1211
|
+
* token's metadata alone: `coinlist.tokens.get` takes an `EthereumChain`,
|
|
1212
|
+
* so nobody could have looked it up anyway.
|
|
1213
|
+
*
|
|
1214
|
+
* Same shape as `TokenMetadata.fromRegistryDto`.
|
|
1215
|
+
*/
|
|
1216
|
+
listFromDto: (dtos: OfferTokenDto[]) => OfferToken[];
|
|
1199
1217
|
};
|
|
1200
1218
|
|
|
1201
1219
|
/**
|
|
@@ -2981,4 +2999,4 @@ interface Config {
|
|
|
2981
2999
|
readonly logger?: Logger;
|
|
2982
3000
|
}
|
|
2983
3001
|
|
|
2984
|
-
export {
|
|
3002
|
+
export { type BuildOndoSellParams as $, AuthorizationCode as A, BlockchainAmount as B, CodeVerifier as C, OfferDetail as D, type Erc20Namespace as E, TokenMetadata as F, type OfferType as G, Offer as H, RequirementStatusInfo as I, type RequirementType as J, type RequirementStatusValue as K, type Logger as L, OfferOptionAddress as M, RequirementId as N, OfferId as O, Participation as P, type KycLevelName as Q, type RequirementsNamespace as R, type SharedNamespaceContext as S, type TokensNamespace as T, DocumentSubmission as U, type WalletChallengeType as V, type WalletError as W, type PinoLoggerOptions as X, OndoTradingStatus as Y, AssetDecimals as Z, type BuildOndoBuyParams as _, EthereumChain as a, MAX_ASSET_DECIMALS as a$, OndoQuote as a0, type OndoQuoteSize as a1, type TokenIdentifier as a2, OfferOptionAddressId as a3, TokenLogo as a4, type DebugEvent as a5, type FrontlineEventId as a6, HttpError as a7, type HttpResponse as a8, KycToken as a9, AssetCode as aA, Blockchain as aB, type BuildOndoSwapParamsCore as aC, Chain as aD, ClientId as aE, CodeChallenge as aF, ConnectExternalWalletParams as aG, type CreateKycTokenParams as aH, CreateParticipationParams as aI, CreateWalletOwnershipChallengeParams as aJ, Cursor as aK, type DocumentFormType as aL, type DocumentSubmissionStatus as aM, type DocumentType as aN, ETHEREUM_CHAINS as aO, Erc20NamespaceImpl as aP, FaqItem as aQ, type GetOndoQuoteParams as aR, type GetOndoTradingStatusParams as aS, type GetSwapAuthorizationParams as aT, type GetSwapPreviewParams as aU, type GetTokenAllowanceParams as aV, type GetTokenBalanceParams as aW, HexEncodedTransactionData as aX, Iso2CountryCode as aY, Link as aZ, type ListOptionAddressesParams as a_, type LogBinding as aa, type LogBindings as ab, type LogCause as ac, type LogLevel as ad, type LogScope as ae, type LogValue as af, type ProductionLogLevel as ag, RedactedWalletError as ah, type RequestId as ai, type SafeEvent as aj, type SafeFields as ak, type UnredactedFields as al, OAuthSession as am, ClientCredentialsOAuth as an, ClientSecret as ao, type Sender as ap, PaginationParams as aq, PaginatedResponse as ar, type Uint256 as as, KnownAssetSymbol as at, DecimalString as au, SwapStatus as av, type Newtype as aw, type AllowWalletParams as ax, AllowWalletResponse as ay, Asset as az, EvmContractAddress as b, MAX_UINT_256 as b0, Milestone as b1, OAuthRefreshToken as b2, OfferOption as b3, OfferOptionSlug as b4, OfferSlug as b5, OfferToken as b6, OffersNamespaceImpl as b7, type OndoQuoteDuration as b8, type OndoSellOutcome as b9, TokenLogoUrl as bA, type TokenRole as bB, TokensNamespaceImpl as bC, type Tx as bD, WalletAddress as bE, WalletOwnershipChallenge as bF, type WalletProtocol as bG, WalletsNamespaceImpl as bH, apiErrorCode as bI, assertUint256 as bJ, isChain as bK, parseUint256 as bL, PKCEState as ba, type PaginatedResponseDto as bb, ParticipationId as bc, type ParticipationStatus as bd, ParticipationsPaginationParams as be, Pii as bf, PiiAddress as bg, PiiJurisdiction as bh, type PiiKind as bi, type QueryParamValue as bj, type QueryParamValues as bk, RedirectUri as bl, type RemoveOptionAddressParams as bm, type RequirementActionNeededReason as bn, SOLANA_CHAINS as bo, STABLE_DECIMALS as bp, SolanaChain as bq, type SubmitDocumentParams as br, SwapAuthorization as bs, type SwapContractRef as bt, SwapPreview as bu, TermItem as bv, Ticker as bw, TokenAllowance as bx, TokenBalance as by, type TokenLogoImage as bz, type CoinListTokenSaleNamespace as c, OfferOptionId as d, AssetId as e, CoinListTokenSaleNamespaceImpl as f, type OndoNamespace as g, AssetSymbol as h, OfferSwapContract as i, OndoBuyTransaction as j, OndoSellTransaction as k, type OndoSwapTransactionCore as l, type OrderBookSide as m, OndoNamespaceImpl as n, type SuperstateSwapNamespace as o, type WalletsNamespace as p, Bps as q, EvmWalletAddress as r, SuperstateSwapNamespaceImpl as s, Requirement as t, RequirementsNamespaceImpl as u, type Config as v, type OAuthAccessToken as w, type OffersNamespace as x, StablecoinSymbol as y, type Erc20Asset as z };
|
|
@@ -580,6 +580,12 @@ type SolanaChain = 'solana_mainnet' | 'solana_devnet';
|
|
|
580
580
|
* caused it.
|
|
581
581
|
*/
|
|
582
582
|
declare const SolanaChain: (value: string) => SolanaChain;
|
|
583
|
+
/**
|
|
584
|
+
* {@link Chain}'s check without the throw, for a mapper over a list that drops
|
|
585
|
+
* the entries it cannot name rather than rejecting the whole list. Frontline's
|
|
586
|
+
* chain registry may carry chains this SDK does not model yet.
|
|
587
|
+
*/
|
|
588
|
+
declare const isChain: (value: string) => value is Chain;
|
|
583
589
|
type Chain = EthereumChain | SolanaChain;
|
|
584
590
|
declare const Chain: (value: string) => Chain;
|
|
585
591
|
/**
|
|
@@ -1196,6 +1202,18 @@ type OfferToken = {
|
|
|
1196
1202
|
};
|
|
1197
1203
|
declare const OfferToken: {
|
|
1198
1204
|
fromDto: (dto: OfferTokenDto) => OfferToken;
|
|
1205
|
+
/**
|
|
1206
|
+
* Maps an offer's token list, dropping every token on a chain this SDK does
|
|
1207
|
+
* not name. Frontline's chain registry runs ahead of {@link Chain}, and a
|
|
1208
|
+
* plain `.map` would throw out of `Offer.fromDto` and, through
|
|
1209
|
+
* `PaginatedResponse.fromDto`, reject the whole offers page - which is how
|
|
1210
|
+
* one Base token blanked production's offers list. Dropping costs that
|
|
1211
|
+
* token's metadata alone: `coinlist.tokens.get` takes an `EthereumChain`,
|
|
1212
|
+
* so nobody could have looked it up anyway.
|
|
1213
|
+
*
|
|
1214
|
+
* Same shape as `TokenMetadata.fromRegistryDto`.
|
|
1215
|
+
*/
|
|
1216
|
+
listFromDto: (dtos: OfferTokenDto[]) => OfferToken[];
|
|
1199
1217
|
};
|
|
1200
1218
|
|
|
1201
1219
|
/**
|
|
@@ -2981,4 +2999,4 @@ interface Config {
|
|
|
2981
2999
|
readonly logger?: Logger;
|
|
2982
3000
|
}
|
|
2983
3001
|
|
|
2984
|
-
export {
|
|
3002
|
+
export { type BuildOndoSellParams as $, AuthorizationCode as A, BlockchainAmount as B, CodeVerifier as C, OfferDetail as D, type Erc20Namespace as E, TokenMetadata as F, type OfferType as G, Offer as H, RequirementStatusInfo as I, type RequirementType as J, type RequirementStatusValue as K, type Logger as L, OfferOptionAddress as M, RequirementId as N, OfferId as O, Participation as P, type KycLevelName as Q, type RequirementsNamespace as R, type SharedNamespaceContext as S, type TokensNamespace as T, DocumentSubmission as U, type WalletChallengeType as V, type WalletError as W, type PinoLoggerOptions as X, OndoTradingStatus as Y, AssetDecimals as Z, type BuildOndoBuyParams as _, EthereumChain as a, MAX_ASSET_DECIMALS as a$, OndoQuote as a0, type OndoQuoteSize as a1, type TokenIdentifier as a2, OfferOptionAddressId as a3, TokenLogo as a4, type DebugEvent as a5, type FrontlineEventId as a6, HttpError as a7, type HttpResponse as a8, KycToken as a9, AssetCode as aA, Blockchain as aB, type BuildOndoSwapParamsCore as aC, Chain as aD, ClientId as aE, CodeChallenge as aF, ConnectExternalWalletParams as aG, type CreateKycTokenParams as aH, CreateParticipationParams as aI, CreateWalletOwnershipChallengeParams as aJ, Cursor as aK, type DocumentFormType as aL, type DocumentSubmissionStatus as aM, type DocumentType as aN, ETHEREUM_CHAINS as aO, Erc20NamespaceImpl as aP, FaqItem as aQ, type GetOndoQuoteParams as aR, type GetOndoTradingStatusParams as aS, type GetSwapAuthorizationParams as aT, type GetSwapPreviewParams as aU, type GetTokenAllowanceParams as aV, type GetTokenBalanceParams as aW, HexEncodedTransactionData as aX, Iso2CountryCode as aY, Link as aZ, type ListOptionAddressesParams as a_, type LogBinding as aa, type LogBindings as ab, type LogCause as ac, type LogLevel as ad, type LogScope as ae, type LogValue as af, type ProductionLogLevel as ag, RedactedWalletError as ah, type RequestId as ai, type SafeEvent as aj, type SafeFields as ak, type UnredactedFields as al, OAuthSession as am, ClientCredentialsOAuth as an, ClientSecret as ao, type Sender as ap, PaginationParams as aq, PaginatedResponse as ar, type Uint256 as as, KnownAssetSymbol as at, DecimalString as au, SwapStatus as av, type Newtype as aw, type AllowWalletParams as ax, AllowWalletResponse as ay, Asset as az, EvmContractAddress as b, MAX_UINT_256 as b0, Milestone as b1, OAuthRefreshToken as b2, OfferOption as b3, OfferOptionSlug as b4, OfferSlug as b5, OfferToken as b6, OffersNamespaceImpl as b7, type OndoQuoteDuration as b8, type OndoSellOutcome as b9, TokenLogoUrl as bA, type TokenRole as bB, TokensNamespaceImpl as bC, type Tx as bD, WalletAddress as bE, WalletOwnershipChallenge as bF, type WalletProtocol as bG, WalletsNamespaceImpl as bH, apiErrorCode as bI, assertUint256 as bJ, isChain as bK, parseUint256 as bL, PKCEState as ba, type PaginatedResponseDto as bb, ParticipationId as bc, type ParticipationStatus as bd, ParticipationsPaginationParams as be, Pii as bf, PiiAddress as bg, PiiJurisdiction as bh, type PiiKind as bi, type QueryParamValue as bj, type QueryParamValues as bk, RedirectUri as bl, type RemoveOptionAddressParams as bm, type RequirementActionNeededReason as bn, SOLANA_CHAINS as bo, STABLE_DECIMALS as bp, SolanaChain as bq, type SubmitDocumentParams as br, SwapAuthorization as bs, type SwapContractRef as bt, SwapPreview as bu, TermItem as bv, Ticker as bw, TokenAllowance as bx, TokenBalance as by, type TokenLogoImage as bz, type CoinListTokenSaleNamespace as c, OfferOptionId as d, AssetId as e, CoinListTokenSaleNamespaceImpl as f, type OndoNamespace as g, AssetSymbol as h, OfferSwapContract as i, OndoBuyTransaction as j, OndoSellTransaction as k, type OndoSwapTransactionCore as l, type OrderBookSide as m, OndoNamespaceImpl as n, type SuperstateSwapNamespace as o, type WalletsNamespace as p, Bps as q, EvmWalletAddress as r, SuperstateSwapNamespaceImpl as s, Requirement as t, RequirementsNamespaceImpl as u, type Config as v, type OAuthAccessToken as w, type OffersNamespace as x, StablecoinSymbol as y, type Erc20Asset as z };
|
package/dist/server/index.cjs
CHANGED
|
@@ -925,8 +925,9 @@ var SOLANA_CHAINS = {
|
|
|
925
925
|
solana_mainnet: true,
|
|
926
926
|
solana_devnet: true
|
|
927
927
|
};
|
|
928
|
+
var isChain = (value) => Object.keys(ETHEREUM_CHAINS).includes(value) || Object.keys(SOLANA_CHAINS).includes(value);
|
|
928
929
|
var Chain = (value) => {
|
|
929
|
-
if (!
|
|
930
|
+
if (!isChain(value)) {
|
|
930
931
|
throw new ValidationError(`Unsupported chain: "${value}"`);
|
|
931
932
|
}
|
|
932
933
|
return value;
|
|
@@ -1014,7 +1015,7 @@ var Offer = {
|
|
|
1014
1015
|
logoUrl: dto.logo_url,
|
|
1015
1016
|
startsAt: new Date(dto.starts_at),
|
|
1016
1017
|
endsAt: dto.ends_at ? new Date(dto.ends_at) : null,
|
|
1017
|
-
tokens: dto.tokens
|
|
1018
|
+
tokens: OfferToken.listFromDto(dto.tokens)
|
|
1018
1019
|
};
|
|
1019
1020
|
}
|
|
1020
1021
|
};
|
|
@@ -1023,7 +1024,19 @@ var OfferToken = {
|
|
|
1023
1024
|
role: dto.role,
|
|
1024
1025
|
chain: Chain(dto.chain),
|
|
1025
1026
|
address: EvmContractAddress(dto.address)
|
|
1026
|
-
})
|
|
1027
|
+
}),
|
|
1028
|
+
/**
|
|
1029
|
+
* Maps an offer's token list, dropping every token on a chain this SDK does
|
|
1030
|
+
* not name. Frontline's chain registry runs ahead of {@link Chain}, and a
|
|
1031
|
+
* plain `.map` would throw out of `Offer.fromDto` and, through
|
|
1032
|
+
* `PaginatedResponse.fromDto`, reject the whole offers page - which is how
|
|
1033
|
+
* one Base token blanked production's offers list. Dropping costs that
|
|
1034
|
+
* token's metadata alone: `coinlist.tokens.get` takes an `EthereumChain`,
|
|
1035
|
+
* so nobody could have looked it up anyway.
|
|
1036
|
+
*
|
|
1037
|
+
* Same shape as `TokenMetadata.fromRegistryDto`.
|
|
1038
|
+
*/
|
|
1039
|
+
listFromDto: (dtos) => dtos.filter((dto) => isChain(dto.chain)).map(OfferToken.fromDto)
|
|
1027
1040
|
};
|
|
1028
1041
|
|
|
1029
1042
|
// src/shared/types/asset.ts
|
|
@@ -1097,7 +1110,7 @@ var OfferDetail = {
|
|
|
1097
1110
|
name: dto.name,
|
|
1098
1111
|
asset: Asset.fromDto(dto.asset),
|
|
1099
1112
|
fundingAssets: dto.funding_assets.map(Asset.fromDto),
|
|
1100
|
-
tokens: dto.tokens
|
|
1113
|
+
tokens: OfferToken.listFromDto(dto.tokens),
|
|
1101
1114
|
swapContracts: swapContracts.map(OfferSwapContract.fromDto),
|
|
1102
1115
|
about: notBlankStringOrNull(dto.about),
|
|
1103
1116
|
tagline: dto.tagline,
|