@coinlist-co/react 0.9.0 → 0.10.1
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-I5YTJ5SL.js → chunk-AQVCOWOV.js} +163 -69
- package/dist/chunk-AQVCOWOV.js.map +1 -0
- package/dist/{chunk-MKCOK3DF.js → chunk-TBU3EBNM.js} +2 -43
- package/dist/chunk-TBU3EBNM.js.map +1 -0
- package/dist/{chunk-Z2HAA2TI.js → chunk-UOHD7US2.js} +150 -63
- package/dist/chunk-UOHD7US2.js.map +1 -0
- package/dist/client/index.cjs +415 -292
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +131 -49
- package/dist/client/index.d.ts +131 -49
- package/dist/client/index.js +169 -76
- package/dist/client/index.js.map +1 -1
- package/dist/{collections-BQbFJS3g.d.ts → collections-Bv1Oxzu_.d.ts} +1 -1
- package/dist/{collections-B84Vw55t.d.cts → collections-DDyxbOPZ.d.cts} +1 -1
- package/dist/{requirement-C2w45Q11.d.cts → requirement-oVZA1INj.d.cts} +271 -200
- package/dist/{requirement-C2w45Q11.d.ts → requirement-oVZA1INj.d.ts} +271 -200
- package/dist/server/index.cjs +135 -116
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +20 -27
- package/dist/server/index.d.ts +20 -27
- package/dist/server/index.js +10 -27
- package/dist/server/index.js.map +1 -1
- package/dist/shared/index.cjs +145 -75
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +4 -4
- package/dist/shared/index.d.ts +4 -4
- package/dist/shared/index.js +16 -92
- package/dist/shared/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-AAER5LOL.js +0 -22
- package/dist/chunk-AAER5LOL.js.map +0 -1
- package/dist/chunk-I5YTJ5SL.js.map +0 -1
- package/dist/chunk-MKCOK3DF.js.map +0 -1
- package/dist/chunk-Z2HAA2TI.js.map +0 -1
|
@@ -256,28 +256,65 @@ interface SharedNamespaceContext {
|
|
|
256
256
|
ensureUserAuthenticated(): Promise<void>;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
type GetTokenAllowanceParams = {
|
|
260
|
+
tokenAddress: EvmContractAddress;
|
|
261
|
+
owner: EvmWalletAddress;
|
|
262
|
+
spender: EvmContractAddress;
|
|
263
|
+
chain: EthereumChain;
|
|
264
|
+
};
|
|
265
|
+
type GetTokenBalanceParams = {
|
|
266
|
+
tokenAddress: EvmContractAddress;
|
|
267
|
+
owner: EvmWalletAddress;
|
|
268
|
+
chain: EthereumChain;
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Generic ERC-20 reads shared across on-chain flows (swap, token sale): the
|
|
272
|
+
* allowance an owner has granted a spender, and the raw token balance an owner
|
|
273
|
+
* holds. These are plain token reads, not tied to any single product flow.
|
|
274
|
+
*/
|
|
275
|
+
interface CoinListErc20Namespace {
|
|
276
|
+
/**
|
|
277
|
+
* Reads the ERC-20 allowance an `owner` has granted a `spender`.
|
|
278
|
+
*/
|
|
279
|
+
getTokenAllowance(params: GetTokenAllowanceParams): Promise<TokenAllowance>;
|
|
280
|
+
/**
|
|
281
|
+
* Reads the raw ERC-20 balance an `owner` holds of a token.
|
|
282
|
+
*/
|
|
283
|
+
getTokenBalance(params: GetTokenBalanceParams): Promise<TokenBalance>;
|
|
284
|
+
}
|
|
285
|
+
declare class Erc20NamespaceImpl implements CoinListErc20Namespace {
|
|
286
|
+
private readonly ctx;
|
|
287
|
+
constructor(ctx: SharedNamespaceContext);
|
|
288
|
+
getTokenAllowance(params: GetTokenAllowanceParams): Promise<TokenAllowance>;
|
|
289
|
+
getTokenBalance(params: GetTokenBalanceParams): Promise<TokenBalance>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
type OfferTypeDto = 'sale' | 'swap';
|
|
259
293
|
type OfferDto = {
|
|
260
294
|
id: string;
|
|
261
295
|
slug: string;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
296
|
+
type: OfferTypeDto;
|
|
297
|
+
tagline: string;
|
|
298
|
+
banner_url: string;
|
|
299
|
+
logo_url: string;
|
|
265
300
|
starts_at: string;
|
|
266
|
-
ends_at: string;
|
|
301
|
+
ends_at: string | null;
|
|
267
302
|
};
|
|
268
303
|
|
|
269
304
|
type OfferId = Newtype<string, 'OfferId'>;
|
|
270
305
|
declare const OfferId: (value: string) => OfferId;
|
|
271
306
|
type OfferSlug = Newtype<string, 'OfferSlug'>;
|
|
272
307
|
declare const OfferSlug: (value: string) => OfferSlug;
|
|
308
|
+
type OfferType = OfferTypeDto;
|
|
273
309
|
type Offer = {
|
|
274
310
|
id: OfferId;
|
|
275
311
|
slug: OfferSlug;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
312
|
+
type: OfferType;
|
|
313
|
+
tagline: string;
|
|
314
|
+
bannerUrl: string;
|
|
315
|
+
logoUrl: string;
|
|
279
316
|
startsAt: Date;
|
|
280
|
-
endsAt: Date;
|
|
317
|
+
endsAt: Date | null;
|
|
281
318
|
};
|
|
282
319
|
declare const Offer: {
|
|
283
320
|
fromDto: (dto: OfferDto) => Offer;
|
|
@@ -372,17 +409,6 @@ type GetSwapPreviewParams = SwapContractRef & {
|
|
|
372
409
|
inputToken: EvmContractAddress;
|
|
373
410
|
amount: bigint;
|
|
374
411
|
};
|
|
375
|
-
type GetTokenAllowanceParams = {
|
|
376
|
-
tokenAddress: EvmContractAddress;
|
|
377
|
-
owner: EvmWalletAddress;
|
|
378
|
-
spender: EvmContractAddress;
|
|
379
|
-
chain: EthereumChain;
|
|
380
|
-
};
|
|
381
|
-
type GetTokenBalanceParams = {
|
|
382
|
-
tokenAddress: EvmContractAddress;
|
|
383
|
-
owner: EvmWalletAddress;
|
|
384
|
-
chain: EthereumChain;
|
|
385
|
-
};
|
|
386
412
|
type AllowWalletParams = {
|
|
387
413
|
offerId: OfferId;
|
|
388
414
|
walletAddress: EvmWalletAddress;
|
|
@@ -407,14 +433,6 @@ interface CoinListSwapNamespace {
|
|
|
407
433
|
* Reads the current on-chain state of a swap contract.
|
|
408
434
|
*/
|
|
409
435
|
getStatus(params: SwapContractRef): Promise<SwapStatus>;
|
|
410
|
-
/**
|
|
411
|
-
* Reads the ERC-20 allowance an `owner` has granted a `spender`.
|
|
412
|
-
*/
|
|
413
|
-
getTokenAllowance(params: GetTokenAllowanceParams): Promise<TokenAllowance>;
|
|
414
|
-
/**
|
|
415
|
-
* Reads the raw ERC-20 balance an `owner` holds of a token.
|
|
416
|
-
*/
|
|
417
|
-
getTokenBalance(params: GetTokenBalanceParams): Promise<TokenBalance>;
|
|
418
436
|
/**
|
|
419
437
|
* Reads the ERC-20 output token a swap contract pays out.
|
|
420
438
|
*/
|
|
@@ -439,28 +457,11 @@ declare class SwapNamespaceImpl implements CoinListSwapNamespace {
|
|
|
439
457
|
getAuthorization(params: GetSwapAuthorizationParams): Promise<SwapAuthorization>;
|
|
440
458
|
getPreview(params: GetSwapPreviewParams): Promise<SwapPreview>;
|
|
441
459
|
getStatus(params: SwapContractRef): Promise<SwapStatus>;
|
|
442
|
-
getTokenAllowance(params: GetTokenAllowanceParams): Promise<TokenAllowance>;
|
|
443
|
-
getTokenBalance(params: GetTokenBalanceParams): Promise<TokenBalance>;
|
|
444
460
|
getOutputToken(params: SwapContractRef): Promise<Erc20Asset>;
|
|
445
461
|
requestWalletOwnershipChallenge(params: CreateWalletOwnershipChallengeParams): Promise<WalletOwnershipChallenge>;
|
|
446
462
|
allowWallet(params: AllowWalletParams): Promise<AllowWalletResponse>;
|
|
447
463
|
}
|
|
448
464
|
|
|
449
|
-
type AuthorizationCode = Newtype<string, 'AuthorizationCode'>;
|
|
450
|
-
declare const AuthorizationCode: (value: string) => AuthorizationCode;
|
|
451
|
-
type CodeVerifier = Newtype<string, 'CodeVerifier'>;
|
|
452
|
-
declare const CodeVerifier: (value: string) => CodeVerifier;
|
|
453
|
-
type CodeChallenge = Newtype<string, 'CodeChallenge'>;
|
|
454
|
-
declare const CodeChallenge: (value: string) => CodeChallenge;
|
|
455
|
-
type PKCEState = Newtype<string, 'PKCEState'>;
|
|
456
|
-
declare const PKCEState: (value: string) => PKCEState;
|
|
457
|
-
type RedirectUri = Newtype<string, 'RedirectUri'>;
|
|
458
|
-
declare const RedirectUri: (value: string) => RedirectUri;
|
|
459
|
-
type ClientId = Newtype<string, 'ClientId'>;
|
|
460
|
-
declare const ClientId: (value: string) => ClientId;
|
|
461
|
-
type ClientSecret = Newtype<string, 'ClientSecret'>;
|
|
462
|
-
declare const ClientSecret: (value: string) => ClientSecret;
|
|
463
|
-
|
|
464
465
|
type Cursor = Newtype<string, 'Cursor'>;
|
|
465
466
|
declare const Cursor: (value: string) => Cursor;
|
|
466
467
|
interface PaginatedResponseDto<T> {
|
|
@@ -491,65 +492,6 @@ declare const PaginationParams: {
|
|
|
491
492
|
toQueryParams: (params: PaginationParams) => Record<string, QueryParamValue>;
|
|
492
493
|
};
|
|
493
494
|
|
|
494
|
-
interface Config {
|
|
495
|
-
/** OAuth2 public identifier. */
|
|
496
|
-
readonly clientId: ClientId;
|
|
497
|
-
/**
|
|
498
|
-
* OAuth2 redirect URI. Recommended to point to a frontend page where
|
|
499
|
-
* {@link CoinListClient#completeOauth} can be called to complete the PKCE
|
|
500
|
-
* flow on the client side.
|
|
501
|
-
*/
|
|
502
|
-
readonly redirectUri: RedirectUri;
|
|
503
|
-
/**
|
|
504
|
-
* Recommended to leave undefined. Used to change the CoinList environment;
|
|
505
|
-
* default is production.
|
|
506
|
-
*/
|
|
507
|
-
readonly baseUrl?: string;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
type DocumentSubmissionStatusDto = 'INITIALIZED' | 'SENT' | 'VIEWED' | 'COMPLETED' | 'DECLINED' | 'EXPIRED';
|
|
511
|
-
type DocumentFormTypeDto = 'w8_ben' | 'w8_ben_e';
|
|
512
|
-
type DocumentSubmissionDto = {
|
|
513
|
-
object: 'document_submission';
|
|
514
|
-
status: DocumentSubmissionStatusDto;
|
|
515
|
-
form_type: DocumentFormTypeDto;
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
/** Document types that can be signed via {@link CoinListClient.submitDocument}. */
|
|
519
|
-
type DocumentType = 'tax_certification';
|
|
520
|
-
/** Signing-state machine status for a document submission. */
|
|
521
|
-
type DocumentSubmissionStatus = DocumentSubmissionStatusDto;
|
|
522
|
-
/** The tax form derived from the entity's kind (individual vs company/trust). */
|
|
523
|
-
type DocumentFormType = DocumentFormTypeDto;
|
|
524
|
-
/** Result of starting (or resuming) a document signing submission. */
|
|
525
|
-
type DocumentSubmission = {
|
|
526
|
-
status: DocumentSubmissionStatus;
|
|
527
|
-
formType: DocumentFormType;
|
|
528
|
-
};
|
|
529
|
-
declare const DocumentSubmission: {
|
|
530
|
-
fromDto: (dto: DocumentSubmissionDto) => DocumentSubmission;
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
type KycTokenDto = {
|
|
534
|
-
object: 'kyc_token';
|
|
535
|
-
token: string;
|
|
536
|
-
};
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* Sumsub verification level name. Determines which screens the Sumsub WebSDK
|
|
540
|
-
* shows (levels are configured in the Sumsub dashboard). The backend
|
|
541
|
-
* prescribes the level (and whether the applicant must be reset first) in the
|
|
542
|
-
* requirement statuses response — clients never compute levels themselves.
|
|
543
|
-
*/
|
|
544
|
-
type KycLevelName = string;
|
|
545
|
-
/** Short-lived Sumsub WebSDK access token scoped to the current user. */
|
|
546
|
-
type KycToken = {
|
|
547
|
-
token: string;
|
|
548
|
-
};
|
|
549
|
-
declare const KycToken: {
|
|
550
|
-
fromDto: (dto: KycTokenDto) => KycToken;
|
|
551
|
-
};
|
|
552
|
-
|
|
553
495
|
type AssetDto = {
|
|
554
496
|
code: string;
|
|
555
497
|
fractional_digits: number;
|
|
@@ -571,6 +513,31 @@ declare const Asset: {
|
|
|
571
513
|
fromDto: (dto: AssetDto) => Asset;
|
|
572
514
|
};
|
|
573
515
|
|
|
516
|
+
type ParticipationStatusDto = 'prepared' | 'pending' | 'submitted' | 'completed' | 'failed' | 'remit_submitted' | 'remitted' | 'remit_failed';
|
|
517
|
+
type ParticipationDto = {
|
|
518
|
+
object: 'participation';
|
|
519
|
+
id: string;
|
|
520
|
+
offer_id: string;
|
|
521
|
+
offer_option_id: string;
|
|
522
|
+
status: ParticipationStatusDto;
|
|
523
|
+
amount: string;
|
|
524
|
+
amount_string: string;
|
|
525
|
+
asset: AssetDto;
|
|
526
|
+
chain: string;
|
|
527
|
+
inserted_at: string | null | undefined;
|
|
528
|
+
updated_at: string | null | undefined;
|
|
529
|
+
wallet_address: string | null | undefined;
|
|
530
|
+
};
|
|
531
|
+
type CreateParticipationDto = {
|
|
532
|
+
offer_id: string;
|
|
533
|
+
offer_option_id: string;
|
|
534
|
+
chain: string;
|
|
535
|
+
wallet_address: string;
|
|
536
|
+
amount: string;
|
|
537
|
+
asset_id: string;
|
|
538
|
+
approval_transaction_hash: string | null | undefined;
|
|
539
|
+
};
|
|
540
|
+
|
|
574
541
|
type OfferDetailDto = {
|
|
575
542
|
asset: AssetDto;
|
|
576
543
|
faqs: OfferDetailFaqDto[];
|
|
@@ -582,14 +549,15 @@ type OfferDetailDto = {
|
|
|
582
549
|
object: 'offer_details';
|
|
583
550
|
options: OfferDetailOptionDto[];
|
|
584
551
|
slug: string;
|
|
552
|
+
type: OfferTypeDto;
|
|
585
553
|
terms: OfferDetailTermDto[];
|
|
586
554
|
about: string | null | undefined;
|
|
587
|
-
banner_url: string
|
|
588
|
-
category: string
|
|
589
|
-
ends_at: string;
|
|
590
|
-
logo_url: string
|
|
555
|
+
banner_url: string;
|
|
556
|
+
category: string;
|
|
557
|
+
ends_at: string | null;
|
|
558
|
+
logo_url: string;
|
|
591
559
|
starts_at: string;
|
|
592
|
-
tagline: string
|
|
560
|
+
tagline: string;
|
|
593
561
|
};
|
|
594
562
|
type OfferDetailFaqDto = {
|
|
595
563
|
answer: string | null;
|
|
@@ -626,16 +594,17 @@ declare const OfferOptionSlug: (value: string) => OfferOptionSlug;
|
|
|
626
594
|
type OfferDetail = {
|
|
627
595
|
id: OfferId;
|
|
628
596
|
slug: OfferSlug;
|
|
597
|
+
type: OfferType;
|
|
629
598
|
name: string;
|
|
630
599
|
asset: Asset;
|
|
631
600
|
fundingAssets: Asset[];
|
|
632
601
|
about: string | null;
|
|
633
|
-
tagline: string
|
|
634
|
-
bannerUrl: string
|
|
635
|
-
logoUrl: string
|
|
636
|
-
category: string
|
|
602
|
+
tagline: string;
|
|
603
|
+
bannerUrl: string;
|
|
604
|
+
logoUrl: string;
|
|
605
|
+
category: string;
|
|
637
606
|
startsAt: Date;
|
|
638
|
-
endsAt: Date;
|
|
607
|
+
endsAt: Date | null;
|
|
639
608
|
faqs: FaqItem[];
|
|
640
609
|
links: Link[];
|
|
641
610
|
milestones: Milestone[];
|
|
@@ -688,90 +657,6 @@ declare const Milestone: {
|
|
|
688
657
|
fromDto: (dto: OfferDetailMilestoneDto) => Milestone;
|
|
689
658
|
};
|
|
690
659
|
|
|
691
|
-
/** Request body for `POST /v1/offers/:offer_id/addresses`. */
|
|
692
|
-
type CreateOfferOptionAddressDto = {
|
|
693
|
-
offer_option_id: string;
|
|
694
|
-
wallet_address: string;
|
|
695
|
-
chain: string;
|
|
696
|
-
signature: string;
|
|
697
|
-
};
|
|
698
|
-
/** Binding object returned by the `/v1/offers/:offer_id/addresses` resource. */
|
|
699
|
-
type OfferOptionAddressDto = {
|
|
700
|
-
id: string;
|
|
701
|
-
offer_option_id: string;
|
|
702
|
-
address: string;
|
|
703
|
-
protocol: WalletProtocol;
|
|
704
|
-
created_at: string;
|
|
705
|
-
};
|
|
706
|
-
|
|
707
|
-
/** Unique identifier for a proven wallet binding on an offer option. */
|
|
708
|
-
type OfferOptionAddressId = Newtype<string, 'OfferOptionAddressId'>;
|
|
709
|
-
/** Casts a string into a typed {@link OfferOptionAddressId}. */
|
|
710
|
-
declare const OfferOptionAddressId: (value: string) => OfferOptionAddressId;
|
|
711
|
-
/**
|
|
712
|
-
* A user's external wallet, proven via a wallet-ownership challenge and bound
|
|
713
|
-
* to an offer option. Returned by the `/v1/offers/:offer_id/addresses` resource.
|
|
714
|
-
*/
|
|
715
|
-
type OfferOptionAddress = {
|
|
716
|
-
/** Unique binding id. */
|
|
717
|
-
id: OfferOptionAddressId;
|
|
718
|
-
/** Offer option the wallet is bound to. */
|
|
719
|
-
offerOptionId: OfferOptionId;
|
|
720
|
-
/** The connected external wallet address. */
|
|
721
|
-
address: EvmWalletAddress;
|
|
722
|
-
/**
|
|
723
|
-
* Protocol the binding is scoped to. An EVM address binds once per option
|
|
724
|
-
* regardless of which EVM chain proved ownership.
|
|
725
|
-
*/
|
|
726
|
-
protocol: WalletProtocol;
|
|
727
|
-
/** When the binding was created. */
|
|
728
|
-
createdAt: Date;
|
|
729
|
-
};
|
|
730
|
-
declare const OfferOptionAddress: {
|
|
731
|
-
/** Maps the API DTO into the SDK offer-option-address domain model. */
|
|
732
|
-
fromDto: (dto: OfferOptionAddressDto) => OfferOptionAddress;
|
|
733
|
-
};
|
|
734
|
-
/** Parameters required to connect a proven external wallet to an offer option. */
|
|
735
|
-
type ConnectExternalWalletParams = {
|
|
736
|
-
/** Offer option to bind the wallet to. */
|
|
737
|
-
offerOptionId: OfferOptionId;
|
|
738
|
-
/** External wallet address that was proven. */
|
|
739
|
-
walletAddress: EvmWalletAddress;
|
|
740
|
-
/** Chain the ownership was proven on. */
|
|
741
|
-
chain: EthereumChain;
|
|
742
|
-
/** Signature of the wallet-ownership challenge message. */
|
|
743
|
-
signature: Hex;
|
|
744
|
-
};
|
|
745
|
-
declare const ConnectExternalWalletParams: {
|
|
746
|
-
/** Maps connect-wallet params into the API DTO payload. */
|
|
747
|
-
toDto: (params: ConnectExternalWalletParams) => CreateOfferOptionAddressDto;
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
type ParticipationStatusDto = 'prepared' | 'pending' | 'submitted' | 'completed' | 'failed' | 'remit_submitted' | 'remitted' | 'remit_failed';
|
|
751
|
-
type ParticipationDto = {
|
|
752
|
-
object: 'participation';
|
|
753
|
-
id: string;
|
|
754
|
-
offer_id: string;
|
|
755
|
-
offer_option_id: string;
|
|
756
|
-
status: ParticipationStatusDto;
|
|
757
|
-
amount: string;
|
|
758
|
-
amount_string: string;
|
|
759
|
-
asset: AssetDto;
|
|
760
|
-
chain: string;
|
|
761
|
-
inserted_at: string | null | undefined;
|
|
762
|
-
updated_at: string | null | undefined;
|
|
763
|
-
wallet_address: string | null | undefined;
|
|
764
|
-
};
|
|
765
|
-
type CreateParticipationDto = {
|
|
766
|
-
offer_id: string;
|
|
767
|
-
offer_option_id: string;
|
|
768
|
-
chain: string;
|
|
769
|
-
wallet_address: string;
|
|
770
|
-
amount: string;
|
|
771
|
-
asset_id: string;
|
|
772
|
-
approval_transaction_hash: string | null | undefined;
|
|
773
|
-
};
|
|
774
|
-
|
|
775
660
|
/** Unique identifier for a participation. */
|
|
776
661
|
type ParticipationId = Newtype<string, 'ParticipationId'>;
|
|
777
662
|
/** Casts a string into a typed {@link ParticipationId}. */
|
|
@@ -832,11 +717,19 @@ type CreateParticipationParams = {
|
|
|
832
717
|
chain: Blockchain;
|
|
833
718
|
/** Wallet address that funds the participation. */
|
|
834
719
|
walletAddress: WalletAddress;
|
|
835
|
-
/**
|
|
720
|
+
/**
|
|
721
|
+
* Decimal token amount to participate with (e.g. `"100"` for 100 USDC), NOT
|
|
722
|
+
* raw base units. The backend rescales this by the asset's decimals to verify
|
|
723
|
+
* it against the on-chain approval allowance.
|
|
724
|
+
*/
|
|
836
725
|
amount: string;
|
|
837
726
|
/** Funding asset id. */
|
|
838
727
|
assetId: AssetId;
|
|
839
|
-
/**
|
|
728
|
+
/**
|
|
729
|
+
* Hash of the ERC-20 `approve()` transaction covering this participation.
|
|
730
|
+
* Required: the backend verifies it on-chain (sender, token, spender, and
|
|
731
|
+
* approved amount) before confirming the participation.
|
|
732
|
+
*/
|
|
840
733
|
approvalTransactionHash: string;
|
|
841
734
|
};
|
|
842
735
|
declare const CreateParticipationParams: {
|
|
@@ -844,6 +737,184 @@ declare const CreateParticipationParams: {
|
|
|
844
737
|
toDto: (params: CreateParticipationParams) => CreateParticipationDto;
|
|
845
738
|
};
|
|
846
739
|
|
|
740
|
+
/**
|
|
741
|
+
* Read/write operations for token sales: listing and reading the current user's
|
|
742
|
+
* participations, and recording a new one. The on-chain execution flow
|
|
743
|
+
* (`executeTokenSale`) is layered on top of this in the client-side namespace.
|
|
744
|
+
*/
|
|
745
|
+
interface CoinListTokenSaleNamespace {
|
|
746
|
+
/**
|
|
747
|
+
* Fetches all participations by iterating through every paginated response,
|
|
748
|
+
* optionally filtered by offer.
|
|
749
|
+
*
|
|
750
|
+
* Requires an authenticated user; throws {@link NotAuthenticatedError}
|
|
751
|
+
* otherwise.
|
|
752
|
+
*/
|
|
753
|
+
fetchParticipations(offerId?: OfferId): Promise<Participation[]>;
|
|
754
|
+
/**
|
|
755
|
+
* Fetches a single page of participations, optionally filtered by offer.
|
|
756
|
+
*
|
|
757
|
+
* Requires an authenticated user; throws {@link NotAuthenticatedError}
|
|
758
|
+
* otherwise.
|
|
759
|
+
*/
|
|
760
|
+
fetchParticipationsPage(params: ParticipationsPaginationParams): Promise<PaginatedResponse<Participation>>;
|
|
761
|
+
/**
|
|
762
|
+
* Fetches a participation by id.
|
|
763
|
+
*
|
|
764
|
+
* Requires an authenticated user; throws {@link NotAuthenticatedError}
|
|
765
|
+
* otherwise.
|
|
766
|
+
*/
|
|
767
|
+
fetchParticipation(id: ParticipationId): Promise<Participation>;
|
|
768
|
+
/**
|
|
769
|
+
* Records a participation with CoinList.
|
|
770
|
+
*
|
|
771
|
+
* Requires an authenticated user; throws {@link NotAuthenticatedError}
|
|
772
|
+
* otherwise.
|
|
773
|
+
*/
|
|
774
|
+
createParticipation(params: CreateParticipationParams): Promise<Participation>;
|
|
775
|
+
}
|
|
776
|
+
declare class TokenSaleNamespaceImpl implements CoinListTokenSaleNamespace {
|
|
777
|
+
private readonly ctx;
|
|
778
|
+
constructor(ctx: SharedNamespaceContext);
|
|
779
|
+
fetchParticipations(offerId?: OfferId): Promise<Participation[]>;
|
|
780
|
+
fetchParticipationsPage(params: ParticipationsPaginationParams): Promise<PaginatedResponse<Participation>>;
|
|
781
|
+
fetchParticipation(id: ParticipationId): Promise<Participation>;
|
|
782
|
+
createParticipation(params: CreateParticipationParams): Promise<Participation>;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
type AuthorizationCode = Newtype<string, 'AuthorizationCode'>;
|
|
786
|
+
declare const AuthorizationCode: (value: string) => AuthorizationCode;
|
|
787
|
+
type CodeVerifier = Newtype<string, 'CodeVerifier'>;
|
|
788
|
+
declare const CodeVerifier: (value: string) => CodeVerifier;
|
|
789
|
+
type CodeChallenge = Newtype<string, 'CodeChallenge'>;
|
|
790
|
+
declare const CodeChallenge: (value: string) => CodeChallenge;
|
|
791
|
+
type PKCEState = Newtype<string, 'PKCEState'>;
|
|
792
|
+
declare const PKCEState: (value: string) => PKCEState;
|
|
793
|
+
type RedirectUri = Newtype<string, 'RedirectUri'>;
|
|
794
|
+
declare const RedirectUri: (value: string) => RedirectUri;
|
|
795
|
+
type ClientId = Newtype<string, 'ClientId'>;
|
|
796
|
+
declare const ClientId: (value: string) => ClientId;
|
|
797
|
+
type ClientSecret = Newtype<string, 'ClientSecret'>;
|
|
798
|
+
declare const ClientSecret: (value: string) => ClientSecret;
|
|
799
|
+
|
|
800
|
+
interface Config {
|
|
801
|
+
/** OAuth2 public identifier. */
|
|
802
|
+
readonly clientId: ClientId;
|
|
803
|
+
/**
|
|
804
|
+
* OAuth2 redirect URI. Recommended to point to a frontend page where
|
|
805
|
+
* {@link CoinListClient#completeOauth} can be called to complete the PKCE
|
|
806
|
+
* flow on the client side.
|
|
807
|
+
*/
|
|
808
|
+
readonly redirectUri: RedirectUri;
|
|
809
|
+
/**
|
|
810
|
+
* Recommended to leave undefined. Used to change the CoinList environment;
|
|
811
|
+
* default is production.
|
|
812
|
+
*/
|
|
813
|
+
readonly baseUrl?: string;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
type DocumentSubmissionStatusDto = 'INITIALIZED' | 'SENT' | 'VIEWED' | 'COMPLETED' | 'DECLINED' | 'EXPIRED';
|
|
817
|
+
type DocumentFormTypeDto = 'w8_ben' | 'w8_ben_e';
|
|
818
|
+
type DocumentSubmissionDto = {
|
|
819
|
+
object: 'document_submission';
|
|
820
|
+
status: DocumentSubmissionStatusDto;
|
|
821
|
+
form_type: DocumentFormTypeDto;
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
/** Document types that can be signed via {@link CoinListClient.submitDocument}. */
|
|
825
|
+
type DocumentType = 'tax_certification';
|
|
826
|
+
/** Signing-state machine status for a document submission. */
|
|
827
|
+
type DocumentSubmissionStatus = DocumentSubmissionStatusDto;
|
|
828
|
+
/** The tax form derived from the entity's kind (individual vs company/trust). */
|
|
829
|
+
type DocumentFormType = DocumentFormTypeDto;
|
|
830
|
+
/** Result of starting (or resuming) a document signing submission. */
|
|
831
|
+
type DocumentSubmission = {
|
|
832
|
+
status: DocumentSubmissionStatus;
|
|
833
|
+
formType: DocumentFormType;
|
|
834
|
+
};
|
|
835
|
+
declare const DocumentSubmission: {
|
|
836
|
+
fromDto: (dto: DocumentSubmissionDto) => DocumentSubmission;
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
type KycTokenDto = {
|
|
840
|
+
object: 'kyc_token';
|
|
841
|
+
token: string;
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Sumsub verification level name. Determines which screens the Sumsub WebSDK
|
|
846
|
+
* shows (levels are configured in the Sumsub dashboard). The backend
|
|
847
|
+
* prescribes the level (and whether the applicant must be reset first) in the
|
|
848
|
+
* requirement statuses response — clients never compute levels themselves.
|
|
849
|
+
*/
|
|
850
|
+
type KycLevelName = string;
|
|
851
|
+
/** Short-lived Sumsub WebSDK access token scoped to the current user. */
|
|
852
|
+
type KycToken = {
|
|
853
|
+
token: string;
|
|
854
|
+
};
|
|
855
|
+
declare const KycToken: {
|
|
856
|
+
fromDto: (dto: KycTokenDto) => KycToken;
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
/** Request body for `POST /v1/offers/:offer_id/addresses`. */
|
|
860
|
+
type CreateOfferOptionAddressDto = {
|
|
861
|
+
offer_option_id: string;
|
|
862
|
+
wallet_address: string;
|
|
863
|
+
chain: string;
|
|
864
|
+
signature: string;
|
|
865
|
+
};
|
|
866
|
+
/** Binding object returned by the `/v1/offers/:offer_id/addresses` resource. */
|
|
867
|
+
type OfferOptionAddressDto = {
|
|
868
|
+
id: string;
|
|
869
|
+
offer_option_id: string;
|
|
870
|
+
address: string;
|
|
871
|
+
protocol: WalletProtocol;
|
|
872
|
+
created_at: string;
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
/** Unique identifier for a proven wallet binding on an offer option. */
|
|
876
|
+
type OfferOptionAddressId = Newtype<string, 'OfferOptionAddressId'>;
|
|
877
|
+
/** Casts a string into a typed {@link OfferOptionAddressId}. */
|
|
878
|
+
declare const OfferOptionAddressId: (value: string) => OfferOptionAddressId;
|
|
879
|
+
/**
|
|
880
|
+
* A user's external wallet, proven via a wallet-ownership challenge and bound
|
|
881
|
+
* to an offer option. Returned by the `/v1/offers/:offer_id/addresses` resource.
|
|
882
|
+
*/
|
|
883
|
+
type OfferOptionAddress = {
|
|
884
|
+
/** Unique binding id. */
|
|
885
|
+
id: OfferOptionAddressId;
|
|
886
|
+
/** Offer option the wallet is bound to. */
|
|
887
|
+
offerOptionId: OfferOptionId;
|
|
888
|
+
/** The connected external wallet address. */
|
|
889
|
+
address: EvmWalletAddress;
|
|
890
|
+
/**
|
|
891
|
+
* Protocol the binding is scoped to. An EVM address binds once per option
|
|
892
|
+
* regardless of which EVM chain proved ownership.
|
|
893
|
+
*/
|
|
894
|
+
protocol: WalletProtocol;
|
|
895
|
+
/** When the binding was created. */
|
|
896
|
+
createdAt: Date;
|
|
897
|
+
};
|
|
898
|
+
declare const OfferOptionAddress: {
|
|
899
|
+
/** Maps the API DTO into the SDK offer-option-address domain model. */
|
|
900
|
+
fromDto: (dto: OfferOptionAddressDto) => OfferOptionAddress;
|
|
901
|
+
};
|
|
902
|
+
/** Parameters required to connect a proven external wallet to an offer option. */
|
|
903
|
+
type ConnectExternalWalletParams = {
|
|
904
|
+
/** Offer option to bind the wallet to. */
|
|
905
|
+
offerOptionId: OfferOptionId;
|
|
906
|
+
/** External wallet address that was proven. */
|
|
907
|
+
walletAddress: EvmWalletAddress;
|
|
908
|
+
/** Chain the ownership was proven on. */
|
|
909
|
+
chain: EthereumChain;
|
|
910
|
+
/** Signature of the wallet-ownership challenge message. */
|
|
911
|
+
signature: Hex;
|
|
912
|
+
};
|
|
913
|
+
declare const ConnectExternalWalletParams: {
|
|
914
|
+
/** Maps connect-wallet params into the API DTO payload. */
|
|
915
|
+
toDto: (params: ConnectExternalWalletParams) => CreateOfferOptionAddressDto;
|
|
916
|
+
};
|
|
917
|
+
|
|
847
918
|
type PiiKindDto = 'person' | 'company';
|
|
848
919
|
type PiiJurisdictionDto = {
|
|
849
920
|
iso_2: string;
|
|
@@ -966,4 +1037,4 @@ declare const RequirementStatusInfo: {
|
|
|
966
1037
|
fromStatusesDto: (dto: RequirementStatusesDto) => RequirementStatusInfo[];
|
|
967
1038
|
};
|
|
968
1039
|
|
|
969
|
-
export {
|
|
1040
|
+
export { type AllowWalletParams as $, AssetId as A, Bps as B, type CoinListSwapNamespace as C, type DocumentType as D, EvmWalletAddress as E, type Erc20Asset as F, AssetDecimals as G, StablecoinSymbol as H, OAuthSession as I, ClientCredentialsOAuth as J, type KycLevelName as K, ClientSecret as L, AssetSymbol as M, type Newtype as N, OfferId as O, Participation as P, SwapStatus as Q, Requirement as R, SwapNamespaceImpl as S, TokenSaleNamespaceImpl as T, type Uint256 as U, KnownAssetSymbol as V, WalletOwnershipChallenge as W, ClientId as X, RedirectUri as Y, CodeChallenge as Z, PKCEState as _, type EthereumChain as a, AllowWalletResponse as a0, Asset as a1, AssetCode as a2, Blockchain as a3, CreateParticipationParams as a4, Cursor as a5, type DocumentFormType as a6, type DocumentSubmissionStatus as a7, Erc20NamespaceImpl as a8, FaqItem as a9, TermItem as aA, TokenAllowance as aB, TokenBalance as aC, WalletAddress as aD, type WalletProtocol as aE, assertUint256 as aF, fetchAllPages as aG, type GetSwapAuthorizationParams as aa, type GetSwapPreviewParams as ab, type GetTokenAllowanceParams as ac, type GetTokenBalanceParams as ad, HexEncodedTransactionData as ae, Iso2CountryCode as af, Link as ag, MAX_UINT_256 as ah, Milestone as ai, OAuthRefreshToken as aj, OfferOption as ak, OfferOptionSlug as al, OfferSlug as am, type OfferType as an, type PaginatedResponseDto as ao, ParticipationId as ap, type ParticipationStatus as aq, ParticipationsPaginationParams as ar, PiiAddress as as, PiiJurisdiction as at, type PiiKind as au, type RequirementActionNeededReason as av, RequirementId as aw, SwapAuthorization as ax, type SwapContractRef as ay, SwapPreview as az, EvmContractAddress as b, type CoinListErc20Namespace as c, BlockchainAmount as d, type SharedNamespaceContext as e, type CoinListTokenSaleNamespace as f, OfferOptionId as g, AuthorizationCode as h, CodeVerifier as i, type Config as j, type OAuthAccessToken as k, Offer as l, PaginationParams as m, PaginatedResponse as n, OfferDetail as o, CreateWalletOwnershipChallengeParams as p, ConnectExternalWalletParams as q, OfferOptionAddress as r, OfferOptionAddressId as s, RequirementStatusInfo as t, Pii as u, DocumentSubmission as v, KycToken as w, type WalletChallengeType as x, type RequirementType as y, type RequirementStatusValue as z };
|