@coinlist-co/react 0.12.2-rc.e1f6c82 → 0.12.2

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.
@@ -1,93 +1,4 @@
1
- // src/universal/api/internal-access-token-source.ts
2
- var SentWith = {
3
- userToken: (token) => ({
4
- type: "user-token",
5
- token
6
- }),
7
- noUserToken: { type: "no-user-token" }
8
- };
9
- var TokenTrigger = {
10
- beforeRequest: { type: "before-request" },
11
- after401: (rejected) => ({
12
- type: "after-401",
13
- rejected
14
- })
15
- };
16
- function isRejectedToken(token, rejected) {
17
- switch (rejected.type) {
18
- case "user-token":
19
- return rejected.token.value === token.value;
20
- case "no-user-token":
21
- return false;
22
- }
23
- }
24
-
25
- // src/universal/api/http-attributes.ts
26
- var empty = {};
27
- var concat = (left, right) => ({
28
- ...left,
29
- ...right
30
- });
31
- var concatAll = (...items) => {
32
- let result = empty;
33
- for (const item of items) {
34
- result = concat(result, item);
35
- }
36
- return result;
37
- };
38
- var protectedRequest = () => ({ protected: true });
39
- var userAgent = () => ({ userAgent: true });
40
- var idempotencyKey = () => ({
41
- idempotencyKey: true
42
- });
43
- var clientCredentials = (credentials) => ({
44
- clientCredentials: credentials
45
- });
46
- var retryAttempt = (attempt) => ({
47
- retryAttempt: attempt
48
- });
49
- var renewAttempted = (value) => ({
50
- renewAttempted: value
51
- });
52
- var notRetryable = () => ({ retryable: false });
53
- var sentWith = (token) => ({
54
- sentWith: token
55
- });
56
- var requestId = (id) => ({ requestId: id });
57
- var getRequestId = (attrs) => attrs?.requestId ?? null;
58
- var isProtected = (attrs) => attrs?.protected === true;
59
- var needUserAgent = (attrs) => attrs?.userAgent === true;
60
- var isIdempotent = (attrs) => attrs?.idempotencyKey === true;
61
- var getRetryAttempt = (attrs) => attrs?.retryAttempt ?? 0;
62
- var wasRenewAttempted = (attrs) => attrs?.renewAttempted === true;
63
- var isRetryable = (attrs) => attrs?.retryable !== false;
64
- var getSentWith = (attrs) => attrs?.sentWith === void 0 ? SentWith.noUserToken : SentWith.userToken(attrs.sentWith);
65
- var getClientCredentials = (attrs) => attrs?.clientCredentials;
66
- var Attributes = {
67
- empty,
68
- concat,
69
- concatAll,
70
- protected: protectedRequest,
71
- isProtected,
72
- userAgent,
73
- needUserAgent,
74
- idempotencyKey,
75
- isIdempotent,
76
- retryAttempt,
77
- getRetryAttempt,
78
- renewAttempted,
79
- wasRenewAttempted,
80
- notRetryable,
81
- isRetryable,
82
- sentWith,
83
- getSentWith,
84
- clientCredentials,
85
- getClientCredentials,
86
- requestId,
87
- getRequestId
88
- };
89
-
90
- // src/universal/api/http.ts
1
+ // src/universal/types/http.ts
91
2
  var HttpError = class extends Error {
92
3
  constructor(response) {
93
4
  super(`Request failed with ${response.status} status`);
@@ -112,104 +23,6 @@ function apiErrorCode(error) {
112
23
  const code = body.code;
113
24
  return typeof code === "string" ? code : null;
114
25
  }
115
- async function makeRequest(request) {
116
- const headers = {
117
- Accept: "application/json",
118
- ...request.method === "POST" && request.body !== void 0 ? { "Content-Type": "application/json" } : {},
119
- ...request.headers ?? {}
120
- };
121
- const init = {
122
- method: request.method,
123
- headers,
124
- ...request.redirect !== void 0 ? { redirect: request.redirect } : {}
125
- };
126
- if (request.method === "POST" && request.body !== void 0) {
127
- init.body = JSON.stringify(request.body);
128
- }
129
- const response = await fetch(
130
- buildUrlWithQueryParams(request.url, request.queryParams),
131
- init
132
- );
133
- const responseHeaders = headersToRecord(response.headers);
134
- if (response.status === 204 || response.status === 205) {
135
- return {
136
- status: response.status,
137
- body: null,
138
- headers: responseHeaders
139
- };
140
- }
141
- if (response.status >= 300 && response.status < 400) {
142
- await response.text();
143
- return {
144
- status: response.status,
145
- body: null,
146
- headers: responseHeaders
147
- };
148
- }
149
- const text = await response.text();
150
- let body;
151
- try {
152
- body = text ? JSON.parse(text) : null;
153
- } catch (_) {
154
- throw new HttpError({
155
- status: response.status,
156
- headers: responseHeaders,
157
- body: text
158
- });
159
- }
160
- return {
161
- status: response.status,
162
- body,
163
- headers: responseHeaders
164
- };
165
- }
166
- function buildUrlWithQueryParams(url, queryParams) {
167
- if (!queryParams) {
168
- return url;
169
- }
170
- const searchParams = new URLSearchParams();
171
- for (const [key, value] of Object.entries(queryParams)) {
172
- if (value === void 0 || value === null) {
173
- continue;
174
- }
175
- if (Array.isArray(value)) {
176
- for (const item of value) {
177
- if (item === void 0 || item === null) {
178
- continue;
179
- }
180
- searchParams.append(key, String(item));
181
- }
182
- continue;
183
- }
184
- searchParams.append(key, String(value));
185
- }
186
- const queryString = searchParams.toString();
187
- if (!queryString) {
188
- return url;
189
- }
190
- return url.includes("?") ? `${url}&${queryString}` : `${url}?${queryString}`;
191
- }
192
- function headersToRecord(headers) {
193
- const record = {};
194
- headers.forEach((value, key) => {
195
- record[key.toLowerCase()] = value;
196
- });
197
- return record;
198
- }
199
- function concatAttributes(request, attrs) {
200
- const nextAttributes = Attributes.concat(
201
- request.attributes ?? Attributes.empty,
202
- attrs
203
- );
204
- const nextRequest = {
205
- ...request,
206
- attributes: nextAttributes
207
- };
208
- return nextRequest;
209
- }
210
- var Request = {
211
- concatAttributes
212
- };
213
26
 
214
27
  // src/universal/types/errors.ts
215
28
  var NotImplementedError = class extends Error {
@@ -291,6 +104,75 @@ function isExpired({
291
104
  return now >= expiresAt - buffer;
292
105
  }
293
106
 
107
+ // src/universal/types/blockchain/ui.ts
108
+ var FormattedAmountUi = (value) => value;
109
+ var FormattedPercentUi = (value) => value;
110
+ var TxExplorerUrl = (value) => value;
111
+ var ShortenedWalletAddress = (value) => value;
112
+ var FormattedAmountAssetUi = (value) => value;
113
+ var AssetIconUrl = (value) => value;
114
+
115
+ // src/universal/core/shared/blockchain/chain.ts
116
+ import { base, baseSepolia, mainnet, sepolia } from "viem/chains";
117
+ var VIEM_CHAINS = {
118
+ ethereum_mainnet: mainnet,
119
+ ethereum_sepolia: sepolia,
120
+ base_mainnet: base,
121
+ base_sepolia: baseSepolia
122
+ };
123
+ function viemChain(chain) {
124
+ return VIEM_CHAINS[chain];
125
+ }
126
+ function getChainId(chain) {
127
+ return VIEM_CHAINS[chain].id;
128
+ }
129
+ function chainFromId(chainId) {
130
+ const chains = Object.keys(VIEM_CHAINS);
131
+ const chain = chains.find((c) => String(VIEM_CHAINS[c].id) === chainId);
132
+ if (!chain) {
133
+ throw new ValidationError(`Unsupported EIP-155 chain id: "${chainId}"`);
134
+ }
135
+ return chain;
136
+ }
137
+ function contractOn(contracts, chain) {
138
+ return contracts.find((contract) => contract.chain === chain)?.address ?? null;
139
+ }
140
+ function getNetworkName(chain) {
141
+ switch (chain) {
142
+ case "ethereum_mainnet":
143
+ return "Ethereum";
144
+ case "ethereum_sepolia":
145
+ return "Ethereum Sepolia";
146
+ case "base_mainnet":
147
+ return "Base";
148
+ case "base_sepolia":
149
+ return "Base Sepolia";
150
+ default: {
151
+ const _exhaustive = chain;
152
+ return _exhaustive;
153
+ }
154
+ }
155
+ }
156
+ function txExplorerUrl(chain, txHash) {
157
+ return TxExplorerUrl(`${explorerBaseUrl(chain)}/tx/${txHash}`);
158
+ }
159
+ function explorerBaseUrl(chain) {
160
+ switch (chain) {
161
+ case "ethereum_mainnet":
162
+ return "https://etherscan.io";
163
+ case "ethereum_sepolia":
164
+ return "https://sepolia.etherscan.io";
165
+ case "base_mainnet":
166
+ return "https://basescan.org";
167
+ case "base_sepolia":
168
+ return "https://sepolia-explorer.base.org";
169
+ default: {
170
+ const _exhaustive = chain;
171
+ return _exhaustive;
172
+ }
173
+ }
174
+ }
175
+
294
176
  // src/universal/types/blockchain/core.ts
295
177
  var ETHEREUM_CHAINS = {
296
178
  ethereum_mainnet: true,
@@ -421,6 +303,36 @@ function blockchainAmountFromRawOrThrow({
421
303
  throw new ValidationError(`${label}: out of uint256 bounds (${value})`);
422
304
  }
423
305
  }
306
+ function positiveAmountFromRawOrThrow({
307
+ label,
308
+ raw,
309
+ decimals,
310
+ reason
311
+ }) {
312
+ const amount = blockchainAmountFromRawOrThrow({ label, raw, decimals });
313
+ if (amount.raw === 0n) {
314
+ throw new ValidationError(
315
+ `${label}: must be greater than zero ("${raw}") - ${reason}`
316
+ );
317
+ }
318
+ return amount;
319
+ }
320
+ function pricePerShare({
321
+ usd,
322
+ shares
323
+ }) {
324
+ const price = BlockchainAmount.div(usd, shares);
325
+ return BlockchainAmount({
326
+ raw: assertPriceFits(price.raw),
327
+ decimals: price.decimals
328
+ });
329
+ }
330
+ function assertPriceFits(raw) {
331
+ if (raw > MAX_UINT_256) {
332
+ throw new MathError(`Price per share: out of uint256 bounds (${raw})`);
333
+ }
334
+ return raw;
335
+ }
424
336
  function parseBlockchainAmount(amount, decimals) {
425
337
  const trimmed = amount.trim();
426
338
  if (trimmed === "") return { valid: false, reason: { type: "empty" } };
@@ -534,10 +446,13 @@ function requiredDate(value, field) {
534
446
  return date;
535
447
  }
536
448
  function dateOrNull(value, field) {
537
- return value === null ? null : requiredDate(value, field);
449
+ return mapNullish(value, (date) => requiredDate(date, field));
538
450
  }
539
451
  function decimalOrNull(value) {
540
- return value === null ? null : DecimalString(value);
452
+ return mapNullish(value, DecimalString);
453
+ }
454
+ function mapNullish(value, parse) {
455
+ return value === null || value === void 0 ? null : parse(value);
541
456
  }
542
457
  function requiredArray(value, field) {
543
458
  if (!Array.isArray(value)) {
@@ -547,6 +462,12 @@ function requiredArray(value, field) {
547
462
  }
548
463
  return value;
549
464
  }
465
+ function txFromWire(wire) {
466
+ return {
467
+ to: EvmContractAddress(wire.to),
468
+ data: HexEncodedTransactionData(wire.data)
469
+ };
470
+ }
550
471
 
551
472
  // src/universal/types/providers/centrifuge/centrifuge.ts
552
473
  var CentrifugeVaultStatus = {
@@ -575,19 +496,16 @@ var CentrifugeVaultStatus = {
575
496
  };
576
497
  var CentrifugeVaultBuyTransaction = {
577
498
  fromDto: (dto) => {
578
- const spendInputAmount = blockchainAmountFromRawOrThrow({
579
- label: "spend_input_amount",
580
- raw: dto.spend_input_amount,
581
- decimals: AssetDecimals(dto.spend_input_decimals)
582
- });
583
- if (spendInputAmount.raw <= 0n) {
584
- throw new ValidationError(
585
- `spend_input_amount: must be greater than zero ("${dto.spend_input_amount}") - a deposit of nothing is not a request`
586
- );
587
- }
588
499
  return {
589
500
  ...parseTransactionCore(dto, "CentrifugeVaultBuyTransaction"),
590
- spendInputAmount
501
+ spendInputAmount: positiveAmountFromRawOrThrow({
502
+ label: "spend_input_amount",
503
+ raw: dto.spend_input_amount,
504
+ decimals: AssetDecimals(dto.spend_input_decimals),
505
+ // Frontline refuses an `amount` of zero, so a zero here is a changed
506
+ // encoding, not a small deposit - and not calldata worth signing.
507
+ reason: "a deposit of nothing is not a request"
508
+ })
591
509
  };
592
510
  }
593
511
  };
@@ -671,14 +589,114 @@ function parseOrderability(canOrder, reasons, model) {
671
589
  }
672
590
  function parseTransactionCore(dto, model) {
673
591
  return {
674
- tx: {
675
- to: EvmContractAddress(dto.to),
676
- data: HexEncodedTransactionData(dto.data)
677
- },
592
+ tx: txFromWire(dto),
678
593
  expiresAt: dateOrNull(dto.expires_at, `${model}.expires_at`)
679
594
  };
680
595
  }
681
596
 
597
+ // src/universal/api/frontline/providers/shared/spend-scale.ts
598
+ function assertSpendScaleAgrees({
599
+ published,
600
+ sized,
601
+ trade,
602
+ note
603
+ }) {
604
+ if (published === sized.decimals) return;
605
+ const because = note === void 0 ? "" : ` - ${note}`;
606
+ throw new ValidationError(
607
+ `spend_input_decimals: the ${trade} was priced in ${published} decimals but the order was sized in ${sized.decimals}${because}`
608
+ );
609
+ }
610
+
611
+ // src/universal/types/access-token-source.ts
612
+ var SentWith = {
613
+ userToken: (token) => ({
614
+ type: "user-token",
615
+ token
616
+ }),
617
+ noUserToken: { type: "no-user-token" }
618
+ };
619
+ var TokenTrigger = {
620
+ beforeRequest: { type: "before-request" },
621
+ after401: (rejected) => ({
622
+ type: "after-401",
623
+ rejected
624
+ })
625
+ };
626
+ function isRejectedToken(token, rejected) {
627
+ switch (rejected.type) {
628
+ case "user-token":
629
+ return rejected.token.value === token.value;
630
+ case "no-user-token":
631
+ return false;
632
+ }
633
+ }
634
+
635
+ // src/universal/api/http-attributes.ts
636
+ var empty = {};
637
+ var concat = (left, right) => ({
638
+ ...left,
639
+ ...right
640
+ });
641
+ var concatAll = (...items) => {
642
+ let result = empty;
643
+ for (const item of items) {
644
+ result = concat(result, item);
645
+ }
646
+ return result;
647
+ };
648
+ var protectedRequest = () => ({ protected: true });
649
+ var userAgent = () => ({ userAgent: true });
650
+ var idempotencyKey = () => ({
651
+ idempotencyKey: true
652
+ });
653
+ var clientCredentials = (credentials) => ({
654
+ clientCredentials: credentials
655
+ });
656
+ var retryAttempt = (attempt) => ({
657
+ retryAttempt: attempt
658
+ });
659
+ var renewAttempted = (value) => ({
660
+ renewAttempted: value
661
+ });
662
+ var notRetryable = () => ({ retryable: false });
663
+ var sentWith = (token) => ({
664
+ sentWith: token
665
+ });
666
+ var requestId = (id) => ({ requestId: id });
667
+ var getRequestId = (attrs) => attrs?.requestId ?? null;
668
+ var isProtected = (attrs) => attrs?.protected === true;
669
+ var needUserAgent = (attrs) => attrs?.userAgent === true;
670
+ var isIdempotent = (attrs) => attrs?.idempotencyKey === true;
671
+ var getRetryAttempt = (attrs) => attrs?.retryAttempt ?? 0;
672
+ var wasRenewAttempted = (attrs) => attrs?.renewAttempted === true;
673
+ var isRetryable = (attrs) => attrs?.retryable !== false;
674
+ var getSentWith = (attrs) => attrs?.sentWith === void 0 ? SentWith.noUserToken : SentWith.userToken(attrs.sentWith);
675
+ var getClientCredentials = (attrs) => attrs?.clientCredentials;
676
+ var Attributes = {
677
+ empty,
678
+ concat,
679
+ concatAll,
680
+ protected: protectedRequest,
681
+ isProtected,
682
+ userAgent,
683
+ needUserAgent,
684
+ idempotencyKey,
685
+ isIdempotent,
686
+ retryAttempt,
687
+ getRetryAttempt,
688
+ renewAttempted,
689
+ wasRenewAttempted,
690
+ notRetryable,
691
+ isRetryable,
692
+ sentWith,
693
+ getSentWith,
694
+ clientCredentials,
695
+ getClientCredentials,
696
+ requestId,
697
+ getRequestId
698
+ };
699
+
682
700
  // src/universal/api/frontline/providers/centrifuge/centrifuge.ts
683
701
  async function getCentrifugeVaultStatus(api, params) {
684
702
  const dto = await api.send({
@@ -702,11 +720,11 @@ async function buildCentrifugeVaultBuy(api, params) {
702
720
  },
703
721
  attributes: Attributes.protected()
704
722
  });
705
- if (dto.spend_input_decimals !== params.amount.decimals) {
706
- throw new ValidationError(
707
- `spend_input_decimals: the request was priced in ${dto.spend_input_decimals} decimals but the deposit was sized in ${params.amount.decimals}`
708
- );
709
- }
723
+ assertSpendScaleAgrees({
724
+ published: dto.spend_input_decimals,
725
+ sized: params.amount,
726
+ trade: "deposit"
727
+ });
710
728
  return CentrifugeVaultBuyTransaction.fromDto(dto);
711
729
  }
712
730
  async function createCentrifugeVaultClaim(api, params) {
@@ -735,7 +753,7 @@ function walletFields(params) {
735
753
  };
736
754
  }
737
755
 
738
- // src/universal/core/checkout/centrifuge/blockchain/abi.ts
756
+ // src/universal/core/providers/centrifuge/blockchain/abi.ts
739
757
  var CENTRIFUGE_PROXY_ABI = [
740
758
  {
741
759
  type: "function",
@@ -998,7 +1016,7 @@ var noopInternalLogger = {
998
1016
  wrap: (_op, _params, run) => run()
999
1017
  };
1000
1018
 
1001
- // src/universal/core/checkout/centrifuge/centrifuge-namespace.ts
1019
+ // src/universal/core/providers/centrifuge/centrifuge-namespace.ts
1002
1020
  var CentrifugeNamespaceImpl = class {
1003
1021
  constructor(ctx) {
1004
1022
  this.ctx = ctx;
@@ -1044,14 +1062,6 @@ var CentrifugeNamespaceImpl = class {
1044
1062
  }
1045
1063
  };
1046
1064
 
1047
- // src/universal/types/blockchain/ui.ts
1048
- var FormattedAmountUi = (value) => value;
1049
- var FormattedPercentUi = (value) => value;
1050
- var TxExplorerUrl = (value) => value;
1051
- var ShortenedWalletAddress = (value) => value;
1052
- var FormattedAmountAssetUi = (value) => value;
1053
- var AssetIconUrl = (value) => value;
1054
-
1055
1065
  // src/universal/core/shared/blockchain/formatters.ts
1056
1066
  import { formatUnits } from "viem";
1057
1067
  function shortenAddress(address) {
@@ -1160,6 +1170,38 @@ function formattedUsdPrice(amount, locale) {
1160
1170
  );
1161
1171
  }
1162
1172
 
1173
+ // src/universal/types/pagination.ts
1174
+ var Cursor = (value) => value;
1175
+ var PaginatedResponse = {
1176
+ fromDto: (dto, itemMapper) => PaginatedResponse.fromDtoPage(dto, (items) => items.map(itemMapper)),
1177
+ /**
1178
+ * For a mapper that decides the page as a whole - one that drops items it
1179
+ * cannot map, such as `Offer.listFromDto` - rather than item by item. The
1180
+ * cursors are the wire's either way: dropping an item changes what the
1181
+ * page holds, not where the next page starts.
1182
+ */
1183
+ fromDtoPage: (dto, pageMapper) => ({
1184
+ data: pageMapper(dto.data),
1185
+ startingAfter: dto.starting_after ? Cursor(dto.starting_after) : null,
1186
+ startingBefore: dto.starting_before ? Cursor(dto.starting_before) : null
1187
+ })
1188
+ };
1189
+ var PaginationParams = {
1190
+ toQueryParams: (params) => {
1191
+ const queryParams = {};
1192
+ if (params.after) {
1193
+ queryParams.starting_after = params.after;
1194
+ }
1195
+ if (params.before) {
1196
+ queryParams.starting_before = params.before;
1197
+ }
1198
+ if (params.limit) {
1199
+ queryParams.limit = params.limit;
1200
+ }
1201
+ return queryParams;
1202
+ }
1203
+ };
1204
+
1163
1205
  // src/universal/types/asset.ts
1164
1206
  var AssetId = (value) => value;
1165
1207
  var AssetCode = (value) => value;
@@ -1269,7 +1311,7 @@ var Isin = (value) => value;
1269
1311
  var AsyncOfferDetail = {
1270
1312
  /**
1271
1313
  * Narrows an offer fetched generically, e.g. on an offer page, to one with
1272
- * something to claim.
1314
+ * a second leg to show.
1273
1315
  *
1274
1316
  * An exhaustive `switch` rather than a list of async types, so a new offer
1275
1317
  * type is a compile error here until someone decides whether it settles
@@ -1278,10 +1320,10 @@ var AsyncOfferDetail = {
1278
1320
  is: (offer) => {
1279
1321
  switch (offer.type) {
1280
1322
  case "centrifuge::vault":
1323
+ case "coinlist::token_sale":
1281
1324
  return true;
1282
1325
  case "ondo::swap":
1283
1326
  case "superstate::swap":
1284
- case "coinlist::token_sale":
1285
1327
  return false;
1286
1328
  default: {
1287
1329
  const exhaustive = offer;
@@ -1311,6 +1353,17 @@ var OfferVaultContract = {
1311
1353
  */
1312
1354
  listFromDto: (dtos) => dtos.filter((dto) => isChain(dto.chain)).map(OfferVaultContract.fromDto)
1313
1355
  };
1356
+ var OfferFundingContract = {
1357
+ fromDto: (dto) => ({
1358
+ chain: Chain(dto.chain),
1359
+ address: EvmContractAddress(dto.address)
1360
+ }),
1361
+ /**
1362
+ * Drops every contract on a chain this SDK does not name, as
1363
+ * {@link OfferVaultContract.listFromDto} does.
1364
+ */
1365
+ listFromDto: (dtos) => dtos.filter((dto) => isChain(dto.chain)).map(OfferFundingContract.fromDto)
1366
+ };
1314
1367
  var OfferDetail = {
1315
1368
  fromDto: (dto) => {
1316
1369
  const fundingAssets = requiredArray(
@@ -1352,7 +1405,15 @@ var OfferDetail = {
1352
1405
  ...base2,
1353
1406
  ...OfferEditorial.fromDto(dto, "OfferDetail"),
1354
1407
  type: dto.type,
1355
- logoUrl: requiredString(dto.logo_url, "OfferDetail.logo_url")
1408
+ logoUrl: requiredString(dto.logo_url, "OfferDetail.logo_url"),
1409
+ // `[]` is fine and a missing key is not, as for `swap_contracts`:
1410
+ // this is the spender a participation's approval names.
1411
+ fundingContracts: OfferFundingContract.listFromDto(
1412
+ requiredArray(
1413
+ dto.funding_contracts,
1414
+ "OfferDetail.funding_contracts"
1415
+ )
1416
+ )
1356
1417
  };
1357
1418
  case "superstate::swap":
1358
1419
  return {
@@ -1423,47 +1484,13 @@ var TermItem = {
1423
1484
  var Milestone = {
1424
1485
  fromDto: (dto) => ({
1425
1486
  name: notBlankStringOrNull(dto.name),
1426
- schedule: notBlankStringOrNull(dto.schedule),
1427
- status: dto.status
1428
- })
1429
- };
1430
-
1431
- // src/universal/types/pagination.ts
1432
- var Cursor = (value) => value;
1433
- var PaginatedResponse = {
1434
- fromDto: (dto, itemMapper) => PaginatedResponse.fromDtoPage(dto, (items) => items.map(itemMapper)),
1435
- /**
1436
- * For a mapper that decides the page as a whole - one that drops items it
1437
- * cannot map, such as `Offer.listFromDto` - rather than item by item. The
1438
- * cursors are the wire's either way: dropping an item changes what the
1439
- * page holds, not where the next page starts.
1440
- */
1441
- fromDtoPage: (dto, pageMapper) => ({
1442
- data: pageMapper(dto.data),
1443
- startingAfter: dto.starting_after ? Cursor(dto.starting_after) : null,
1444
- startingBefore: dto.starting_before ? Cursor(dto.starting_before) : null
1487
+ schedule: notBlankStringOrNull(dto.schedule),
1488
+ status: dto.status
1445
1489
  })
1446
1490
  };
1447
- var PaginationParams = {
1448
- toQueryParams: (params) => {
1449
- const queryParams = {};
1450
- if (params.after) {
1451
- queryParams.starting_after = params.after;
1452
- }
1453
- if (params.before) {
1454
- queryParams.starting_before = params.before;
1455
- }
1456
- if (params.limit) {
1457
- queryParams.limit = params.limit;
1458
- }
1459
- return queryParams;
1460
- }
1461
- };
1462
1491
 
1463
1492
  // src/universal/types/providers/coin-list/token-sale.ts
1464
1493
  var ParticipationId = (value) => value;
1465
- var Blockchain = (value) => value;
1466
- var WalletAddress = (value) => value;
1467
1494
  var ParticipationsPaginationParams = {
1468
1495
  toQueryParams: (params) => {
1469
1496
  const queryParams = PaginationParams.toQueryParams(params);
@@ -1487,10 +1514,10 @@ var Participation = {
1487
1514
  amount: dto.amount,
1488
1515
  displayAmount: dto.amount_string,
1489
1516
  asset: Asset.fromDto(dto.asset),
1490
- chain: Blockchain(dto.chain),
1517
+ chain: isChain(dto.chain) ? dto.chain : null,
1491
1518
  insertedAt: dto.inserted_at ? new Date(dto.inserted_at) : null,
1492
1519
  updatedAt: dto.updated_at ? new Date(dto.updated_at) : null,
1493
- walletAddress: walletAddress ? WalletAddress(walletAddress) : null
1520
+ walletAddress: walletAddress ? EvmWalletAddress(walletAddress) : null
1494
1521
  };
1495
1522
  }
1496
1523
  };
@@ -1557,7 +1584,7 @@ async function createParticipation(api, params) {
1557
1584
  return Participation.fromDto(dto);
1558
1585
  }
1559
1586
 
1560
- // src/universal/core/checkout/coin-list/token-sale-namespace.ts
1587
+ // src/universal/core/providers/coin-list/token-sale-namespace.ts
1561
1588
  var CoinListTokenSaleNamespaceImpl = class {
1562
1589
  constructor(ctx) {
1563
1590
  this.ctx = ctx;
@@ -1589,64 +1616,6 @@ var CoinListTokenSaleNamespaceImpl = class {
1589
1616
  }
1590
1617
  };
1591
1618
 
1592
- // src/universal/core/shared/blockchain/chain.ts
1593
- import { base, baseSepolia, mainnet, sepolia } from "viem/chains";
1594
- var VIEM_CHAINS = {
1595
- ethereum_mainnet: mainnet,
1596
- ethereum_sepolia: sepolia,
1597
- base_mainnet: base,
1598
- base_sepolia: baseSepolia
1599
- };
1600
- function viemChain(chain) {
1601
- return VIEM_CHAINS[chain];
1602
- }
1603
- function getChainId(chain) {
1604
- return VIEM_CHAINS[chain].id;
1605
- }
1606
- function chainFromId(chainId) {
1607
- const chains = Object.keys(VIEM_CHAINS);
1608
- const chain = chains.find((c) => String(VIEM_CHAINS[c].id) === chainId);
1609
- if (!chain) {
1610
- throw new ValidationError(`Unsupported EIP-155 chain id: "${chainId}"`);
1611
- }
1612
- return chain;
1613
- }
1614
- function getNetworkName(chain) {
1615
- switch (chain) {
1616
- case "ethereum_mainnet":
1617
- return "Ethereum";
1618
- case "ethereum_sepolia":
1619
- return "Ethereum Sepolia";
1620
- case "base_mainnet":
1621
- return "Base";
1622
- case "base_sepolia":
1623
- return "Base Sepolia";
1624
- default: {
1625
- const _exhaustive = chain;
1626
- return _exhaustive;
1627
- }
1628
- }
1629
- }
1630
- function txExplorerUrl(chain, txHash) {
1631
- return TxExplorerUrl(`${explorerBaseUrl(chain)}/tx/${txHash}`);
1632
- }
1633
- function explorerBaseUrl(chain) {
1634
- switch (chain) {
1635
- case "ethereum_mainnet":
1636
- return "https://etherscan.io";
1637
- case "ethereum_sepolia":
1638
- return "https://sepolia.etherscan.io";
1639
- case "base_mainnet":
1640
- return "https://basescan.org";
1641
- case "base_sepolia":
1642
- return "https://sepolia-explorer.base.org";
1643
- default: {
1644
- const _exhaustive = chain;
1645
- return _exhaustive;
1646
- }
1647
- }
1648
- }
1649
-
1650
1619
  // src/universal/types/providers/ondo/ondo.ts
1651
1620
  var OndoTradingStatus = {
1652
1621
  fromDto: (dto) => {
@@ -1701,7 +1670,7 @@ var OndoBuyTransaction = {
1701
1670
  raw: dto.notional_value,
1702
1671
  decimals: spendDecimals
1703
1672
  }),
1704
- receiveOutputAmount: parsePositiveAmount({
1673
+ receiveOutputAmount: positiveAmountFromRawOrThrow({
1705
1674
  label: "receive_output_amount",
1706
1675
  raw: dto.receive_output_amount,
1707
1676
  decimals: outputDecimals,
@@ -1720,7 +1689,7 @@ var OndoSellTransaction = {
1720
1689
  fromDto: (dto) => {
1721
1690
  const spendDecimals = AssetDecimals(dto.spend_input_decimals);
1722
1691
  const outputDecimals = AssetDecimals(dto.receive_output_decimals);
1723
- const expectedQuantity = parsePositiveAmount({
1692
+ const expectedQuantity = positiveAmountFromRawOrThrow({
1724
1693
  label: "expected_quantity",
1725
1694
  raw: dto.expected_quantity,
1726
1695
  decimals: outputDecimals,
@@ -1754,12 +1723,12 @@ var OndoSellTransaction = {
1754
1723
  };
1755
1724
  function parseSwapCore(dto, spendDecimals) {
1756
1725
  return {
1757
- tx: {
1758
- to: EvmContractAddress(dto.to),
1759
- data: HexEncodedTransactionData(dto.data)
1760
- },
1761
- expiresAt: parseExpiresAt(dto.expires_at),
1762
- spendInputAmount: parsePositiveAmount({
1726
+ tx: txFromWire(dto),
1727
+ // A transaction whose expiry cannot be read is not safely fillable - the
1728
+ // deadline is encoded in the calldata either way, so broadcasting against
1729
+ // an unknown one only spends gas on a revert.
1730
+ expiresAt: requiredDate(dto.expires_at, "expires_at"),
1731
+ spendInputAmount: positiveAmountFromRawOrThrow({
1763
1732
  label: "spend_input_amount",
1764
1733
  raw: dto.spend_input_amount,
1765
1734
  decimals: spendDecimals,
@@ -1777,7 +1746,7 @@ function parseSwapCore(dto, spendDecimals) {
1777
1746
  };
1778
1747
  }
1779
1748
  function parseMinimumQuantity(raw, decimals, expectedQuantity) {
1780
- const amount = parsePositiveAmount({
1749
+ const amount = positiveAmountFromRawOrThrow({
1781
1750
  label: "minimum_quantity",
1782
1751
  raw,
1783
1752
  decimals,
@@ -1790,27 +1759,6 @@ function parseMinimumQuantity(raw, decimals, expectedQuantity) {
1790
1759
  }
1791
1760
  return amount;
1792
1761
  }
1793
- function parsePositiveAmount({
1794
- label,
1795
- raw,
1796
- decimals,
1797
- reason
1798
- }) {
1799
- const amount = blockchainAmountFromRawOrThrow({ label, raw, decimals });
1800
- if (amount.raw <= 0n) {
1801
- throw new ValidationError(
1802
- `${label}: must be greater than zero ("${raw}") - ${reason}`
1803
- );
1804
- }
1805
- return amount;
1806
- }
1807
- function parseExpiresAt(value) {
1808
- const date = new Date(value);
1809
- if (Number.isNaN(date.getTime())) {
1810
- throw new ValidationError(`expires_at: not a date ("${value}")`);
1811
- }
1812
- return date;
1813
- }
1814
1762
 
1815
1763
  // src/universal/api/frontline/providers/ondo/ondo.ts
1816
1764
  async function getOndoTradingStatus(api, params) {
@@ -1876,18 +1824,6 @@ function swapBody(params) {
1876
1824
  amount: params.amount.raw.toString()
1877
1825
  };
1878
1826
  }
1879
- function assertSpendScaleAgrees({
1880
- published,
1881
- sized,
1882
- trade,
1883
- note
1884
- }) {
1885
- if (published === sized.decimals) return;
1886
- const because = note === void 0 ? "" : ` - ${note}`;
1887
- throw new ValidationError(
1888
- `spend_input_decimals: the ${trade} was priced in ${published} decimals but the order was sized in ${sized.decimals}${because}`
1889
- );
1890
- }
1891
1827
  function sizeParam(params) {
1892
1828
  const tokenAmount = "tokenAmount" in params ? params.tokenAmount : void 0;
1893
1829
  const notionalValue = "notionalValue" in params ? params.notionalValue : void 0;
@@ -1907,7 +1843,7 @@ function sizeParam(params) {
1907
1843
  return { notional_value: notionalValue };
1908
1844
  }
1909
1845
 
1910
- // src/universal/core/checkout/ondo/ondo-namespace.ts
1846
+ // src/universal/core/providers/ondo/ondo-namespace.ts
1911
1847
  var OndoNamespaceImpl = class {
1912
1848
  constructor(ctx) {
1913
1849
  this.ctx = ctx;
@@ -1983,8 +1919,7 @@ var AllowWalletResponse = {
1983
1919
  case "broadcast_transaction":
1984
1920
  return {
1985
1921
  action: "broadcast_transaction",
1986
- to: EvmContractAddress(dto.to),
1987
- data: HexEncodedTransactionData(dto.data)
1922
+ tx: txFromWire(dto)
1988
1923
  };
1989
1924
  case "none":
1990
1925
  return {
@@ -1999,7 +1934,7 @@ var AllowWalletResponse = {
1999
1934
  }
2000
1935
  };
2001
1936
 
2002
- // src/universal/core/checkout/superstate/blockchain/quote.ts
1937
+ // src/universal/core/providers/superstate/blockchain/quote.ts
2003
1938
  var SwapQuote = {
2004
1939
  /**
2005
1940
  * Assembles a {@link SwapQuote} from a raw contract {@link SwapPreview}. The
@@ -2034,7 +1969,7 @@ async function allowWallet(api, params) {
2034
1969
  return AllowWalletResponse.fromDto(dto);
2035
1970
  }
2036
1971
 
2037
- // src/universal/core/checkout/superstate/blockchain/abi.ts
1972
+ // src/universal/core/providers/superstate/blockchain/abi.ts
2038
1973
  var SUPERSTATE_SWAP_ABI = [
2039
1974
  {
2040
1975
  type: "function",
@@ -3055,7 +2990,7 @@ async function getSwapOutputToken(clients, params) {
3055
2990
  };
3056
2991
  }
3057
2992
 
3058
- // src/universal/core/checkout/superstate/swap-namespace.ts
2993
+ // src/universal/core/providers/superstate/superstate-namespace.ts
3059
2994
  var SuperstateSwapNamespaceImpl = class {
3060
2995
  constructor(ctx) {
3061
2996
  this.ctx = ctx;
@@ -3427,6 +3362,61 @@ var WalletsNamespaceImpl = class {
3427
3362
  }
3428
3363
  };
3429
3364
 
3365
+ // src/universal/api/frontline/offers.ts
3366
+ async function fetchOffers(api, clientCreds) {
3367
+ return fetchAllPages((params) => fetchOffersPage(api, params, clientCreds));
3368
+ }
3369
+ async function fetchOffersPage(api, params, clientCreds) {
3370
+ const queryParams = PaginationParams.toQueryParams(params);
3371
+ const pageDto = await api.send({
3372
+ method: "GET",
3373
+ url: "/v1/offers",
3374
+ queryParams,
3375
+ attributes: Attributes.concat(
3376
+ Attributes.protected(),
3377
+ Attributes.clientCredentials(clientCreds)
3378
+ )
3379
+ });
3380
+ return PaginatedResponse.fromDtoPage(pageDto, Offer.listFromDto);
3381
+ }
3382
+ async function fetchOfferDetails(api, id, clientCreds) {
3383
+ const dto = await api.send({
3384
+ method: "GET",
3385
+ url: `/v1/offers/${id}`,
3386
+ attributes: Attributes.concat(
3387
+ Attributes.protected(),
3388
+ Attributes.clientCredentials(clientCreds)
3389
+ )
3390
+ });
3391
+ return OfferDetail.fromDto(dto);
3392
+ }
3393
+
3394
+ // src/universal/core/offers/offers-namespace.ts
3395
+ var OffersNamespaceImpl = class {
3396
+ constructor(ctx) {
3397
+ this.ctx = ctx;
3398
+ this.log = internalLogger(ctx.logger, "OFFERS");
3399
+ }
3400
+ async list() {
3401
+ return this.log.wrap("list", void 0, async () => {
3402
+ await this.ctx.ensureUserAuthenticated();
3403
+ return fetchOffers(this.ctx.api, void 0);
3404
+ });
3405
+ }
3406
+ async listPage(params) {
3407
+ return this.log.wrap("listPage", params, async () => {
3408
+ await this.ctx.ensureUserAuthenticated();
3409
+ return fetchOffersPage(this.ctx.api, params, void 0);
3410
+ });
3411
+ }
3412
+ async get(id) {
3413
+ return this.log.wrap("get", id, async () => {
3414
+ await this.ctx.ensureUserAuthenticated();
3415
+ return fetchOfferDetails(this.ctx.api, id, void 0);
3416
+ });
3417
+ }
3418
+ };
3419
+
3430
3420
  // src/universal/api/rpc/erc20.ts
3431
3421
  async function getTokenAllowance(clients, params) {
3432
3422
  const allowance = await clients(params.chain).readContract({
@@ -3554,187 +3544,6 @@ var resolveLogoUrl = (url, baseUrl) => TokenLogoUrl(
3554
3544
 
3555
3545
  // src/universal/api/nabu/tokens.ts
3556
3546
  import { getAddress } from "viem";
3557
-
3558
- // src/universal/api/frontline/config.ts
3559
- var PUBLIC_API_BASE_URL = "https://api.coinlist.co";
3560
- var HEADER_API_VERSION = "X-API-Version";
3561
- var HEADER_USER_AGENT = "User-Agent";
3562
- var HEADER_IDEMPOTENCY_KEY = "Idempotency-Key";
3563
- var API_VERSION = "2025-10-17";
3564
- var COINLIST_BASE_URL = "https://coinlist.co";
3565
- var OAUTH_PAGE_PATH = "/oauth/authorize";
3566
- var SUPPORT_NEW_TICKET_URL = "https://support.coinlist.co/support/tickets/new";
3567
- var VERIFY_IDENTITY_PATH = "/verify-identity";
3568
- var VERIFY_IDENTITY_ACCREDITATION_PATH = "/verify-identity/accreditation_full";
3569
- var WALLET_PATH = "/wallet";
3570
-
3571
- // src/universal/api/http-client.ts
3572
- var HttpClient = class {
3573
- constructor(config, middleware = {}, logger = null, options = {}) {
3574
- this.config = config;
3575
- this.middleware = middleware;
3576
- this.log = internalLogger(logger, "HTTP");
3577
- this.makeRequestId = options.makeRequestId ?? defaultMakeRequestId;
3578
- }
3579
- async send(request) {
3580
- return this.runRequestWithAfterMiddleware(request);
3581
- }
3582
- /**
3583
- * Runs beforeRequest, executeRequest, then the full afterRequest middleware
3584
- * chain. Used by send() and by the retry() callback so that when a
3585
- * middleware calls retry(), the retried response also goes through all
3586
- * afterRequest middleware (e.g. session renewal, retry). Middleware
3587
- * must use request.attributes.retryAttempt (or similar) to avoid infinite
3588
- * recursion when they trigger retries.
3589
- */
3590
- async runRequestWithAfterMiddleware(request) {
3591
- const preparedRequest = await this.runBeforeRequestMiddleware(
3592
- this.withClientDefaults(request)
3593
- );
3594
- let response = await this.executeRequest(preparedRequest);
3595
- for (const middleware of this.middleware.afterRequest ?? []) {
3596
- let retried = false;
3597
- response = await middleware({
3598
- request: preparedRequest,
3599
- response,
3600
- retry: (nextRequest = preparedRequest) => {
3601
- retried = true;
3602
- return this.runRequestWithAfterMiddleware(nextRequest);
3603
- }
3604
- });
3605
- if (retried) {
3606
- return response;
3607
- }
3608
- }
3609
- return response;
3610
- }
3611
- withClientDefaults(request) {
3612
- const url = this.resolveUrl(request.url);
3613
- const headers = {
3614
- ...request.headers ?? {},
3615
- ...this.config.xApiVersion !== void 0 ? { [HEADER_API_VERSION]: this.config.xApiVersion } : {}
3616
- };
3617
- return {
3618
- ...request,
3619
- url,
3620
- headers,
3621
- // Only when absent: a retry or a post-renewal re-send arrives with the
3622
- // first attempt's id already on it, and keeping it is the whole point.
3623
- attributes: Attributes.getRequestId(request.attributes) === null ? Attributes.concat(
3624
- request.attributes ?? Attributes.empty,
3625
- Attributes.requestId(this.makeRequestId())
3626
- ) : request.attributes
3627
- };
3628
- }
3629
- /**
3630
- * Resolves a request URL against the client's baseUrl.
3631
- *
3632
- * @internal Public only for testing. Do not use in application code; use
3633
- * {@link HttpClient.send} with a path and the client will resolve the URL.
3634
- */
3635
- resolveUrl(url) {
3636
- if (url.startsWith("http://") || url.startsWith("https://")) {
3637
- return url;
3638
- }
3639
- const base2 = this.config.baseUrl.replace(/\/$/, "");
3640
- const path = url.startsWith("/") ? url : `/${url}`;
3641
- return base2 + path;
3642
- }
3643
- async runBeforeRequestMiddleware(initialRequest) {
3644
- let request = initialRequest;
3645
- for (const middleware of this.middleware.beforeRequest ?? []) {
3646
- request = await middleware(request);
3647
- }
3648
- return request;
3649
- }
3650
- /**
3651
- * One physical attempt, logged as one line.
3652
- *
3653
- * A non-2xx is a `warn` rather than an `error` because the wire does not
3654
- * know whether it is a failure: the retry middleware may turn a 503 into a
3655
- * success, and the token registry reads a 404 as "not listed". The namespace
3656
- * above decides, and logs the `error` when it does.
3657
- */
3658
- async executeRequest(request) {
3659
- const requestId2 = Attributes.getRequestId(request.attributes);
3660
- const log = requestId2 === null ? this.log : this.log.child({ requestId: requestId2 });
3661
- const attempt = Attributes.getRetryAttempt(request.attributes) + 1;
3662
- const startedAt = Date.now();
3663
- log.debug(() => ({
3664
- msg: "request sent",
3665
- fields: describeRequestUnredacted(request)
3666
- }));
3667
- try {
3668
- const response = await makeRequest(request);
3669
- const elapsed = Date.now() - startedAt;
3670
- const outcome = () => ({
3671
- msg: "request completed",
3672
- fields: {
3673
- ...identifyRequest(request),
3674
- "http.response.status_code": response.status,
3675
- duration_ms: elapsed,
3676
- attempt
3677
- }
3678
- });
3679
- if (response.status >= 200 && response.status < 300) {
3680
- log.info(outcome);
3681
- } else {
3682
- log.warn(outcome);
3683
- }
3684
- log.debug(() => ({
3685
- msg: "response received",
3686
- fields: { body: response.body }
3687
- }));
3688
- return requestId2 === null ? response : { ...response, requestId: requestId2 };
3689
- } catch (error) {
3690
- const elapsed = Date.now() - startedAt;
3691
- log.warning(
3692
- () => ({
3693
- msg: "request threw",
3694
- fields: {
3695
- ...identifyRequest(request),
3696
- duration_ms: elapsed,
3697
- attempt
3698
- }
3699
- }),
3700
- error
3701
- );
3702
- throw error;
3703
- }
3704
- }
3705
- };
3706
- function identifyRequest(request) {
3707
- const { host, path } = splitUrl(request.url);
3708
- return {
3709
- "http.request.method": request.method,
3710
- "server.address": host,
3711
- "url.path": path
3712
- };
3713
- }
3714
- function splitUrl(url) {
3715
- try {
3716
- const parsed = new URL(url);
3717
- return { host: parsed.host, path: parsed.pathname };
3718
- } catch (_) {
3719
- return { host: null, path: url };
3720
- }
3721
- }
3722
- function defaultMakeRequestId() {
3723
- return Math.random().toString(36).slice(2, 10).padEnd(8, "0");
3724
- }
3725
- function describeRequestUnredacted(request) {
3726
- return {
3727
- "http.request.method": request.method,
3728
- "url.full": buildUrlWithQueryParams(request.url, request.queryParams),
3729
- headers: request.headers,
3730
- ...request.method === "POST" ? { body: request.body } : {}
3731
- };
3732
- }
3733
-
3734
- // src/universal/api/nabu/tokens.ts
3735
- function createNabuApiClient(baseUrl, logger = null) {
3736
- return new HttpClient({ baseUrl }, {}, logger);
3737
- }
3738
3547
  async function fetchTokenMetadata(client, token) {
3739
3548
  const address = checksummed(token.address);
3740
3549
  let response;
@@ -3822,84 +3631,39 @@ function checksummed(address) {
3822
3631
  }
3823
3632
  }
3824
3633
 
3825
- // src/universal/core/tokens/tokens-namespace.ts
3634
+ // src/universal/core/shared/blockchain/tokens/tokens-namespace.ts
3826
3635
  var TokensNamespaceImpl = class {
3827
- /**
3828
- * Takes the registry origin rather than a `UniversalNamespaceContext`: the
3829
- * registry is unauthenticated and on its own host, so the frontline sender
3830
- * and the auth check would both be dead weight here.
3831
- */
3832
- constructor(baseUrl, logger = null) {
3833
- this.api = createNabuApiClient(baseUrl, logger);
3834
- this.log = internalLogger(logger, "TOKENS");
3636
+ constructor(ctx) {
3637
+ this.ctx = ctx;
3638
+ this.log = internalLogger(ctx.logger, "TOKENS");
3835
3639
  }
3836
3640
  get(token) {
3837
3641
  return this.log.wrap(
3838
3642
  "get",
3839
3643
  token,
3840
- () => fetchTokenMetadata(this.api, token)
3644
+ () => fetchTokenMetadata(this.ctx.nabu, token)
3841
3645
  );
3842
3646
  }
3843
3647
  list(chain) {
3844
3648
  return this.log.wrap(
3845
3649
  "list",
3846
3650
  chain,
3847
- () => chain === void 0 ? fetchAllTokensMetadata(this.api) : fetchTokensMetadata(this.api, chain)
3651
+ () => chain === void 0 ? fetchAllTokensMetadata(this.ctx.nabu) : fetchTokensMetadata(this.ctx.nabu, chain)
3848
3652
  );
3849
3653
  }
3850
3654
  };
3851
3655
 
3852
- // src/universal/api/frontline/offers.ts
3853
- async function fetchOffers(api, clientCreds) {
3854
- return fetchAllPages((params) => fetchOffersPage(api, params, clientCreds));
3855
- }
3856
- async function fetchOffersPage(api, params, clientCreds) {
3857
- const queryParams = PaginationParams.toQueryParams(params);
3858
- const pageDto = await api.send({
3859
- method: "GET",
3860
- url: "/v1/offers",
3861
- queryParams,
3862
- attributes: Attributes.concat(
3863
- Attributes.protected(),
3864
- Attributes.clientCredentials(clientCreds)
3865
- )
3866
- });
3867
- return PaginatedResponse.fromDtoPage(pageDto, Offer.listFromDto);
3868
- }
3869
- async function fetchOfferDetails(api, id, clientCreds) {
3870
- const dto = await api.send({
3871
- method: "GET",
3872
- url: `/v1/offers/${id}`,
3873
- attributes: Attributes.concat(
3874
- Attributes.protected(),
3875
- Attributes.clientCredentials(clientCreds)
3876
- )
3877
- });
3878
- return OfferDetail.fromDto(dto);
3879
- }
3880
-
3881
3656
  export {
3882
3657
  sha256,
3883
3658
  arrayBufferToBase64Url,
3884
3659
  generateSecureRandomBase64Url,
3885
3660
  getUUIDv4,
3886
- PUBLIC_API_BASE_URL,
3887
- HEADER_USER_AGENT,
3888
- HEADER_IDEMPOTENCY_KEY,
3889
- API_VERSION,
3890
- COINLIST_BASE_URL,
3891
- OAUTH_PAGE_PATH,
3892
- SUPPORT_NEW_TICKET_URL,
3893
- VERIFY_IDENTITY_PATH,
3894
- VERIFY_IDENTITY_ACCREDITATION_PATH,
3895
- WALLET_PATH,
3896
3661
  SentWith,
3897
3662
  TokenTrigger,
3898
3663
  isRejectedToken,
3899
3664
  Attributes,
3900
3665
  HttpError,
3901
3666
  apiErrorCode,
3902
- Request,
3903
3667
  NotImplementedError,
3904
3668
  NotAuthenticatedError,
3905
3669
  ValidationError,
@@ -3908,12 +3672,23 @@ export {
3908
3672
  classifyLogCause,
3909
3673
  describeErrorUnredacted,
3910
3674
  internalLogger,
3911
- HttpClient,
3912
3675
  EpochMillis,
3913
3676
  Millis,
3914
3677
  Seconds,
3915
3678
  isExpired,
3916
3679
  ERC20_ABI,
3680
+ FormattedAmountUi,
3681
+ FormattedPercentUi,
3682
+ TxExplorerUrl,
3683
+ ShortenedWalletAddress,
3684
+ FormattedAmountAssetUi,
3685
+ AssetIconUrl,
3686
+ viemChain,
3687
+ getChainId,
3688
+ chainFromId,
3689
+ contractOn,
3690
+ getNetworkName,
3691
+ txExplorerUrl,
3917
3692
  ETHEREUM_CHAINS,
3918
3693
  EthereumChain,
3919
3694
  SOLANA_CHAINS,
@@ -3936,6 +3711,8 @@ export {
3936
3711
  KnownAssetSymbol,
3937
3712
  Bps,
3938
3713
  blockchainAmountFromRawOrThrow,
3714
+ positiveAmountFromRawOrThrow,
3715
+ pricePerShare,
3939
3716
  parseBlockchainAmount,
3940
3717
  CentrifugeVaultStatus,
3941
3718
  CentrifugeVaultBuyTransaction,
@@ -3948,12 +3725,6 @@ export {
3948
3725
  CentrifugeVaultLegId,
3949
3726
  CentrifugeVaultClaimProceedsTransaction,
3950
3727
  CentrifugeNamespaceImpl,
3951
- FormattedAmountUi,
3952
- FormattedPercentUi,
3953
- TxExplorerUrl,
3954
- ShortenedWalletAddress,
3955
- FormattedAmountAssetUi,
3956
- AssetIconUrl,
3957
3728
  shortenAddress,
3958
3729
  formatAmount,
3959
3730
  formatRawAmount,
@@ -3964,6 +3735,9 @@ export {
3964
3735
  NA_AMOUNT_ASSET_UI,
3965
3736
  formatShareAmount,
3966
3737
  formattedUsdPrice,
3738
+ Cursor,
3739
+ PaginatedResponse,
3740
+ PaginationParams,
3967
3741
  AssetId,
3968
3742
  AssetCode,
3969
3743
  Asset,
@@ -3980,27 +3754,18 @@ export {
3980
3754
  OfferOptionSlug,
3981
3755
  OfferSwapContract,
3982
3756
  OfferVaultContract,
3757
+ OfferFundingContract,
3983
3758
  OfferDetail,
3984
3759
  OfferOption,
3985
3760
  FaqItem,
3986
3761
  Link,
3987
3762
  TermItem,
3988
3763
  Milestone,
3989
- Cursor,
3990
- PaginatedResponse,
3991
- PaginationParams,
3992
3764
  ParticipationId,
3993
- Blockchain,
3994
- WalletAddress,
3995
3765
  ParticipationsPaginationParams,
3996
3766
  Participation,
3997
3767
  CreateParticipationParams,
3998
3768
  CoinListTokenSaleNamespaceImpl,
3999
- viemChain,
4000
- getChainId,
4001
- chainFromId,
4002
- getNetworkName,
4003
- txExplorerUrl,
4004
3769
  OndoTradingStatus,
4005
3770
  OndoQuote,
4006
3771
  OndoBuyTransaction,
@@ -4033,10 +3798,11 @@ export {
4033
3798
  fetchOffers,
4034
3799
  fetchOffersPage,
4035
3800
  fetchOfferDetails,
3801
+ OffersNamespaceImpl,
4036
3802
  Erc20NamespaceImpl,
4037
3803
  TokenLogoUrl,
4038
3804
  TokenLogo,
4039
3805
  TokenMetadata,
4040
3806
  TokensNamespaceImpl
4041
3807
  };
4042
- //# sourceMappingURL=chunk-GIE4UWB3.js.map
3808
+ //# sourceMappingURL=chunk-2FZAXGVH.js.map