@coinlist-co/react 0.12.2-rc.726778a → 0.12.2-rc.818bed6
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-C6F5FOFP.js → chunk-2HCSM3FB.js} +52 -19
- package/dist/chunk-2HCSM3FB.js.map +1 -0
- package/dist/{chunk-3UQPCAU4.js → chunk-OUFI3D3Q.js} +84 -4
- package/dist/chunk-OUFI3D3Q.js.map +1 -0
- package/dist/{chunk-IRV5YU42.js → chunk-YMDYLYL3.js} +941 -442
- package/dist/chunk-YMDYLYL3.js.map +1 -0
- package/dist/client/index.cjs +12358 -8385
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +1965 -227
- package/dist/client/index.d.ts +1965 -227
- package/dist/client/index.js +8766 -5370
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.cjs +842 -142
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +72 -41
- package/dist/server/index.d.ts +72 -41
- package/dist/server/index.js +323 -65
- package/dist/server/index.js.map +1 -1
- package/dist/{tokens-namespace-CIWBtgt2.d.cts → time-DJU6E8KK.d.cts} +943 -192
- package/dist/{tokens-namespace-CIWBtgt2.d.ts → time-DJU6E8KK.d.ts} +943 -192
- package/dist/{token-registry-snapshot-CqI6dXM_.d.cts → token-registry-snapshot-B0xCp3GD.d.cts} +74 -8
- package/dist/{token-registry-snapshot-BNBNuDu1.d.ts → token-registry-snapshot-DGG5N27C.d.ts} +74 -8
- package/dist/universal/index.cjs +1022 -440
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.d.cts +88 -5
- package/dist/universal/index.d.ts +88 -5
- package/dist/universal/index.js +46 -2
- package/package.json +1 -1
- package/dist/chunk-3UQPCAU4.js.map +0 -1
- package/dist/chunk-C6F5FOFP.js.map +0 -1
- package/dist/chunk-IRV5YU42.js.map +0 -1
package/dist/universal/index.cjs
CHANGED
|
@@ -27,11 +27,24 @@ __export(universal_exports, {
|
|
|
27
27
|
AssetIconUrl: () => AssetIconUrl,
|
|
28
28
|
AssetId: () => AssetId,
|
|
29
29
|
AssetSymbol: () => AssetSymbol,
|
|
30
|
+
AsyncOfferDetail: () => AsyncOfferDetail,
|
|
30
31
|
AuthorizationCode: () => AuthorizationCode,
|
|
31
32
|
BPS_DENOM: () => BPS_DENOM,
|
|
32
33
|
Blockchain: () => Blockchain,
|
|
33
34
|
BlockchainAmount: () => BlockchainAmount,
|
|
34
35
|
Bps: () => Bps,
|
|
36
|
+
CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT: () => CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT,
|
|
37
|
+
CENTRIFUGE_POLL_INTERVAL_MS: () => CENTRIFUGE_POLL_INTERVAL_MS,
|
|
38
|
+
CentrifugeNamespaceImpl: () => CentrifugeNamespaceImpl,
|
|
39
|
+
CentrifugeVaultBuyTransaction: () => CentrifugeVaultBuyTransaction,
|
|
40
|
+
CentrifugeVaultClaimProceedsTransaction: () => CentrifugeVaultClaimProceedsTransaction,
|
|
41
|
+
CentrifugeVaultClaimTransaction: () => CentrifugeVaultClaimTransaction,
|
|
42
|
+
CentrifugeVaultLeg: () => CentrifugeVaultLeg,
|
|
43
|
+
CentrifugeVaultLegId: () => CentrifugeVaultLegId,
|
|
44
|
+
CentrifugeVaultPosition: () => CentrifugeVaultPosition,
|
|
45
|
+
CentrifugeVaultQuote: () => CentrifugeVaultQuote,
|
|
46
|
+
CentrifugeVaultRedeemPosition: () => CentrifugeVaultRedeemPosition,
|
|
47
|
+
CentrifugeVaultStatus: () => CentrifugeVaultStatus,
|
|
35
48
|
Chain: () => Chain,
|
|
36
49
|
ClientCredentialsOAuth: () => ClientCredentialsOAuth,
|
|
37
50
|
ClientId: () => ClientId,
|
|
@@ -51,6 +64,7 @@ __export(universal_exports, {
|
|
|
51
64
|
DocumentSubmission: () => DocumentSubmission,
|
|
52
65
|
ERC20_ABI: () => ERC20_ABI,
|
|
53
66
|
ETHEREUM_CHAINS: () => ETHEREUM_CHAINS,
|
|
67
|
+
EpochMillis: () => EpochMillis,
|
|
54
68
|
Erc20NamespaceImpl: () => Erc20NamespaceImpl,
|
|
55
69
|
EthereumChain: () => EthereumChain,
|
|
56
70
|
EvmContractAddress: () => EvmContractAddress,
|
|
@@ -71,11 +85,13 @@ __export(universal_exports, {
|
|
|
71
85
|
MAX_UINT_256: () => MAX_UINT_256,
|
|
72
86
|
MathError: () => MathError,
|
|
73
87
|
Milestone: () => Milestone,
|
|
88
|
+
Millis: () => Millis,
|
|
74
89
|
NA_AMOUNT_ASSET_UI: () => NA_AMOUNT_ASSET_UI,
|
|
75
90
|
NotAuthenticatedError: () => NotAuthenticatedError,
|
|
76
91
|
NotImplementedError: () => NotImplementedError,
|
|
77
92
|
OAuthRefreshToken: () => OAuthRefreshToken,
|
|
78
93
|
OAuthSession: () => OAuthSession,
|
|
94
|
+
ONDO_NOT_TRADABLE_CODE: () => ONDO_NOT_TRADABLE_CODE,
|
|
79
95
|
ONDO_POLL_INTERVAL_MS: () => ONDO_POLL_INTERVAL_MS,
|
|
80
96
|
ONDO_QUOTE_MAX_TTL_MS: () => ONDO_QUOTE_MAX_TTL_MS,
|
|
81
97
|
ONDO_SETTLEMENT_ASSET: () => ONDO_SETTLEMENT_ASSET,
|
|
@@ -92,6 +108,7 @@ __export(universal_exports, {
|
|
|
92
108
|
OfferSlug: () => OfferSlug,
|
|
93
109
|
OfferSwapContract: () => OfferSwapContract,
|
|
94
110
|
OfferToken: () => OfferToken,
|
|
111
|
+
OfferVaultContract: () => OfferVaultContract,
|
|
95
112
|
OffersNamespaceImpl: () => OffersNamespaceImpl,
|
|
96
113
|
OndoBuyTransaction: () => OndoBuyTransaction,
|
|
97
114
|
OndoNamespaceImpl: () => OndoNamespaceImpl,
|
|
@@ -123,6 +140,7 @@ __export(universal_exports, {
|
|
|
123
140
|
SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA: () => SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA,
|
|
124
141
|
SWAP_LEVEL: () => SWAP_LEVEL,
|
|
125
142
|
SWAP_POLL_INTERVAL_MS: () => SWAP_POLL_INTERVAL_MS,
|
|
143
|
+
Seconds: () => Seconds,
|
|
126
144
|
ShortenedWalletAddress: () => ShortenedWalletAddress,
|
|
127
145
|
SolanaChain: () => SolanaChain,
|
|
128
146
|
StablecoinSymbol: () => StablecoinSymbol,
|
|
@@ -149,6 +167,7 @@ __export(universal_exports, {
|
|
|
149
167
|
ValidationError: () => ValidationError,
|
|
150
168
|
WalletAddress: () => WalletAddress,
|
|
151
169
|
WalletOwnershipChallenge: () => WalletOwnershipChallenge,
|
|
170
|
+
WalletSelection: () => WalletSelection,
|
|
152
171
|
WalletsNamespaceImpl: () => WalletsNamespaceImpl,
|
|
153
172
|
apiErrorCode: () => apiErrorCode,
|
|
154
173
|
applyBps: () => applyBps,
|
|
@@ -173,12 +192,15 @@ __export(universal_exports, {
|
|
|
173
192
|
getChainId: () => getChainId,
|
|
174
193
|
getNetworkName: () => getNetworkName,
|
|
175
194
|
isChain: () => isChain,
|
|
195
|
+
isExpired: () => isExpired,
|
|
176
196
|
isOfferType: () => isOfferType,
|
|
197
|
+
isOndoNotTradableError: () => isOndoNotTradableError,
|
|
177
198
|
isSwapAvailable: () => isSwapAvailable,
|
|
178
199
|
offerDisplayTokens: () => offerDisplayTokens,
|
|
179
200
|
ondoQuoteOfferDeadline: () => ondoQuoteOfferDeadline,
|
|
180
201
|
parseBlockchainAmount: () => parseBlockchainAmount,
|
|
181
202
|
parseUint256: () => parseUint256,
|
|
203
|
+
resolveCentrifugeVaults: () => resolveCentrifugeVaults,
|
|
182
204
|
shortenAddress: () => shortenAddress,
|
|
183
205
|
superstateSwapContractAddress: () => superstateSwapContractAddress,
|
|
184
206
|
swapSpender: () => swapSpender,
|
|
@@ -188,6 +210,15 @@ __export(universal_exports, {
|
|
|
188
210
|
});
|
|
189
211
|
module.exports = __toCommonJS(universal_exports);
|
|
190
212
|
|
|
213
|
+
// src/universal/api/internal-access-token-source.ts
|
|
214
|
+
var SentWith = {
|
|
215
|
+
userToken: (token) => ({
|
|
216
|
+
type: "user-token",
|
|
217
|
+
token
|
|
218
|
+
}),
|
|
219
|
+
noUserToken: { type: "no-user-token" }
|
|
220
|
+
};
|
|
221
|
+
|
|
191
222
|
// src/universal/api/http-attributes.ts
|
|
192
223
|
var empty = {};
|
|
193
224
|
var concat = (left, right) => ({
|
|
@@ -215,6 +246,10 @@ var retryAttempt = (attempt) => ({
|
|
|
215
246
|
var renewAttempted = (value) => ({
|
|
216
247
|
renewAttempted: value
|
|
217
248
|
});
|
|
249
|
+
var notRetryable = () => ({ retryable: false });
|
|
250
|
+
var sentWith = (token) => ({
|
|
251
|
+
sentWith: token
|
|
252
|
+
});
|
|
218
253
|
var requestId = (id) => ({ requestId: id });
|
|
219
254
|
var getRequestId = (attrs) => attrs?.requestId ?? null;
|
|
220
255
|
var isProtected = (attrs) => attrs?.protected === true;
|
|
@@ -222,6 +257,8 @@ var needUserAgent = (attrs) => attrs?.userAgent === true;
|
|
|
222
257
|
var isIdempotent = (attrs) => attrs?.idempotencyKey === true;
|
|
223
258
|
var getRetryAttempt = (attrs) => attrs?.retryAttempt ?? 0;
|
|
224
259
|
var wasRenewAttempted = (attrs) => attrs?.renewAttempted === true;
|
|
260
|
+
var isRetryable = (attrs) => attrs?.retryable !== false;
|
|
261
|
+
var getSentWith = (attrs) => attrs?.sentWith === void 0 ? SentWith.noUserToken : SentWith.userToken(attrs.sentWith);
|
|
225
262
|
var getClientCredentials = (attrs) => attrs?.clientCredentials;
|
|
226
263
|
var Attributes = {
|
|
227
264
|
empty,
|
|
@@ -237,6 +274,10 @@ var Attributes = {
|
|
|
237
274
|
getRetryAttempt,
|
|
238
275
|
renewAttempted,
|
|
239
276
|
wasRenewAttempted,
|
|
277
|
+
notRetryable,
|
|
278
|
+
isRetryable,
|
|
279
|
+
sentWith,
|
|
280
|
+
getSentWith,
|
|
240
281
|
clientCredentials,
|
|
241
282
|
getClientCredentials,
|
|
242
283
|
requestId,
|
|
@@ -431,50 +472,6 @@ async function generatePKCEParams(config) {
|
|
|
431
472
|
};
|
|
432
473
|
}
|
|
433
474
|
|
|
434
|
-
// src/universal/types/pagination.ts
|
|
435
|
-
var Cursor = (value) => value;
|
|
436
|
-
var PaginatedResponse = {
|
|
437
|
-
fromDto: (dto, itemMapper) => PaginatedResponse.fromDtoPage(dto, (items) => items.map(itemMapper)),
|
|
438
|
-
/**
|
|
439
|
-
* For a mapper that decides the page as a whole - one that drops items it
|
|
440
|
-
* cannot map, such as `Offer.listFromDto` - rather than item by item. The
|
|
441
|
-
* cursors are the wire's either way: dropping an item changes what the
|
|
442
|
-
* page holds, not where the next page starts.
|
|
443
|
-
*/
|
|
444
|
-
fromDtoPage: (dto, pageMapper) => ({
|
|
445
|
-
data: pageMapper(dto.data),
|
|
446
|
-
startingAfter: dto.starting_after ? Cursor(dto.starting_after) : null,
|
|
447
|
-
startingBefore: dto.starting_before ? Cursor(dto.starting_before) : null
|
|
448
|
-
})
|
|
449
|
-
};
|
|
450
|
-
var PaginationParams = {
|
|
451
|
-
toQueryParams: (params) => {
|
|
452
|
-
const queryParams = {};
|
|
453
|
-
if (params.after) {
|
|
454
|
-
queryParams.starting_after = params.after;
|
|
455
|
-
}
|
|
456
|
-
if (params.before) {
|
|
457
|
-
queryParams.starting_before = params.before;
|
|
458
|
-
}
|
|
459
|
-
if (params.limit) {
|
|
460
|
-
queryParams.limit = params.limit;
|
|
461
|
-
}
|
|
462
|
-
return queryParams;
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
// src/universal/types/asset.ts
|
|
467
|
-
var AssetId = (value) => value;
|
|
468
|
-
var AssetCode = (value) => value;
|
|
469
|
-
var Asset = {
|
|
470
|
-
fromDto: (dto) => ({
|
|
471
|
-
id: AssetId(dto.id),
|
|
472
|
-
code: AssetCode(dto.code),
|
|
473
|
-
name: dto.name,
|
|
474
|
-
fractionalDigits: dto.fractional_digits
|
|
475
|
-
})
|
|
476
|
-
};
|
|
477
|
-
|
|
478
475
|
// src/universal/types/errors.ts
|
|
479
476
|
var NotImplementedError = class extends Error {
|
|
480
477
|
constructor(message = "Not implemented yet") {
|
|
@@ -507,39 +504,8 @@ var MathError = class extends Error {
|
|
|
507
504
|
}
|
|
508
505
|
};
|
|
509
506
|
|
|
510
|
-
// src/universal/core/shared/
|
|
511
|
-
|
|
512
|
-
const type = dto.type;
|
|
513
|
-
throw new ValidationError(
|
|
514
|
-
`${model}.type: unknown type ${JSON.stringify(type)}`
|
|
515
|
-
);
|
|
516
|
-
}
|
|
517
|
-
function requiredString(value, field) {
|
|
518
|
-
const text = notBlankStringOrNull(value);
|
|
519
|
-
if (text === null) {
|
|
520
|
-
throw new ValidationError(
|
|
521
|
-
`${field}: expected a non-blank string, got ${typeof value === "string" ? "a blank string" : String(value)}`
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
|
-
return text;
|
|
525
|
-
}
|
|
526
|
-
function requiredDate(value, field) {
|
|
527
|
-
const date = typeof value === "string" ? new Date(value) : null;
|
|
528
|
-
if (date === null || Number.isNaN(date.getTime())) {
|
|
529
|
-
throw new ValidationError(
|
|
530
|
-
`${field}: expected a date, got ${JSON.stringify(value)}`
|
|
531
|
-
);
|
|
532
|
-
}
|
|
533
|
-
return date;
|
|
534
|
-
}
|
|
535
|
-
function requiredArray(value, field) {
|
|
536
|
-
if (!Array.isArray(value)) {
|
|
537
|
-
throw new ValidationError(
|
|
538
|
-
`${field}: expected an array, got ${typeof value}`
|
|
539
|
-
);
|
|
540
|
-
}
|
|
541
|
-
return value;
|
|
542
|
-
}
|
|
507
|
+
// src/universal/core/shared/blockchain/math.ts
|
|
508
|
+
var import_viem = require("viem");
|
|
543
509
|
|
|
544
510
|
// src/universal/types/blockchain/core.ts
|
|
545
511
|
var ETHEREUM_CHAINS = {
|
|
@@ -638,73 +604,769 @@ var StablecoinSymbol = (value) => value;
|
|
|
638
604
|
var KnownAssetSymbol = StablecoinSymbol;
|
|
639
605
|
var Bps = (value) => value;
|
|
640
606
|
|
|
641
|
-
// src/universal/
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
607
|
+
// src/universal/core/shared/blockchain/math.ts
|
|
608
|
+
function blockchainAmountFromRawOrThrow({
|
|
609
|
+
label,
|
|
610
|
+
raw,
|
|
611
|
+
decimals
|
|
612
|
+
}) {
|
|
613
|
+
const trimmed = raw.trim();
|
|
614
|
+
if (trimmed === "") {
|
|
615
|
+
throw new ValidationError(`${label}: not a uint256 integer ("${raw}")`);
|
|
616
|
+
}
|
|
617
|
+
let value;
|
|
618
|
+
try {
|
|
619
|
+
value = BigInt(trimmed);
|
|
620
|
+
} catch {
|
|
621
|
+
throw new ValidationError(`${label}: not a uint256 integer ("${raw}")`);
|
|
622
|
+
}
|
|
623
|
+
try {
|
|
624
|
+
return BlockchainAmount({ raw: assertUint256(value), decimals });
|
|
625
|
+
} catch {
|
|
626
|
+
throw new ValidationError(`${label}: out of uint256 bounds (${value})`);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function parseBlockchainAmount(amount, decimals) {
|
|
630
|
+
const trimmed = amount.trim();
|
|
631
|
+
if (trimmed === "") return { valid: false, reason: { type: "empty" } };
|
|
632
|
+
if (trimmed.startsWith("-")) {
|
|
633
|
+
return { valid: false, reason: { type: "negative" } };
|
|
634
|
+
}
|
|
635
|
+
if (/[eE]/.test(trimmed)) {
|
|
636
|
+
return { valid: false, reason: { type: "invalid-format" } };
|
|
637
|
+
}
|
|
638
|
+
if (trimmed === ".") {
|
|
639
|
+
return { valid: false, reason: { type: "invalid-format" } };
|
|
640
|
+
}
|
|
641
|
+
const normalised = trimmed.replace(/^\./, "0.").replace(/\.$/, "");
|
|
642
|
+
if (!/^\d+(\.\d+)?$/.test(normalised)) {
|
|
643
|
+
return { valid: false, reason: { type: "invalid-format" } };
|
|
644
|
+
}
|
|
645
|
+
const [, fraction = ""] = normalised.split(".");
|
|
646
|
+
if (fraction.length > decimals) {
|
|
647
|
+
return {
|
|
648
|
+
valid: false,
|
|
649
|
+
reason: { type: "too-many-decimals", maxDecimals: decimals }
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
try {
|
|
653
|
+
const raw = (0, import_viem.parseUnits)(normalised, decimals);
|
|
654
|
+
if (raw > MAX_UINT_256) {
|
|
655
|
+
return { valid: false, reason: { type: "overflow" } };
|
|
656
|
+
}
|
|
657
|
+
return {
|
|
658
|
+
valid: true,
|
|
659
|
+
amount: BlockchainAmount({ raw, decimals })
|
|
660
|
+
};
|
|
661
|
+
} catch {
|
|
662
|
+
return { valid: false, reason: { type: "invalid-format" } };
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// src/universal/core/shared/utils/wire.ts
|
|
667
|
+
function unknownTypeError(dto, model) {
|
|
668
|
+
const type = dto.type;
|
|
669
|
+
throw new ValidationError(
|
|
670
|
+
`${model}.type: unknown type ${JSON.stringify(type)}`
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
function requiredString(value, field) {
|
|
674
|
+
const text = notBlankStringOrNull(value);
|
|
675
|
+
if (text === null) {
|
|
676
|
+
throw new ValidationError(
|
|
677
|
+
`${field}: expected a non-blank string, got ${typeof value === "string" ? "a blank string" : String(value)}`
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
return text;
|
|
681
|
+
}
|
|
682
|
+
function requiredDate(value, field) {
|
|
683
|
+
const date = typeof value === "string" ? new Date(value) : null;
|
|
684
|
+
if (date === null || Number.isNaN(date.getTime())) {
|
|
685
|
+
throw new ValidationError(
|
|
686
|
+
`${field}: expected a date, got ${JSON.stringify(value)}`
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
return date;
|
|
690
|
+
}
|
|
691
|
+
function dateOrNull(value, field) {
|
|
692
|
+
return value === null ? null : requiredDate(value, field);
|
|
693
|
+
}
|
|
694
|
+
function decimalOrNull(value) {
|
|
695
|
+
return value === null ? null : DecimalString(value);
|
|
696
|
+
}
|
|
697
|
+
function requiredArray(value, field) {
|
|
698
|
+
if (!Array.isArray(value)) {
|
|
699
|
+
throw new ValidationError(
|
|
700
|
+
`${field}: expected an array, got ${typeof value}`
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
return value;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// src/universal/types/providers/centrifuge/centrifuge.ts
|
|
707
|
+
var CentrifugeVaultQuote = {
|
|
708
|
+
fromDto: (dto) => {
|
|
709
|
+
const spendDecimals = AssetDecimals(dto.spend_input_decimals);
|
|
710
|
+
const shareDecimals = AssetDecimals(dto.share_decimals);
|
|
711
|
+
return {
|
|
712
|
+
chain: EthereumChain(dto.chain),
|
|
713
|
+
symbol: AssetSymbol(dto.symbol),
|
|
714
|
+
spendInputAmount: blockchainAmountFromRawOrThrow({
|
|
715
|
+
label: "spend_input_amount",
|
|
716
|
+
raw: dto.spend_input_amount,
|
|
717
|
+
decimals: spendDecimals
|
|
718
|
+
}),
|
|
719
|
+
estimatedShares: blockchainAmountFromRawOrThrow({
|
|
720
|
+
label: "estimated_shares",
|
|
721
|
+
raw: dto.estimated_shares,
|
|
722
|
+
decimals: shareDecimals
|
|
723
|
+
}),
|
|
724
|
+
indicativePrice: decimalOrNull(dto.indicative_price),
|
|
725
|
+
minimumInputAmount: dto.minimum_input_amount === null ? null : blockchainAmountFromRawOrThrow({
|
|
726
|
+
label: "minimum_input_amount",
|
|
727
|
+
raw: dto.minimum_input_amount,
|
|
728
|
+
decimals: spendDecimals
|
|
729
|
+
}),
|
|
730
|
+
orderability: parseOrderability(
|
|
731
|
+
dto.can_order,
|
|
732
|
+
dto.reasons,
|
|
733
|
+
"CentrifugeVaultQuote"
|
|
734
|
+
)
|
|
735
|
+
};
|
|
736
|
+
}
|
|
648
737
|
};
|
|
649
|
-
var
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
738
|
+
var CentrifugeVaultStatus = {
|
|
739
|
+
fromDto: (dto) => ({
|
|
740
|
+
chain: EthereumChain(dto.chain),
|
|
741
|
+
symbol: AssetSymbol(dto.symbol),
|
|
742
|
+
vaultAddress: EvmContractAddress(dto.vault_address),
|
|
743
|
+
linked: dto.linked,
|
|
744
|
+
permissioned: dto.permissioned,
|
|
745
|
+
membershipValidUntil: dateOrNull(
|
|
746
|
+
dto.membership_valid_until,
|
|
747
|
+
"CentrifugeVaultStatus.membership_valid_until"
|
|
748
|
+
),
|
|
749
|
+
halted: dto.halted,
|
|
750
|
+
priceUpdatedAt: dateOrNull(
|
|
751
|
+
dto.price_updated_at,
|
|
752
|
+
"CentrifugeVaultStatus.price_updated_at"
|
|
753
|
+
),
|
|
754
|
+
orderability: parseOrderability(
|
|
755
|
+
dto.can_order,
|
|
756
|
+
dto.reasons,
|
|
757
|
+
"CentrifugeVaultStatus"
|
|
758
|
+
),
|
|
759
|
+
asOf: requiredDate(dto.as_of, "CentrifugeVaultStatus.as_of")
|
|
659
760
|
})
|
|
660
761
|
};
|
|
661
|
-
var
|
|
762
|
+
var CentrifugeVaultBuyTransaction = {
|
|
662
763
|
fromDto: (dto) => {
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
return {
|
|
673
|
-
...base2,
|
|
674
|
-
...OfferEditorial.fromDto(dto, "Offer"),
|
|
675
|
-
type: dto.type,
|
|
676
|
-
logoUrl: requiredString(dto.logo_url, "Offer.logo_url")
|
|
677
|
-
};
|
|
678
|
-
case "superstate::swap":
|
|
679
|
-
return {
|
|
680
|
-
...base2,
|
|
681
|
-
...OfferEditorial.fromDto(dto, "Offer"),
|
|
682
|
-
type: dto.type,
|
|
683
|
-
logoUrl: notBlankStringOrNull(dto.logo_url)
|
|
684
|
-
};
|
|
685
|
-
// `tagline`, `banner_url` and `starts_at` arrive as `null` and are left
|
|
686
|
-
// on the wire: copying them would hand every consumer a `startsAt` that
|
|
687
|
-
// is 1970 for one variant and a date for the others.
|
|
688
|
-
case "ondo::swap":
|
|
689
|
-
return {
|
|
690
|
-
...base2,
|
|
691
|
-
type: dto.type,
|
|
692
|
-
logoUrl: notBlankStringOrNull(dto.logo_url)
|
|
693
|
-
};
|
|
694
|
-
default:
|
|
695
|
-
return unknownTypeError(dto, "Offer");
|
|
764
|
+
const spendInputAmount = blockchainAmountFromRawOrThrow({
|
|
765
|
+
label: "spend_input_amount",
|
|
766
|
+
raw: dto.spend_input_amount,
|
|
767
|
+
decimals: AssetDecimals(dto.spend_input_decimals)
|
|
768
|
+
});
|
|
769
|
+
if (spendInputAmount.raw <= 0n) {
|
|
770
|
+
throw new ValidationError(
|
|
771
|
+
`spend_input_amount: must be greater than zero ("${dto.spend_input_amount}") - a deposit of nothing is not a request`
|
|
772
|
+
);
|
|
696
773
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
};
|
|
774
|
+
return {
|
|
775
|
+
...parseTransactionCore(dto, "CentrifugeVaultBuyTransaction"),
|
|
776
|
+
spendInputAmount,
|
|
777
|
+
estimatedShares: blockchainAmountFromRawOrThrow({
|
|
778
|
+
label: "estimated_shares",
|
|
779
|
+
raw: dto.estimated_shares,
|
|
780
|
+
decimals: AssetDecimals(dto.share_decimals)
|
|
781
|
+
})
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
var CentrifugeVaultClaimTransaction = {
|
|
786
|
+
fromDto: (dto) => ({
|
|
787
|
+
...parseTransactionCore(dto, "CentrifugeVaultClaimTransaction"),
|
|
788
|
+
claimableShares: blockchainAmountFromRawOrThrow({
|
|
789
|
+
label: "claimable_shares",
|
|
790
|
+
raw: dto.claimable_shares,
|
|
791
|
+
decimals: AssetDecimals(dto.share_decimals)
|
|
792
|
+
})
|
|
793
|
+
})
|
|
794
|
+
};
|
|
795
|
+
var CentrifugeVaultPosition = {
|
|
796
|
+
fromDto: (dto) => {
|
|
797
|
+
const assetDecimals = AssetDecimals(dto.asset_decimals);
|
|
798
|
+
const shareDecimals = AssetDecimals(dto.share_decimals);
|
|
799
|
+
const asset = (label, raw) => blockchainAmountFromRawOrThrow({ label, raw, decimals: assetDecimals });
|
|
800
|
+
const shares = (label, raw) => blockchainAmountFromRawOrThrow({ label, raw, decimals: shareDecimals });
|
|
801
|
+
return {
|
|
802
|
+
chain: EthereumChain(dto.chain),
|
|
803
|
+
symbol: AssetSymbol(dto.symbol),
|
|
804
|
+
walletAddress: EvmWalletAddress(dto.wallet_address),
|
|
805
|
+
status: dto.status,
|
|
806
|
+
requested: asset("requested", dto.requested),
|
|
807
|
+
pending: asset("pending", dto.pending),
|
|
808
|
+
filledAssets: asset("filled_assets", dto.filled_assets),
|
|
809
|
+
earnedShares: shares("earned_shares", dto.earned_shares),
|
|
810
|
+
claimedShares: shares("claimed_shares", dto.claimed_shares),
|
|
811
|
+
claimableShares: shares("claimable_shares", dto.claimable_shares),
|
|
812
|
+
shareBalance: shares("share_balance", dto.share_balance),
|
|
813
|
+
averagePrice: decimalOrNull(dto.average_price),
|
|
814
|
+
frozen: dto.frozen,
|
|
815
|
+
asOf: requiredDate(dto.as_of, "CentrifugeVaultPosition.as_of")
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
};
|
|
819
|
+
var CentrifugeVaultRedeemPosition = {
|
|
820
|
+
fromDto: (dto) => ({
|
|
821
|
+
chain: EthereumChain(dto.chain),
|
|
822
|
+
symbol: AssetSymbol(dto.symbol),
|
|
823
|
+
walletAddress: EvmWalletAddress(dto.wallet_address),
|
|
824
|
+
status: dto.status,
|
|
825
|
+
pending: blockchainAmountFromRawOrThrow({
|
|
826
|
+
label: "pending",
|
|
827
|
+
raw: dto.pending,
|
|
828
|
+
decimals: AssetDecimals(dto.share_decimals)
|
|
829
|
+
}),
|
|
830
|
+
claimableAssets: blockchainAmountFromRawOrThrow({
|
|
831
|
+
label: "claimable_assets",
|
|
832
|
+
raw: dto.claimable_assets,
|
|
833
|
+
decimals: AssetDecimals(dto.asset_decimals)
|
|
834
|
+
}),
|
|
835
|
+
frozen: dto.frozen,
|
|
836
|
+
asOf: requiredDate(dto.as_of, "CentrifugeVaultRedeemPosition.as_of")
|
|
837
|
+
})
|
|
838
|
+
};
|
|
839
|
+
var CentrifugeVaultLeg = {
|
|
840
|
+
/**
|
|
841
|
+
* What a claim on the leg would collect: shares for `invest`, the funding
|
|
842
|
+
* token for `redeem`.
|
|
843
|
+
*/
|
|
844
|
+
claimable: (leg) => {
|
|
845
|
+
switch (leg.direction) {
|
|
846
|
+
case "invest":
|
|
847
|
+
return leg.position.claimableShares;
|
|
848
|
+
case "redeem":
|
|
849
|
+
return leg.position.claimableAssets;
|
|
850
|
+
default: {
|
|
851
|
+
const exhaustive = leg;
|
|
852
|
+
return exhaustive;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
/** Whether the leg has anything queued or anything ready to claim. */
|
|
857
|
+
isActive: (leg) => leg.position.pending.raw > 0n || CentrifugeVaultLeg.claimable(leg).raw > 0n
|
|
858
|
+
};
|
|
859
|
+
var CentrifugeVaultLegId = {
|
|
860
|
+
/** Addresses compare case-insensitively: frontline echoes them lower case. */
|
|
861
|
+
of: (leg) => [
|
|
862
|
+
leg.direction,
|
|
863
|
+
leg.position.chain,
|
|
864
|
+
leg.position.walletAddress.toLowerCase()
|
|
865
|
+
].join(":")
|
|
866
|
+
};
|
|
867
|
+
var CentrifugeVaultClaimProceedsTransaction = {
|
|
868
|
+
fromDto: (dto) => ({
|
|
869
|
+
...parseTransactionCore(dto, "CentrifugeVaultClaimProceedsTransaction"),
|
|
870
|
+
claimableAssets: blockchainAmountFromRawOrThrow({
|
|
871
|
+
label: "claimable_assets",
|
|
872
|
+
raw: dto.claimable_assets,
|
|
873
|
+
decimals: AssetDecimals(dto.asset_decimals)
|
|
874
|
+
})
|
|
875
|
+
})
|
|
876
|
+
};
|
|
877
|
+
function parseOrderability(canOrder, reasons, model) {
|
|
878
|
+
const [first, ...rest] = reasons;
|
|
879
|
+
if (canOrder) {
|
|
880
|
+
if (first !== void 0) {
|
|
881
|
+
throw new ValidationError(
|
|
882
|
+
`${model}.reasons: expected none when can_order is true, got ${JSON.stringify(reasons)}`
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
return { type: "orderable" };
|
|
886
|
+
}
|
|
887
|
+
if (first === void 0) {
|
|
888
|
+
throw new ValidationError(
|
|
889
|
+
`${model}.reasons: expected at least one when can_order is false`
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
return { type: "blocked", reasons: [first, ...rest] };
|
|
893
|
+
}
|
|
894
|
+
function parseTransactionCore(dto, model) {
|
|
895
|
+
return {
|
|
896
|
+
tx: {
|
|
897
|
+
to: EvmContractAddress(dto.to),
|
|
898
|
+
data: HexEncodedTransactionData(dto.data)
|
|
899
|
+
},
|
|
900
|
+
expiresAt: dateOrNull(dto.expires_at, `${model}.expires_at`)
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// src/universal/api/frontline/providers/centrifuge/centrifuge.ts
|
|
905
|
+
async function getCentrifugeVaultQuote(api, params) {
|
|
906
|
+
const dto = await api.send({
|
|
907
|
+
method: "GET",
|
|
908
|
+
url: "/v1/centrifuge/vault/quote",
|
|
909
|
+
queryParams: {
|
|
910
|
+
symbol: params.symbol,
|
|
911
|
+
chain: params.chain,
|
|
912
|
+
amount: params.amount.raw.toString()
|
|
913
|
+
},
|
|
914
|
+
attributes: Attributes.protected()
|
|
915
|
+
});
|
|
916
|
+
return CentrifugeVaultQuote.fromDto(dto);
|
|
917
|
+
}
|
|
918
|
+
async function getCentrifugeVaultStatus(api, params) {
|
|
919
|
+
const dto = await api.send({
|
|
920
|
+
method: "GET",
|
|
921
|
+
url: "/v1/centrifuge/vault/status",
|
|
922
|
+
queryParams: {
|
|
923
|
+
symbol: params.symbol,
|
|
924
|
+
chain: params.chain
|
|
925
|
+
},
|
|
926
|
+
attributes: Attributes.protected()
|
|
927
|
+
});
|
|
928
|
+
return CentrifugeVaultStatus.fromDto(dto);
|
|
929
|
+
}
|
|
930
|
+
async function buildCentrifugeVaultBuy(api, params) {
|
|
931
|
+
const dto = await api.send({
|
|
932
|
+
method: "POST",
|
|
933
|
+
url: "/v1/centrifuge/vault/invest",
|
|
934
|
+
body: {
|
|
935
|
+
...walletFields(params),
|
|
936
|
+
amount: params.amount.raw.toString()
|
|
937
|
+
},
|
|
938
|
+
attributes: Attributes.protected()
|
|
939
|
+
});
|
|
940
|
+
if (dto.spend_input_decimals !== params.amount.decimals) {
|
|
941
|
+
throw new ValidationError(
|
|
942
|
+
`spend_input_decimals: the request was priced in ${dto.spend_input_decimals} decimals but the deposit was sized in ${params.amount.decimals}`
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
return CentrifugeVaultBuyTransaction.fromDto(dto);
|
|
946
|
+
}
|
|
947
|
+
async function getCentrifugeVaultPosition(api, params) {
|
|
948
|
+
const dto = await api.send({
|
|
949
|
+
method: "GET",
|
|
950
|
+
url: "/v1/centrifuge/vault/position",
|
|
951
|
+
queryParams: walletFields(params),
|
|
952
|
+
attributes: Attributes.protected()
|
|
953
|
+
});
|
|
954
|
+
return CentrifugeVaultPosition.fromDto(dto);
|
|
955
|
+
}
|
|
956
|
+
async function getCentrifugeVaultRedeemPosition(api, params) {
|
|
957
|
+
const dto = await api.send({
|
|
958
|
+
method: "GET",
|
|
959
|
+
url: "/v1/centrifuge/vault/redeem-position",
|
|
960
|
+
queryParams: walletFields(params),
|
|
961
|
+
attributes: Attributes.protected()
|
|
962
|
+
});
|
|
963
|
+
return CentrifugeVaultRedeemPosition.fromDto(dto);
|
|
964
|
+
}
|
|
965
|
+
async function createCentrifugeVaultClaim(api, params) {
|
|
966
|
+
const dto = await api.send({
|
|
967
|
+
method: "POST",
|
|
968
|
+
url: "/v1/centrifuge/vault/claim",
|
|
969
|
+
body: walletFields(params),
|
|
970
|
+
attributes: Attributes.protected()
|
|
971
|
+
});
|
|
972
|
+
return CentrifugeVaultClaimTransaction.fromDto(dto);
|
|
973
|
+
}
|
|
974
|
+
async function createCentrifugeVaultClaimProceeds(api, params) {
|
|
975
|
+
const dto = await api.send({
|
|
976
|
+
method: "POST",
|
|
977
|
+
url: "/v1/centrifuge/vault/claim-proceeds",
|
|
978
|
+
body: walletFields(params),
|
|
979
|
+
attributes: Attributes.protected()
|
|
980
|
+
});
|
|
981
|
+
return CentrifugeVaultClaimProceedsTransaction.fromDto(dto);
|
|
982
|
+
}
|
|
983
|
+
function walletFields(params) {
|
|
984
|
+
return {
|
|
985
|
+
symbol: params.symbol,
|
|
986
|
+
chain: params.chain,
|
|
987
|
+
wallet_address: params.walletAddress
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
// src/universal/core/shared/observability/log-cause.ts
|
|
992
|
+
var import_viem2 = require("viem");
|
|
993
|
+
function classifyLogCause(error) {
|
|
994
|
+
if (error instanceof HttpError) {
|
|
995
|
+
return httpCause(error);
|
|
996
|
+
}
|
|
997
|
+
if (error instanceof ValidationError) {
|
|
998
|
+
return { type: "validation", message: error.message };
|
|
999
|
+
}
|
|
1000
|
+
if (error instanceof InvariantError) {
|
|
1001
|
+
return { type: "invariant", message: error.message };
|
|
1002
|
+
}
|
|
1003
|
+
if (error instanceof MathError) {
|
|
1004
|
+
return { type: "math", message: error.message };
|
|
1005
|
+
}
|
|
1006
|
+
if (error instanceof NotAuthenticatedError) {
|
|
1007
|
+
return { type: "not-authenticated" };
|
|
1008
|
+
}
|
|
1009
|
+
if (error instanceof NotImplementedError) {
|
|
1010
|
+
return { type: "not-implemented" };
|
|
1011
|
+
}
|
|
1012
|
+
if (error instanceof import_viem2.BaseError) {
|
|
1013
|
+
const http = error.walk((e) => e instanceof HttpError);
|
|
1014
|
+
if (http instanceof HttpError) {
|
|
1015
|
+
return httpCause(http);
|
|
1016
|
+
}
|
|
1017
|
+
return { type: "rpc", reason: rpcFailureReason(error) };
|
|
1018
|
+
}
|
|
1019
|
+
return { type: "generic-error", name: errorName(error) };
|
|
1020
|
+
}
|
|
1021
|
+
function rpcFailureReason(error) {
|
|
1022
|
+
if (error.walk((e) => e instanceof import_viem2.ContractFunctionRevertedError)) {
|
|
1023
|
+
return "reverted";
|
|
1024
|
+
}
|
|
1025
|
+
if (error.walk((e) => e instanceof import_viem2.RpcError)) {
|
|
1026
|
+
return "node-rejected";
|
|
1027
|
+
}
|
|
1028
|
+
if (error.walk(
|
|
1029
|
+
(e) => e instanceof import_viem2.HttpRequestError || e instanceof import_viem2.WebSocketRequestError || e instanceof import_viem2.SocketClosedError || e instanceof import_viem2.TimeoutError
|
|
1030
|
+
)) {
|
|
1031
|
+
return "transport";
|
|
1032
|
+
}
|
|
1033
|
+
if (error instanceof import_viem2.ContractFunctionExecutionError) {
|
|
1034
|
+
return "malformed-response";
|
|
1035
|
+
}
|
|
1036
|
+
return "unknown";
|
|
1037
|
+
}
|
|
1038
|
+
function describeErrorUnredacted(error) {
|
|
1039
|
+
if (error instanceof HttpError) {
|
|
1040
|
+
return describeHttpErrorRedacted(error);
|
|
1041
|
+
}
|
|
1042
|
+
if (error instanceof Error) {
|
|
1043
|
+
return `${error.name}: ${error.message}`;
|
|
1044
|
+
}
|
|
1045
|
+
return `thrown non-error: ${stringifyUnredacted(error)}`;
|
|
1046
|
+
}
|
|
1047
|
+
function stringifyUnredacted(value) {
|
|
1048
|
+
if (value === void 0) return "";
|
|
1049
|
+
try {
|
|
1050
|
+
return JSON.stringify(
|
|
1051
|
+
value,
|
|
1052
|
+
(_key, item) => typeof item === "bigint" ? `${item}` : item
|
|
1053
|
+
) ?? String(value);
|
|
1054
|
+
} catch (_) {
|
|
1055
|
+
return "<unserializable>";
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
function describeHttpErrorRedacted(error) {
|
|
1059
|
+
const code = apiErrorCode(error);
|
|
1060
|
+
const status = error.response.status;
|
|
1061
|
+
return code === null ? `HttpError ${status}` : `HttpError ${status} (${code})`;
|
|
1062
|
+
}
|
|
1063
|
+
function errorName(error) {
|
|
1064
|
+
return error instanceof Error ? error.name : `non-error ${typeof error}`;
|
|
1065
|
+
}
|
|
1066
|
+
function httpCause(error) {
|
|
1067
|
+
return {
|
|
1068
|
+
type: "http",
|
|
1069
|
+
requestId: error.requestId,
|
|
1070
|
+
status: error.response.status,
|
|
1071
|
+
code: apiErrorCode(error),
|
|
1072
|
+
eventId: apiErrorEventId(error)
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
function apiErrorEventId(error) {
|
|
1076
|
+
const body = error.response.body;
|
|
1077
|
+
if (typeof body !== "object" || body === null) return null;
|
|
1078
|
+
const eventId = body.event_id;
|
|
1079
|
+
return typeof eventId === "string" ? eventId : null;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// src/universal/core/shared/observability/internal-logger.ts
|
|
1083
|
+
function internalLogger(logger, scope) {
|
|
1084
|
+
return logger ? scopedLogger(logger, scope, {}) : noopInternalLogger;
|
|
1085
|
+
}
|
|
1086
|
+
var LEVEL_RANK = {
|
|
1087
|
+
none: 0,
|
|
1088
|
+
error: 1,
|
|
1089
|
+
warn: 2,
|
|
1090
|
+
info: 3,
|
|
1091
|
+
debug: 4
|
|
1092
|
+
};
|
|
1093
|
+
function scopedLogger(logger, scope, bindings) {
|
|
1094
|
+
const admits = (level) => LEVEL_RANK[logger.level()] >= LEVEL_RANK[level];
|
|
1095
|
+
const safe = (event) => ({
|
|
1096
|
+
msg: event.msg,
|
|
1097
|
+
scope,
|
|
1098
|
+
bindings,
|
|
1099
|
+
fields: event.fields ?? {},
|
|
1100
|
+
...event.cause === void 0 ? {} : { cause: event.cause }
|
|
1101
|
+
});
|
|
1102
|
+
const unredacted = (event) => ({
|
|
1103
|
+
msg: event.msg,
|
|
1104
|
+
scope,
|
|
1105
|
+
bindings,
|
|
1106
|
+
fields: event.fields ?? {}
|
|
1107
|
+
});
|
|
1108
|
+
const self = {
|
|
1109
|
+
child: (binding) => scopedLogger(logger, scope, { ...bindings, ...binding }),
|
|
1110
|
+
debug: (event) => {
|
|
1111
|
+
if (admits("debug")) logger.debug(() => unredacted(event()));
|
|
1112
|
+
},
|
|
1113
|
+
info: (event) => {
|
|
1114
|
+
if (admits("info")) logger.info(() => safe(event()));
|
|
1115
|
+
},
|
|
1116
|
+
warn: (event) => {
|
|
1117
|
+
if (admits("warn")) logger.warn(() => safe(event()));
|
|
1118
|
+
},
|
|
1119
|
+
error: (event) => {
|
|
1120
|
+
if (admits("error")) logger.error(() => safe(event()));
|
|
1121
|
+
},
|
|
1122
|
+
failure: (event, error) => {
|
|
1123
|
+
if (admits("debug"))
|
|
1124
|
+
logger.debug(() => unredacted(verbatim(event(), error)));
|
|
1125
|
+
if (admits("error")) logger.error(() => safe(classified(event(), error)));
|
|
1126
|
+
},
|
|
1127
|
+
warning: (event, error) => {
|
|
1128
|
+
if (admits("debug"))
|
|
1129
|
+
logger.debug(() => unredacted(verbatim(event(), error)));
|
|
1130
|
+
if (admits("warn")) logger.warn(() => safe(classified(event(), error)));
|
|
1131
|
+
},
|
|
1132
|
+
wrap: async (op, params, run) => {
|
|
1133
|
+
const opLog = self.child({ op });
|
|
1134
|
+
opLog.debug(() => ({ msg: "call", fields: { params } }));
|
|
1135
|
+
try {
|
|
1136
|
+
return await run();
|
|
1137
|
+
} catch (error) {
|
|
1138
|
+
opLog.failure(() => ({ msg: "call failed" }), error);
|
|
1139
|
+
throw error;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
return self;
|
|
1144
|
+
}
|
|
1145
|
+
function verbatim(event, error) {
|
|
1146
|
+
return {
|
|
1147
|
+
msg: event.msg,
|
|
1148
|
+
fields: { ...event.fields, error: describeErrorUnredacted(error) }
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
function classified(event, error) {
|
|
1152
|
+
return { ...event, cause: event.cause ?? classifyLogCause(error) };
|
|
1153
|
+
}
|
|
1154
|
+
var noopInternalLogger = {
|
|
1155
|
+
child: () => noopInternalLogger,
|
|
1156
|
+
debug: () => void 0,
|
|
1157
|
+
info: () => void 0,
|
|
1158
|
+
warn: () => void 0,
|
|
1159
|
+
error: () => void 0,
|
|
1160
|
+
failure: () => void 0,
|
|
1161
|
+
warning: () => void 0,
|
|
1162
|
+
wrap: (_op, _params, run) => run()
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
// src/universal/core/checkout/centrifuge/centrifuge-namespace.ts
|
|
1166
|
+
var CentrifugeNamespaceImpl = class {
|
|
1167
|
+
constructor(ctx) {
|
|
1168
|
+
this.ctx = ctx;
|
|
1169
|
+
this.log = internalLogger(ctx.logger, "CENTRIFUGE");
|
|
1170
|
+
}
|
|
1171
|
+
async getQuote(params) {
|
|
1172
|
+
return this.log.wrap("getQuote", params, async () => {
|
|
1173
|
+
await this.ctx.ensureUserAuthenticated();
|
|
1174
|
+
return getCentrifugeVaultQuote(this.ctx.api, params);
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
async getVaultStatus(params) {
|
|
1178
|
+
return this.log.wrap("getVaultStatus", params, async () => {
|
|
1179
|
+
await this.ctx.ensureUserAuthenticated();
|
|
1180
|
+
return getCentrifugeVaultStatus(this.ctx.api, params);
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
async getPosition(params) {
|
|
1184
|
+
return this.log.wrap("getPosition", params, async () => {
|
|
1185
|
+
await this.ctx.ensureUserAuthenticated();
|
|
1186
|
+
return getCentrifugeVaultPosition(this.ctx.api, params);
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
async getRedeemPosition(params) {
|
|
1190
|
+
return this.log.wrap("getRedeemPosition", params, async () => {
|
|
1191
|
+
await this.ctx.ensureUserAuthenticated();
|
|
1192
|
+
return getCentrifugeVaultRedeemPosition(this.ctx.api, params);
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
async createClaim(params) {
|
|
1196
|
+
return this.log.wrap("createClaim", params, async () => {
|
|
1197
|
+
await this.ctx.ensureUserAuthenticated();
|
|
1198
|
+
return createCentrifugeVaultClaim(this.ctx.api, params);
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
async createClaimProceeds(params) {
|
|
1202
|
+
return this.log.wrap("createClaimProceeds", params, async () => {
|
|
1203
|
+
await this.ctx.ensureUserAuthenticated();
|
|
1204
|
+
return createCentrifugeVaultClaimProceeds(this.ctx.api, params);
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
async buildBuyTransaction(params) {
|
|
1208
|
+
return this.log.wrap("buildBuyTransaction", params, async () => {
|
|
1209
|
+
await this.ctx.ensureUserAuthenticated();
|
|
1210
|
+
return buildCentrifugeVaultBuy(this.ctx.api, params);
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
// src/universal/core/checkout/centrifuge/constants.ts
|
|
1216
|
+
var CENTRIFUGE_POLL_INTERVAL_MS = 15e3;
|
|
1217
|
+
var CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT = BlockchainAmount({
|
|
1218
|
+
raw: 100000000n,
|
|
1219
|
+
decimals: STABLE_DECIMALS
|
|
1220
|
+
});
|
|
1221
|
+
|
|
1222
|
+
// src/universal/core/checkout/centrifuge/vaults.ts
|
|
1223
|
+
function resolveCentrifugeVaults(offer, lookup) {
|
|
1224
|
+
return offer.vaultContracts.map((contract) => {
|
|
1225
|
+
const { chain } = contract;
|
|
1226
|
+
if (!isEthereumChain(chain)) {
|
|
1227
|
+
return { type: "unresolved", chain, missing: "evm-chain" };
|
|
1228
|
+
}
|
|
1229
|
+
const onChain = (role) => offer.tokens.filter(
|
|
1230
|
+
(token) => token.role === role && token.chain === chain
|
|
1231
|
+
);
|
|
1232
|
+
const share = firstKnown(onChain("vault"), lookup);
|
|
1233
|
+
if (share === null) {
|
|
1234
|
+
return { type: "unresolved", chain, missing: "share-token" };
|
|
1235
|
+
}
|
|
1236
|
+
const funding = firstKnown(onChain("funding"), lookup);
|
|
1237
|
+
if (funding === null) {
|
|
1238
|
+
return { type: "unresolved", chain, missing: "funding-token" };
|
|
1239
|
+
}
|
|
1240
|
+
return {
|
|
1241
|
+
type: "resolved",
|
|
1242
|
+
vault: { chain, proxy: contract.address, share, funding }
|
|
1243
|
+
};
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
function firstKnown(tokens, lookup) {
|
|
1247
|
+
for (const token of tokens) {
|
|
1248
|
+
const metadata = lookup(token);
|
|
1249
|
+
if (metadata !== null) return metadata;
|
|
1250
|
+
}
|
|
1251
|
+
return null;
|
|
1252
|
+
}
|
|
1253
|
+
function isEthereumChain(chain) {
|
|
1254
|
+
return chain in ETHEREUM_CHAINS;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
// src/universal/types/pagination.ts
|
|
1258
|
+
var Cursor = (value) => value;
|
|
1259
|
+
var PaginatedResponse = {
|
|
1260
|
+
fromDto: (dto, itemMapper) => PaginatedResponse.fromDtoPage(dto, (items) => items.map(itemMapper)),
|
|
1261
|
+
/**
|
|
1262
|
+
* For a mapper that decides the page as a whole - one that drops items it
|
|
1263
|
+
* cannot map, such as `Offer.listFromDto` - rather than item by item. The
|
|
1264
|
+
* cursors are the wire's either way: dropping an item changes what the
|
|
1265
|
+
* page holds, not where the next page starts.
|
|
1266
|
+
*/
|
|
1267
|
+
fromDtoPage: (dto, pageMapper) => ({
|
|
1268
|
+
data: pageMapper(dto.data),
|
|
1269
|
+
startingAfter: dto.starting_after ? Cursor(dto.starting_after) : null,
|
|
1270
|
+
startingBefore: dto.starting_before ? Cursor(dto.starting_before) : null
|
|
1271
|
+
})
|
|
1272
|
+
};
|
|
1273
|
+
var PaginationParams = {
|
|
1274
|
+
toQueryParams: (params) => {
|
|
1275
|
+
const queryParams = {};
|
|
1276
|
+
if (params.after) {
|
|
1277
|
+
queryParams.starting_after = params.after;
|
|
1278
|
+
}
|
|
1279
|
+
if (params.before) {
|
|
1280
|
+
queryParams.starting_before = params.before;
|
|
1281
|
+
}
|
|
1282
|
+
if (params.limit) {
|
|
1283
|
+
queryParams.limit = params.limit;
|
|
1284
|
+
}
|
|
1285
|
+
return queryParams;
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
// src/universal/types/asset.ts
|
|
1290
|
+
var AssetId = (value) => value;
|
|
1291
|
+
var AssetCode = (value) => value;
|
|
1292
|
+
var Asset = {
|
|
1293
|
+
fromDto: (dto) => ({
|
|
1294
|
+
id: AssetId(dto.id),
|
|
1295
|
+
code: AssetCode(dto.code),
|
|
1296
|
+
name: dto.name,
|
|
1297
|
+
fractionalDigits: dto.fractional_digits
|
|
1298
|
+
})
|
|
1299
|
+
};
|
|
1300
|
+
|
|
1301
|
+
// src/universal/types/offer.ts
|
|
1302
|
+
var OfferId = (value) => value;
|
|
1303
|
+
var OfferSlug = (value) => value;
|
|
1304
|
+
var OFFER_TYPES = {
|
|
1305
|
+
"coinlist::token_sale": true,
|
|
1306
|
+
"superstate::swap": true,
|
|
1307
|
+
"ondo::swap": true,
|
|
1308
|
+
"centrifuge::vault": true
|
|
1309
|
+
};
|
|
1310
|
+
var isOfferType = (value) => Object.keys(OFFER_TYPES).includes(value);
|
|
1311
|
+
var OfferEditorial = {
|
|
1312
|
+
/**
|
|
1313
|
+
* `model` prefixes the field in the error (`'Offer'`, `'OfferDetail'`), so
|
|
1314
|
+
* the same three checks name the payload that failed them.
|
|
1315
|
+
*/
|
|
1316
|
+
fromDto: (dto, model) => ({
|
|
1317
|
+
tagline: requiredString(dto.tagline, `${model}.tagline`),
|
|
1318
|
+
bannerUrl: requiredString(dto.banner_url, `${model}.banner_url`),
|
|
1319
|
+
startsAt: requiredDate(dto.starts_at, `${model}.starts_at`)
|
|
1320
|
+
})
|
|
1321
|
+
};
|
|
1322
|
+
var Offer = {
|
|
1323
|
+
fromDto: (dto) => {
|
|
1324
|
+
const tokens = requiredArray(dto.tokens, "Offer.tokens");
|
|
1325
|
+
const base2 = {
|
|
1326
|
+
id: OfferId(dto.id),
|
|
1327
|
+
slug: OfferSlug(dto.slug),
|
|
1328
|
+
endsAt: dto.ends_at ? new Date(dto.ends_at) : null,
|
|
1329
|
+
tokens: OfferToken.listFromDto(tokens)
|
|
1330
|
+
};
|
|
1331
|
+
switch (dto.type) {
|
|
1332
|
+
case "coinlist::token_sale":
|
|
1333
|
+
return {
|
|
1334
|
+
...base2,
|
|
1335
|
+
...OfferEditorial.fromDto(dto, "Offer"),
|
|
1336
|
+
type: dto.type,
|
|
1337
|
+
logoUrl: requiredString(dto.logo_url, "Offer.logo_url")
|
|
1338
|
+
};
|
|
1339
|
+
case "superstate::swap":
|
|
1340
|
+
return {
|
|
1341
|
+
...base2,
|
|
1342
|
+
...OfferEditorial.fromDto(dto, "Offer"),
|
|
1343
|
+
type: dto.type,
|
|
1344
|
+
logoUrl: notBlankStringOrNull(dto.logo_url)
|
|
1345
|
+
};
|
|
1346
|
+
// `tagline`, `banner_url` and `starts_at` arrive as `null` and are left
|
|
1347
|
+
// on the wire: copying them would hand every consumer a `startsAt` that
|
|
1348
|
+
// is 1970 for one variant and a date for the others.
|
|
1349
|
+
case "ondo::swap":
|
|
1350
|
+
case "centrifuge::vault":
|
|
1351
|
+
return {
|
|
1352
|
+
...base2,
|
|
1353
|
+
type: dto.type,
|
|
1354
|
+
logoUrl: notBlankStringOrNull(dto.logo_url)
|
|
1355
|
+
};
|
|
1356
|
+
default:
|
|
1357
|
+
return unknownTypeError(dto, "Offer");
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
/**
|
|
1361
|
+
* Maps a page of offers, dropping every offer whose `type` this SDK does not
|
|
1362
|
+
* name. The same reasoning as {@link OfferToken.listFromDto}: a plain `.map`
|
|
1363
|
+
* would throw out of `fromDto` and, through `PaginatedResponse.fromDto`,
|
|
1364
|
+
* reject the whole page, so one offer of an unknown type would blank the
|
|
1365
|
+
* grid for every offer beside it. A single offer fetched by id still
|
|
1366
|
+
* throws, because there is nothing beside it to keep.
|
|
1367
|
+
*/
|
|
1368
|
+
listFromDto: (dtos) => dtos.filter((dto) => isOfferType(dto.type)).map(Offer.fromDto)
|
|
1369
|
+
};
|
|
708
1370
|
var OfferToken = {
|
|
709
1371
|
fromDto: (dto) => ({
|
|
710
1372
|
role: dto.role,
|
|
@@ -730,6 +1392,30 @@ var Ticker = (value) => value;
|
|
|
730
1392
|
var Isin = (value) => value;
|
|
731
1393
|
|
|
732
1394
|
// src/universal/types/offer-detail.ts
|
|
1395
|
+
var AsyncOfferDetail = {
|
|
1396
|
+
/**
|
|
1397
|
+
* Narrows an offer fetched generically, e.g. on an offer page, to one with
|
|
1398
|
+
* something to claim.
|
|
1399
|
+
*
|
|
1400
|
+
* An exhaustive `switch` rather than a list of async types, so a new offer
|
|
1401
|
+
* type is a compile error here until someone decides whether it settles
|
|
1402
|
+
* later.
|
|
1403
|
+
*/
|
|
1404
|
+
is: (offer) => {
|
|
1405
|
+
switch (offer.type) {
|
|
1406
|
+
case "centrifuge::vault":
|
|
1407
|
+
return true;
|
|
1408
|
+
case "ondo::swap":
|
|
1409
|
+
case "superstate::swap":
|
|
1410
|
+
case "coinlist::token_sale":
|
|
1411
|
+
return false;
|
|
1412
|
+
default: {
|
|
1413
|
+
const exhaustive = offer;
|
|
1414
|
+
return exhaustive;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
};
|
|
733
1419
|
var OfferOptionId = (value) => value;
|
|
734
1420
|
var OfferOptionSlug = (value) => value;
|
|
735
1421
|
var OfferSwapContract = {
|
|
@@ -738,6 +1424,19 @@ var OfferSwapContract = {
|
|
|
738
1424
|
address: EvmContractAddress(dto.address)
|
|
739
1425
|
})
|
|
740
1426
|
};
|
|
1427
|
+
var OfferVaultContract = {
|
|
1428
|
+
fromDto: (dto) => ({
|
|
1429
|
+
chain: Chain(dto.chain),
|
|
1430
|
+
address: EvmContractAddress(dto.address)
|
|
1431
|
+
}),
|
|
1432
|
+
/**
|
|
1433
|
+
* Drops every proxy on a chain this SDK does not name, as
|
|
1434
|
+
* `OfferToken.listFromDto` does: frontline publishes the full offer-token
|
|
1435
|
+
* chain list, which runs ahead of {@link Chain}, and one unmodelled chain
|
|
1436
|
+
* should not throw away the proxies the SDK can use.
|
|
1437
|
+
*/
|
|
1438
|
+
listFromDto: (dtos) => dtos.filter((dto) => isChain(dto.chain)).map(OfferVaultContract.fromDto)
|
|
1439
|
+
};
|
|
741
1440
|
var OfferDetail = {
|
|
742
1441
|
fromDto: (dto) => {
|
|
743
1442
|
const fundingAssets = requiredArray(
|
|
@@ -800,6 +1499,18 @@ var OfferDetail = {
|
|
|
800
1499
|
"OfferDetail.swap_contracts"
|
|
801
1500
|
).map(OfferSwapContract.fromDto)
|
|
802
1501
|
};
|
|
1502
|
+
// No editorial, as for Ondo. `[]` is fine and a missing key is not, for
|
|
1503
|
+
// the same reason as `swap_contracts`: this is the spender a user
|
|
1504
|
+
// approves.
|
|
1505
|
+
case "centrifuge::vault":
|
|
1506
|
+
return {
|
|
1507
|
+
...base2,
|
|
1508
|
+
type: dto.type,
|
|
1509
|
+
logoUrl: notBlankStringOrNull(dto.logo_url),
|
|
1510
|
+
vaultContracts: OfferVaultContract.listFromDto(
|
|
1511
|
+
requiredArray(dto.vault_contracts, "OfferDetail.vault_contracts")
|
|
1512
|
+
)
|
|
1513
|
+
};
|
|
803
1514
|
default:
|
|
804
1515
|
return unknownTypeError(dto, "OfferDetail");
|
|
805
1516
|
}
|
|
@@ -854,249 +1565,75 @@ var ParticipationsPaginationParams = {
|
|
|
854
1565
|
queryParams["filters[0][field]"] = "offer_id";
|
|
855
1566
|
queryParams["filters[0][op]"] = "==";
|
|
856
1567
|
queryParams["filters[0][value]"] = params.offerId;
|
|
857
|
-
}
|
|
858
|
-
return queryParams;
|
|
859
|
-
}
|
|
860
|
-
};
|
|
861
|
-
var Participation = {
|
|
862
|
-
/** Maps API DTO shape into the SDK participation domain model. */
|
|
863
|
-
fromDto: (dto) => {
|
|
864
|
-
const walletAddress = notBlankStringOrNull(dto.wallet_address);
|
|
865
|
-
return {
|
|
866
|
-
id: ParticipationId(dto.id),
|
|
867
|
-
offerId: OfferId(dto.offer_id),
|
|
868
|
-
offerOptionId: OfferOptionId(dto.offer_option_id),
|
|
869
|
-
status: dto.status,
|
|
870
|
-
amount: dto.amount,
|
|
871
|
-
displayAmount: dto.amount_string,
|
|
872
|
-
asset: Asset.fromDto(dto.asset),
|
|
873
|
-
chain: Blockchain(dto.chain),
|
|
874
|
-
insertedAt: dto.inserted_at ? new Date(dto.inserted_at) : null,
|
|
875
|
-
updatedAt: dto.updated_at ? new Date(dto.updated_at) : null,
|
|
876
|
-
walletAddress: walletAddress ? WalletAddress(walletAddress) : null
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
};
|
|
880
|
-
var CreateParticipationParams = {
|
|
881
|
-
/** Maps participation creation params into API DTO payload. */
|
|
882
|
-
toDto: (params) => ({
|
|
883
|
-
offer_id: params.offerId,
|
|
884
|
-
offer_option_id: params.offerOptionId,
|
|
885
|
-
chain: params.chain,
|
|
886
|
-
wallet_address: params.walletAddress,
|
|
887
|
-
amount: params.amount,
|
|
888
|
-
asset_id: params.assetId,
|
|
889
|
-
approval_transaction_hash: params.approvalTransactionHash
|
|
890
|
-
})
|
|
891
|
-
};
|
|
892
|
-
|
|
893
|
-
// src/universal/api/frontline/providers/coin-list/token-sale.ts
|
|
894
|
-
async function fetchParticipations(api, offerId) {
|
|
895
|
-
return fetchAllPages(
|
|
896
|
-
(params) => fetchParticipationsPage(api, params),
|
|
897
|
-
{ offerId }
|
|
898
|
-
);
|
|
899
|
-
}
|
|
900
|
-
async function fetchParticipationsPage(api, params) {
|
|
901
|
-
const pageDto = await api.send({
|
|
902
|
-
method: "GET",
|
|
903
|
-
url: "/v1/participations",
|
|
904
|
-
queryParams: ParticipationsPaginationParams.toQueryParams(params),
|
|
905
|
-
attributes: Attributes.protected()
|
|
906
|
-
});
|
|
907
|
-
return PaginatedResponse.fromDto(pageDto, Participation.fromDto);
|
|
908
|
-
}
|
|
909
|
-
async function fetchParticipation(api, id) {
|
|
910
|
-
const dto = await api.send({
|
|
911
|
-
method: "GET",
|
|
912
|
-
url: `/v1/participations/${id}`,
|
|
913
|
-
attributes: Attributes.protected()
|
|
914
|
-
});
|
|
915
|
-
return Participation.fromDto(dto);
|
|
916
|
-
}
|
|
917
|
-
async function createParticipation(api, params) {
|
|
918
|
-
const dto = await api.send({
|
|
919
|
-
method: "POST",
|
|
920
|
-
url: "/v1/participations",
|
|
921
|
-
body: CreateParticipationParams.toDto(params),
|
|
922
|
-
attributes: Attributes.protected()
|
|
923
|
-
});
|
|
924
|
-
return Participation.fromDto(dto);
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
// src/universal/core/shared/observability/log-cause.ts
|
|
928
|
-
var import_viem = require("viem");
|
|
929
|
-
function classifyLogCause(error) {
|
|
930
|
-
if (error instanceof HttpError) {
|
|
931
|
-
return httpCause(error);
|
|
932
|
-
}
|
|
933
|
-
if (error instanceof ValidationError) {
|
|
934
|
-
return { type: "validation", message: error.message };
|
|
935
|
-
}
|
|
936
|
-
if (error instanceof InvariantError) {
|
|
937
|
-
return { type: "invariant", message: error.message };
|
|
938
|
-
}
|
|
939
|
-
if (error instanceof MathError) {
|
|
940
|
-
return { type: "math", message: error.message };
|
|
941
|
-
}
|
|
942
|
-
if (error instanceof NotAuthenticatedError) {
|
|
943
|
-
return { type: "not-authenticated" };
|
|
944
|
-
}
|
|
945
|
-
if (error instanceof NotImplementedError) {
|
|
946
|
-
return { type: "not-implemented" };
|
|
947
|
-
}
|
|
948
|
-
if (error instanceof import_viem.BaseError) {
|
|
949
|
-
const http = error.walk((e) => e instanceof HttpError);
|
|
950
|
-
if (http instanceof HttpError) {
|
|
951
|
-
return httpCause(http);
|
|
952
|
-
}
|
|
953
|
-
return { type: "rpc", reason: rpcFailureReason(error) };
|
|
954
|
-
}
|
|
955
|
-
return { type: "generic-error", name: errorName(error) };
|
|
956
|
-
}
|
|
957
|
-
function rpcFailureReason(error) {
|
|
958
|
-
if (error.walk((e) => e instanceof import_viem.ContractFunctionRevertedError)) {
|
|
959
|
-
return "reverted";
|
|
960
|
-
}
|
|
961
|
-
if (error.walk((e) => e instanceof import_viem.RpcError)) {
|
|
962
|
-
return "node-rejected";
|
|
963
|
-
}
|
|
964
|
-
if (error.walk(
|
|
965
|
-
(e) => e instanceof import_viem.HttpRequestError || e instanceof import_viem.WebSocketRequestError || e instanceof import_viem.SocketClosedError || e instanceof import_viem.TimeoutError
|
|
966
|
-
)) {
|
|
967
|
-
return "transport";
|
|
968
|
-
}
|
|
969
|
-
if (error instanceof import_viem.ContractFunctionExecutionError) {
|
|
970
|
-
return "malformed-response";
|
|
971
|
-
}
|
|
972
|
-
return "unknown";
|
|
973
|
-
}
|
|
974
|
-
function describeErrorUnredacted(error) {
|
|
975
|
-
if (error instanceof HttpError) {
|
|
976
|
-
return describeHttpErrorRedacted(error);
|
|
977
|
-
}
|
|
978
|
-
if (error instanceof Error) {
|
|
979
|
-
return `${error.name}: ${error.message}`;
|
|
980
|
-
}
|
|
981
|
-
return `thrown non-error: ${stringifyUnredacted(error)}`;
|
|
982
|
-
}
|
|
983
|
-
function stringifyUnredacted(value) {
|
|
984
|
-
if (value === void 0) return "";
|
|
985
|
-
try {
|
|
986
|
-
return JSON.stringify(
|
|
987
|
-
value,
|
|
988
|
-
(_key, item) => typeof item === "bigint" ? `${item}` : item
|
|
989
|
-
) ?? String(value);
|
|
990
|
-
} catch (_) {
|
|
991
|
-
return "<unserializable>";
|
|
1568
|
+
}
|
|
1569
|
+
return queryParams;
|
|
992
1570
|
}
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1571
|
+
};
|
|
1572
|
+
var Participation = {
|
|
1573
|
+
/** Maps API DTO shape into the SDK participation domain model. */
|
|
1574
|
+
fromDto: (dto) => {
|
|
1575
|
+
const walletAddress = notBlankStringOrNull(dto.wallet_address);
|
|
1576
|
+
return {
|
|
1577
|
+
id: ParticipationId(dto.id),
|
|
1578
|
+
offerId: OfferId(dto.offer_id),
|
|
1579
|
+
offerOptionId: OfferOptionId(dto.offer_option_id),
|
|
1580
|
+
status: dto.status,
|
|
1581
|
+
amount: dto.amount,
|
|
1582
|
+
displayAmount: dto.amount_string,
|
|
1583
|
+
asset: Asset.fromDto(dto.asset),
|
|
1584
|
+
chain: Blockchain(dto.chain),
|
|
1585
|
+
insertedAt: dto.inserted_at ? new Date(dto.inserted_at) : null,
|
|
1586
|
+
updatedAt: dto.updated_at ? new Date(dto.updated_at) : null,
|
|
1587
|
+
walletAddress: walletAddress ? WalletAddress(walletAddress) : null
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
};
|
|
1591
|
+
var CreateParticipationParams = {
|
|
1592
|
+
/** Maps participation creation params into API DTO payload. */
|
|
1593
|
+
toDto: (params) => ({
|
|
1594
|
+
offer_id: params.offerId,
|
|
1595
|
+
offer_option_id: params.offerOptionId,
|
|
1596
|
+
chain: params.chain,
|
|
1597
|
+
wallet_address: params.walletAddress,
|
|
1598
|
+
amount: params.amount,
|
|
1599
|
+
asset_id: params.assetId,
|
|
1600
|
+
approval_transaction_hash: params.approvalTransactionHash
|
|
1601
|
+
})
|
|
1602
|
+
};
|
|
1017
1603
|
|
|
1018
|
-
// src/universal/
|
|
1019
|
-
function
|
|
1020
|
-
return
|
|
1604
|
+
// src/universal/api/frontline/providers/coin-list/token-sale.ts
|
|
1605
|
+
async function fetchParticipations(api, offerId) {
|
|
1606
|
+
return fetchAllPages(
|
|
1607
|
+
(params) => fetchParticipationsPage(api, params),
|
|
1608
|
+
{ offerId }
|
|
1609
|
+
);
|
|
1021
1610
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
};
|
|
1029
|
-
function scopedLogger(logger, scope, bindings) {
|
|
1030
|
-
const admits = (level) => LEVEL_RANK[logger.level()] >= LEVEL_RANK[level];
|
|
1031
|
-
const safe = (event) => ({
|
|
1032
|
-
msg: event.msg,
|
|
1033
|
-
scope,
|
|
1034
|
-
bindings,
|
|
1035
|
-
fields: event.fields ?? {},
|
|
1036
|
-
...event.cause === void 0 ? {} : { cause: event.cause }
|
|
1037
|
-
});
|
|
1038
|
-
const unredacted = (event) => ({
|
|
1039
|
-
msg: event.msg,
|
|
1040
|
-
scope,
|
|
1041
|
-
bindings,
|
|
1042
|
-
fields: event.fields ?? {}
|
|
1611
|
+
async function fetchParticipationsPage(api, params) {
|
|
1612
|
+
const pageDto = await api.send({
|
|
1613
|
+
method: "GET",
|
|
1614
|
+
url: "/v1/participations",
|
|
1615
|
+
queryParams: ParticipationsPaginationParams.toQueryParams(params),
|
|
1616
|
+
attributes: Attributes.protected()
|
|
1043
1617
|
});
|
|
1044
|
-
|
|
1045
|
-
child: (binding) => scopedLogger(logger, scope, { ...bindings, ...binding }),
|
|
1046
|
-
debug: (event) => {
|
|
1047
|
-
if (admits("debug")) logger.debug(() => unredacted(event()));
|
|
1048
|
-
},
|
|
1049
|
-
info: (event) => {
|
|
1050
|
-
if (admits("info")) logger.info(() => safe(event()));
|
|
1051
|
-
},
|
|
1052
|
-
warn: (event) => {
|
|
1053
|
-
if (admits("warn")) logger.warn(() => safe(event()));
|
|
1054
|
-
},
|
|
1055
|
-
error: (event) => {
|
|
1056
|
-
if (admits("error")) logger.error(() => safe(event()));
|
|
1057
|
-
},
|
|
1058
|
-
failure: (event, error) => {
|
|
1059
|
-
if (admits("debug"))
|
|
1060
|
-
logger.debug(() => unredacted(verbatim(event(), error)));
|
|
1061
|
-
if (admits("error")) logger.error(() => safe(classified(event(), error)));
|
|
1062
|
-
},
|
|
1063
|
-
warning: (event, error) => {
|
|
1064
|
-
if (admits("debug"))
|
|
1065
|
-
logger.debug(() => unredacted(verbatim(event(), error)));
|
|
1066
|
-
if (admits("warn")) logger.warn(() => safe(classified(event(), error)));
|
|
1067
|
-
},
|
|
1068
|
-
wrap: async (op, params, run) => {
|
|
1069
|
-
const opLog = self.child({ op });
|
|
1070
|
-
opLog.debug(() => ({ msg: "call", fields: { params } }));
|
|
1071
|
-
try {
|
|
1072
|
-
return await run();
|
|
1073
|
-
} catch (error) {
|
|
1074
|
-
opLog.failure(() => ({ msg: "call failed" }), error);
|
|
1075
|
-
throw error;
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
};
|
|
1079
|
-
return self;
|
|
1618
|
+
return PaginatedResponse.fromDto(pageDto, Participation.fromDto);
|
|
1080
1619
|
}
|
|
1081
|
-
function
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1620
|
+
async function fetchParticipation(api, id) {
|
|
1621
|
+
const dto = await api.send({
|
|
1622
|
+
method: "GET",
|
|
1623
|
+
url: `/v1/participations/${id}`,
|
|
1624
|
+
attributes: Attributes.protected()
|
|
1625
|
+
});
|
|
1626
|
+
return Participation.fromDto(dto);
|
|
1086
1627
|
}
|
|
1087
|
-
function
|
|
1088
|
-
|
|
1628
|
+
async function createParticipation(api, params) {
|
|
1629
|
+
const dto = await api.send({
|
|
1630
|
+
method: "POST",
|
|
1631
|
+
url: "/v1/participations",
|
|
1632
|
+
body: CreateParticipationParams.toDto(params),
|
|
1633
|
+
attributes: Attributes.protected()
|
|
1634
|
+
});
|
|
1635
|
+
return Participation.fromDto(dto);
|
|
1089
1636
|
}
|
|
1090
|
-
var noopInternalLogger = {
|
|
1091
|
-
child: () => noopInternalLogger,
|
|
1092
|
-
debug: () => void 0,
|
|
1093
|
-
info: () => void 0,
|
|
1094
|
-
warn: () => void 0,
|
|
1095
|
-
error: () => void 0,
|
|
1096
|
-
failure: () => void 0,
|
|
1097
|
-
warning: () => void 0,
|
|
1098
|
-
wrap: (_op, _params, run) => run()
|
|
1099
|
-
};
|
|
1100
1637
|
|
|
1101
1638
|
// src/universal/core/checkout/coin-list/token-sale-namespace.ts
|
|
1102
1639
|
var CoinListTokenSaleNamespaceImpl = class {
|
|
@@ -1246,8 +1783,14 @@ function assertPriceFits(raw) {
|
|
|
1246
1783
|
}
|
|
1247
1784
|
}
|
|
1248
1785
|
|
|
1786
|
+
// src/universal/core/checkout/ondo/not-tradable.ts
|
|
1787
|
+
var ONDO_NOT_TRADABLE_CODE = "not_tradable";
|
|
1788
|
+
function isOndoNotTradableError(error) {
|
|
1789
|
+
return apiErrorCode(error) === ONDO_NOT_TRADABLE_CODE;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1249
1792
|
// src/universal/core/shared/blockchain/formatters.ts
|
|
1250
|
-
var
|
|
1793
|
+
var import_viem3 = require("viem");
|
|
1251
1794
|
|
|
1252
1795
|
// src/universal/types/blockchain/ui.ts
|
|
1253
1796
|
var FormattedAmountUi = (value) => value;
|
|
@@ -1318,7 +1861,7 @@ function roundFractionHalfUp(integerPart, fractionPart, maxFractionDigits) {
|
|
|
1318
1861
|
};
|
|
1319
1862
|
}
|
|
1320
1863
|
function formatRawAmount(amount) {
|
|
1321
|
-
return (0,
|
|
1864
|
+
return (0, import_viem3.formatUnits)(amount.raw, amount.decimals);
|
|
1322
1865
|
}
|
|
1323
1866
|
function formatCompactAmount(amount, locale) {
|
|
1324
1867
|
const value = Number(formatRawAmount(amount));
|
|
@@ -1422,66 +1965,6 @@ function explorerBaseUrl(chain) {
|
|
|
1422
1965
|
}
|
|
1423
1966
|
}
|
|
1424
1967
|
|
|
1425
|
-
// src/universal/core/shared/blockchain/math.ts
|
|
1426
|
-
var import_viem3 = require("viem");
|
|
1427
|
-
function blockchainAmountFromRawOrThrow({
|
|
1428
|
-
label,
|
|
1429
|
-
raw,
|
|
1430
|
-
decimals
|
|
1431
|
-
}) {
|
|
1432
|
-
const trimmed = raw.trim();
|
|
1433
|
-
if (trimmed === "") {
|
|
1434
|
-
throw new ValidationError(`${label}: not a uint256 integer ("${raw}")`);
|
|
1435
|
-
}
|
|
1436
|
-
let value;
|
|
1437
|
-
try {
|
|
1438
|
-
value = BigInt(trimmed);
|
|
1439
|
-
} catch {
|
|
1440
|
-
throw new ValidationError(`${label}: not a uint256 integer ("${raw}")`);
|
|
1441
|
-
}
|
|
1442
|
-
try {
|
|
1443
|
-
return BlockchainAmount({ raw: assertUint256(value), decimals });
|
|
1444
|
-
} catch {
|
|
1445
|
-
throw new ValidationError(`${label}: out of uint256 bounds (${value})`);
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
function parseBlockchainAmount(amount, decimals) {
|
|
1449
|
-
const trimmed = amount.trim();
|
|
1450
|
-
if (trimmed === "") return { valid: false, reason: { type: "empty" } };
|
|
1451
|
-
if (trimmed.startsWith("-")) {
|
|
1452
|
-
return { valid: false, reason: { type: "negative" } };
|
|
1453
|
-
}
|
|
1454
|
-
if (/[eE]/.test(trimmed)) {
|
|
1455
|
-
return { valid: false, reason: { type: "invalid-format" } };
|
|
1456
|
-
}
|
|
1457
|
-
if (trimmed === ".") {
|
|
1458
|
-
return { valid: false, reason: { type: "invalid-format" } };
|
|
1459
|
-
}
|
|
1460
|
-
const normalised = trimmed.replace(/^\./, "0.").replace(/\.$/, "");
|
|
1461
|
-
if (!/^\d+(\.\d+)?$/.test(normalised)) {
|
|
1462
|
-
return { valid: false, reason: { type: "invalid-format" } };
|
|
1463
|
-
}
|
|
1464
|
-
const [, fraction = ""] = normalised.split(".");
|
|
1465
|
-
if (fraction.length > decimals) {
|
|
1466
|
-
return {
|
|
1467
|
-
valid: false,
|
|
1468
|
-
reason: { type: "too-many-decimals", maxDecimals: decimals }
|
|
1469
|
-
};
|
|
1470
|
-
}
|
|
1471
|
-
try {
|
|
1472
|
-
const raw = (0, import_viem3.parseUnits)(normalised, decimals);
|
|
1473
|
-
if (raw > MAX_UINT_256) {
|
|
1474
|
-
return { valid: false, reason: { type: "overflow" } };
|
|
1475
|
-
}
|
|
1476
|
-
return {
|
|
1477
|
-
valid: true,
|
|
1478
|
-
amount: BlockchainAmount({ raw, decimals })
|
|
1479
|
-
};
|
|
1480
|
-
} catch {
|
|
1481
|
-
return { valid: false, reason: { type: "invalid-format" } };
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
1968
|
// src/universal/types/providers/ondo/ondo.ts
|
|
1486
1969
|
var OndoTradingStatus = {
|
|
1487
1970
|
fromDto: (dto) => {
|
|
@@ -1497,7 +1980,6 @@ var OndoTradingStatus = {
|
|
|
1497
1980
|
};
|
|
1498
1981
|
}
|
|
1499
1982
|
};
|
|
1500
|
-
var decimalOrNull = (value) => value === null ? null : DecimalString(value);
|
|
1501
1983
|
var OndoQuote = {
|
|
1502
1984
|
fromDto: (dto) => {
|
|
1503
1985
|
const assetDecimals = AssetDecimals(dto.asset_decimals);
|
|
@@ -3328,7 +3810,9 @@ var TokenRegistrySnapshot = {
|
|
|
3328
3810
|
}
|
|
3329
3811
|
};
|
|
3330
3812
|
function offerDisplayTokens(offer) {
|
|
3331
|
-
const swaps = offer.tokens.filter(
|
|
3813
|
+
const swaps = offer.tokens.filter(
|
|
3814
|
+
(token) => token.role === "swap" || token.role === "vault"
|
|
3815
|
+
);
|
|
3332
3816
|
const distributions = offer.tokens.filter(
|
|
3333
3817
|
(token) => token.role === "distribution"
|
|
3334
3818
|
);
|
|
@@ -3369,11 +3853,18 @@ var HttpClient = class {
|
|
|
3369
3853
|
);
|
|
3370
3854
|
let response = await this.executeRequest(preparedRequest);
|
|
3371
3855
|
for (const middleware of this.middleware.afterRequest ?? []) {
|
|
3856
|
+
let retried = false;
|
|
3372
3857
|
response = await middleware({
|
|
3373
3858
|
request: preparedRequest,
|
|
3374
3859
|
response,
|
|
3375
|
-
retry: (nextRequest = preparedRequest) =>
|
|
3860
|
+
retry: (nextRequest = preparedRequest) => {
|
|
3861
|
+
retried = true;
|
|
3862
|
+
return this.runRequestWithAfterMiddleware(nextRequest);
|
|
3863
|
+
}
|
|
3376
3864
|
});
|
|
3865
|
+
if (retried) {
|
|
3866
|
+
return response;
|
|
3867
|
+
}
|
|
3377
3868
|
}
|
|
3378
3869
|
return response;
|
|
3379
3870
|
}
|
|
@@ -3847,6 +4338,27 @@ var RedactedWalletError = {
|
|
|
3847
4338
|
fromWalletError: (error) => error.type === "unknown" ? { type: "unknown" } : error
|
|
3848
4339
|
};
|
|
3849
4340
|
|
|
4341
|
+
// src/universal/types/blockchain/wallet-selection.ts
|
|
4342
|
+
var WalletSelection = {
|
|
4343
|
+
/**
|
|
4344
|
+
* Every wallet in display order - embedded first, then the external one -
|
|
4345
|
+
* each address once. Addresses compare case-insensitively, so a host that
|
|
4346
|
+
* hands the same wallet over as both embedded and external sees it once.
|
|
4347
|
+
*/
|
|
4348
|
+
all: (selection) => {
|
|
4349
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4350
|
+
return [
|
|
4351
|
+
...selection.embedded,
|
|
4352
|
+
...selection.external === null ? [] : [selection.external]
|
|
4353
|
+
].filter((wallet) => {
|
|
4354
|
+
const key = wallet.address.toLowerCase();
|
|
4355
|
+
if (seen.has(key)) return false;
|
|
4356
|
+
seen.add(key);
|
|
4357
|
+
return true;
|
|
4358
|
+
});
|
|
4359
|
+
}
|
|
4360
|
+
};
|
|
4361
|
+
|
|
3850
4362
|
// src/universal/types/oauth-session.ts
|
|
3851
4363
|
var ClientCredentialsOAuth = (value) => value;
|
|
3852
4364
|
var OAuthRefreshToken = (value) => value;
|
|
@@ -3863,6 +4375,54 @@ var OAuthSession = {
|
|
|
3863
4375
|
}
|
|
3864
4376
|
};
|
|
3865
4377
|
|
|
4378
|
+
// src/universal/types/time.ts
|
|
4379
|
+
var MAX_EPOCH_MILLIS = 864e13;
|
|
4380
|
+
var EpochMillis = {
|
|
4381
|
+
/**
|
|
4382
|
+
* @throws {@link ValidationError} unless `value` is an integer a `Date` can
|
|
4383
|
+
* represent: at most {@link MAX_EPOCH_MILLIS} either side of the epoch.
|
|
4384
|
+
*/
|
|
4385
|
+
of: (value) => {
|
|
4386
|
+
if (!Number.isInteger(value) || Math.abs(value) > MAX_EPOCH_MILLIS) {
|
|
4387
|
+
throw new ValidationError(
|
|
4388
|
+
`EpochMillis must be an integer within \xB1${MAX_EPOCH_MILLIS}, got ${value}`
|
|
4389
|
+
);
|
|
4390
|
+
}
|
|
4391
|
+
return value;
|
|
4392
|
+
},
|
|
4393
|
+
/** The wall clock. Code that needs the time takes a `TimeEff` instead. */
|
|
4394
|
+
now: () => EpochMillis.of(Date.now()),
|
|
4395
|
+
/** @throws {@link ValidationError} for an invalid `Date`. */
|
|
4396
|
+
fromDate: (date) => EpochMillis.of(date.getTime()),
|
|
4397
|
+
/** How long after `from` the instant `to` is; negative if it is before. */
|
|
4398
|
+
elapsed: (from, to) => Millis.of(to - from),
|
|
4399
|
+
plus: (at, duration) => EpochMillis.of(at + duration)
|
|
4400
|
+
};
|
|
4401
|
+
var Millis = {
|
|
4402
|
+
of: (value) => value
|
|
4403
|
+
};
|
|
4404
|
+
var Seconds = {
|
|
4405
|
+
/**
|
|
4406
|
+
* @throws {@link ValidationError} unless `value` is a non-negative integer.
|
|
4407
|
+
*/
|
|
4408
|
+
of: (value) => {
|
|
4409
|
+
if (!Number.isInteger(value) || value < 0) {
|
|
4410
|
+
throw new ValidationError(
|
|
4411
|
+
`Seconds must be a non-negative integer, got ${value}`
|
|
4412
|
+
);
|
|
4413
|
+
}
|
|
4414
|
+
return value;
|
|
4415
|
+
},
|
|
4416
|
+
toMillis: (value) => Millis.of(value * 1e3)
|
|
4417
|
+
};
|
|
4418
|
+
function isExpired({
|
|
4419
|
+
expiresAt,
|
|
4420
|
+
now,
|
|
4421
|
+
buffer = Millis.of(0)
|
|
4422
|
+
}) {
|
|
4423
|
+
return now >= expiresAt - buffer;
|
|
4424
|
+
}
|
|
4425
|
+
|
|
3866
4426
|
// src/universal/types/user.ts
|
|
3867
4427
|
var UserId = (value) => value;
|
|
3868
4428
|
var UserEmail = (value) => value;
|
|
@@ -3881,11 +4441,24 @@ var User = {
|
|
|
3881
4441
|
AssetIconUrl,
|
|
3882
4442
|
AssetId,
|
|
3883
4443
|
AssetSymbol,
|
|
4444
|
+
AsyncOfferDetail,
|
|
3884
4445
|
AuthorizationCode,
|
|
3885
4446
|
BPS_DENOM,
|
|
3886
4447
|
Blockchain,
|
|
3887
4448
|
BlockchainAmount,
|
|
3888
4449
|
Bps,
|
|
4450
|
+
CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT,
|
|
4451
|
+
CENTRIFUGE_POLL_INTERVAL_MS,
|
|
4452
|
+
CentrifugeNamespaceImpl,
|
|
4453
|
+
CentrifugeVaultBuyTransaction,
|
|
4454
|
+
CentrifugeVaultClaimProceedsTransaction,
|
|
4455
|
+
CentrifugeVaultClaimTransaction,
|
|
4456
|
+
CentrifugeVaultLeg,
|
|
4457
|
+
CentrifugeVaultLegId,
|
|
4458
|
+
CentrifugeVaultPosition,
|
|
4459
|
+
CentrifugeVaultQuote,
|
|
4460
|
+
CentrifugeVaultRedeemPosition,
|
|
4461
|
+
CentrifugeVaultStatus,
|
|
3889
4462
|
Chain,
|
|
3890
4463
|
ClientCredentialsOAuth,
|
|
3891
4464
|
ClientId,
|
|
@@ -3905,6 +4478,7 @@ var User = {
|
|
|
3905
4478
|
DocumentSubmission,
|
|
3906
4479
|
ERC20_ABI,
|
|
3907
4480
|
ETHEREUM_CHAINS,
|
|
4481
|
+
EpochMillis,
|
|
3908
4482
|
Erc20NamespaceImpl,
|
|
3909
4483
|
EthereumChain,
|
|
3910
4484
|
EvmContractAddress,
|
|
@@ -3925,11 +4499,13 @@ var User = {
|
|
|
3925
4499
|
MAX_UINT_256,
|
|
3926
4500
|
MathError,
|
|
3927
4501
|
Milestone,
|
|
4502
|
+
Millis,
|
|
3928
4503
|
NA_AMOUNT_ASSET_UI,
|
|
3929
4504
|
NotAuthenticatedError,
|
|
3930
4505
|
NotImplementedError,
|
|
3931
4506
|
OAuthRefreshToken,
|
|
3932
4507
|
OAuthSession,
|
|
4508
|
+
ONDO_NOT_TRADABLE_CODE,
|
|
3933
4509
|
ONDO_POLL_INTERVAL_MS,
|
|
3934
4510
|
ONDO_QUOTE_MAX_TTL_MS,
|
|
3935
4511
|
ONDO_SETTLEMENT_ASSET,
|
|
@@ -3946,6 +4522,7 @@ var User = {
|
|
|
3946
4522
|
OfferSlug,
|
|
3947
4523
|
OfferSwapContract,
|
|
3948
4524
|
OfferToken,
|
|
4525
|
+
OfferVaultContract,
|
|
3949
4526
|
OffersNamespaceImpl,
|
|
3950
4527
|
OndoBuyTransaction,
|
|
3951
4528
|
OndoNamespaceImpl,
|
|
@@ -3977,6 +4554,7 @@ var User = {
|
|
|
3977
4554
|
SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA,
|
|
3978
4555
|
SWAP_LEVEL,
|
|
3979
4556
|
SWAP_POLL_INTERVAL_MS,
|
|
4557
|
+
Seconds,
|
|
3980
4558
|
ShortenedWalletAddress,
|
|
3981
4559
|
SolanaChain,
|
|
3982
4560
|
StablecoinSymbol,
|
|
@@ -4003,6 +4581,7 @@ var User = {
|
|
|
4003
4581
|
ValidationError,
|
|
4004
4582
|
WalletAddress,
|
|
4005
4583
|
WalletOwnershipChallenge,
|
|
4584
|
+
WalletSelection,
|
|
4006
4585
|
WalletsNamespaceImpl,
|
|
4007
4586
|
apiErrorCode,
|
|
4008
4587
|
applyBps,
|
|
@@ -4027,12 +4606,15 @@ var User = {
|
|
|
4027
4606
|
getChainId,
|
|
4028
4607
|
getNetworkName,
|
|
4029
4608
|
isChain,
|
|
4609
|
+
isExpired,
|
|
4030
4610
|
isOfferType,
|
|
4611
|
+
isOndoNotTradableError,
|
|
4031
4612
|
isSwapAvailable,
|
|
4032
4613
|
offerDisplayTokens,
|
|
4033
4614
|
ondoQuoteOfferDeadline,
|
|
4034
4615
|
parseBlockchainAmount,
|
|
4035
4616
|
parseUint256,
|
|
4617
|
+
resolveCentrifugeVaults,
|
|
4036
4618
|
shortenAddress,
|
|
4037
4619
|
superstateSwapContractAddress,
|
|
4038
4620
|
swapSpender,
|