@coinlist-co/react 0.4.0 → 0.5.0

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.
Files changed (61) hide show
  1. package/dist/chunk-CRACFEJ4.js +17 -0
  2. package/dist/chunk-CRACFEJ4.js.map +1 -0
  3. package/dist/{chunk-NC45IO63.js → chunk-N3WBC2VS.js} +20 -325
  4. package/dist/chunk-N3WBC2VS.js.map +1 -0
  5. package/dist/chunk-V6WO67RO.js +311 -0
  6. package/dist/chunk-V6WO67RO.js.map +1 -0
  7. package/dist/client/index.cjs +1013 -220
  8. package/dist/client/index.cjs.map +1 -1
  9. package/dist/client/index.d.cts +526 -9
  10. package/dist/client/index.d.ts +526 -9
  11. package/dist/client/index.js +1464 -94
  12. package/dist/client/index.js.map +1 -1
  13. package/dist/{participation-DMMEDxON.d.cts → requirement-BEO42QOr.d.cts} +204 -2
  14. package/dist/{participation-E-bT-GXJ.d.ts → requirement-BEO42QOr.d.ts} +204 -2
  15. package/dist/server/index.cjs +9 -91
  16. package/dist/server/index.cjs.map +1 -1
  17. package/dist/server/index.d.cts +4 -21
  18. package/dist/server/index.d.ts +4 -21
  19. package/dist/server/index.js +14 -78
  20. package/dist/server/index.js.map +1 -1
  21. package/dist/shared/index.cjs +375 -0
  22. package/dist/shared/index.cjs.map +1 -0
  23. package/dist/shared/index.d.cts +35 -0
  24. package/dist/shared/index.d.ts +35 -0
  25. package/dist/{client/core → shared}/index.js +35 -16
  26. package/dist/shared/index.js.map +1 -0
  27. package/package.json +7 -22
  28. package/dist/RequirementItem-B-MvcxSr.d.cts +0 -37
  29. package/dist/RequirementItem-DcYot2uC.d.ts +0 -37
  30. package/dist/chunk-EHZ6PIGN.js +0 -414
  31. package/dist/chunk-EHZ6PIGN.js.map +0 -1
  32. package/dist/chunk-NC45IO63.js.map +0 -1
  33. package/dist/chunk-RIFATQB5.js +0 -257
  34. package/dist/chunk-RIFATQB5.js.map +0 -1
  35. package/dist/chunk-UGJUTRXC.js +0 -304
  36. package/dist/chunk-UGJUTRXC.js.map +0 -1
  37. package/dist/chunk-YJQMJFA7.js +0 -16
  38. package/dist/chunk-YJQMJFA7.js.map +0 -1
  39. package/dist/client/components/index.cjs +0 -1108
  40. package/dist/client/components/index.cjs.map +0 -1
  41. package/dist/client/components/index.d.cts +0 -139
  42. package/dist/client/components/index.d.ts +0 -139
  43. package/dist/client/components/index.js +0 -558
  44. package/dist/client/components/index.js.map +0 -1
  45. package/dist/client/core/index.cjs +0 -1047
  46. package/dist/client/core/index.cjs.map +0 -1
  47. package/dist/client/core/index.d.cts +0 -23
  48. package/dist/client/core/index.d.ts +0 -23
  49. package/dist/client/core/index.js.map +0 -1
  50. package/dist/client/hooks/index.cjs +0 -307
  51. package/dist/client/hooks/index.cjs.map +0 -1
  52. package/dist/client/hooks/index.d.cts +0 -126
  53. package/dist/client/hooks/index.d.ts +0 -126
  54. package/dist/client/hooks/index.js +0 -19
  55. package/dist/client/hooks/index.js.map +0 -1
  56. package/dist/coinlist-client-BSxpqylo.d.ts +0 -158
  57. package/dist/coinlist-client-Cah5c_aF.d.cts +0 -158
  58. package/dist/requirement-XWT0T_zO.d.cts +0 -205
  59. package/dist/requirement-XWT0T_zO.d.ts +0 -205
  60. package/dist/useCoinListRequirements-B5-ZPOMz.d.ts +0 -80
  61. package/dist/useCoinListRequirements-Cuc32Tqw.d.cts +0 -80
@@ -1,4 +1,7 @@
1
- import { N as Newtype, A as AssetDto, b as OfferId, d as OfferOptionId, k as Asset, l as AssetId } from './requirement-XWT0T_zO.js';
1
+ declare const __brand: unique symbol;
2
+ type Newtype<Base, Branding> = Base & {
3
+ readonly [__brand]: Branding;
4
+ };
2
5
 
3
6
  type AuthorizationCode = Newtype<string, 'AuthorizationCode'>;
4
7
  declare const AuthorizationCode: (value: string) => AuthorizationCode;
@@ -85,6 +88,171 @@ declare const OAuthSession: {
85
88
  fromDto: (dto: OAuthSessionDto) => OAuthSession;
86
89
  };
87
90
 
91
+ type OfferDto = {
92
+ id: string;
93
+ slug: string;
94
+ tagline: string | null | undefined;
95
+ banner_url: string | null | undefined;
96
+ logo_url: string | null | undefined;
97
+ starts_at: string;
98
+ ends_at: string;
99
+ };
100
+
101
+ type OfferId = Newtype<string, 'OfferId'>;
102
+ declare const OfferId: (value: string) => OfferId;
103
+ type OfferSlug = Newtype<string, 'OfferSlug'>;
104
+ declare const OfferSlug: (value: string) => OfferSlug;
105
+ type Offer = {
106
+ id: OfferId;
107
+ slug: OfferSlug;
108
+ tagline: string | null;
109
+ bannerUrl: string | null;
110
+ logoUrl: string | null;
111
+ startsAt: Date;
112
+ endsAt: Date;
113
+ };
114
+ declare const Offer: {
115
+ fromDto: (dto: OfferDto) => Offer;
116
+ };
117
+
118
+ type AssetDto = {
119
+ code: string;
120
+ fractional_digits: number;
121
+ id: string;
122
+ name: string;
123
+ };
124
+
125
+ type AssetId = Newtype<string, 'AssetId'>;
126
+ declare const AssetId: (value: string) => AssetId;
127
+ type AssetCode = Newtype<string, 'AssetCode'>;
128
+ declare const AssetCode: (value: string) => AssetCode;
129
+ type Asset = {
130
+ id: AssetId;
131
+ code: AssetCode;
132
+ name: string;
133
+ fractionalDigits: number;
134
+ };
135
+ declare const Asset: {
136
+ fromDto: (dto: AssetDto) => Asset;
137
+ };
138
+
139
+ type OfferDetailDto = {
140
+ asset: AssetDto;
141
+ faqs: OfferDetailFaqDto[];
142
+ funding_assets: AssetDto[];
143
+ id: string;
144
+ links: OfferDetailLinkDto[];
145
+ milestones: OfferDetailMilestoneDto[];
146
+ name: string;
147
+ object: 'offer_details';
148
+ options: OfferDetailOptionDto[];
149
+ slug: string;
150
+ terms: OfferDetailTermDto[];
151
+ about: string | null | undefined;
152
+ banner_url: string | null | undefined;
153
+ category: string | null | undefined;
154
+ ends_at: string;
155
+ logo_url: string | null | undefined;
156
+ starts_at: string;
157
+ tagline: string | null | undefined;
158
+ };
159
+ type OfferDetailFaqDto = {
160
+ answer: string | null;
161
+ question: string | null;
162
+ };
163
+ type OfferDetailLinkDto = {
164
+ label: string | null;
165
+ url: string | null;
166
+ };
167
+ type OfferDetailMilestoneDto = {
168
+ name: string | null;
169
+ schedule: string | null;
170
+ status: 'completed' | 'active' | 'upcoming';
171
+ };
172
+ type OfferDetailOptionDto = {
173
+ bid_increment: number | null;
174
+ floor_price_usd: number | null;
175
+ id: string;
176
+ minimum_purchase_usd: number | null;
177
+ price_usd: string | null;
178
+ sale_agreement_url: string | null;
179
+ slug: string;
180
+ total_token_supply: number | null;
181
+ };
182
+ type OfferDetailTermDto = {
183
+ key: string | null;
184
+ value: string | null;
185
+ };
186
+
187
+ type OfferOptionId = Newtype<string, 'OfferOptionId'>;
188
+ declare const OfferOptionId: (value: string) => OfferOptionId;
189
+ type OfferOptionSlug = Newtype<string, 'OfferOptionSlug'>;
190
+ declare const OfferOptionSlug: (value: string) => OfferOptionSlug;
191
+ type OfferDetail = {
192
+ id: OfferId;
193
+ slug: OfferSlug;
194
+ name: string;
195
+ asset: Asset;
196
+ fundingAssets: Asset[];
197
+ about: string | null;
198
+ tagline: string | null;
199
+ bannerUrl: string | null;
200
+ logoUrl: string | null;
201
+ category: string | null;
202
+ startsAt: Date;
203
+ endsAt: Date;
204
+ faqs: FaqItem[];
205
+ links: Link[];
206
+ milestones: Milestone[];
207
+ options: OfferOption[];
208
+ terms: TermItem[];
209
+ };
210
+ declare const OfferDetail: {
211
+ fromDto: (dto: OfferDetailDto) => OfferDetail;
212
+ };
213
+ type OfferOption = {
214
+ id: OfferOptionId;
215
+ slug: OfferOptionSlug;
216
+ bidIncrement: number | null;
217
+ floorPriceUsd: number | null;
218
+ minimumPurchaseUsd: number | null;
219
+ priceUsd: string | null;
220
+ saleAgreementUrl: string | null;
221
+ totalTokenSupply: number | null;
222
+ };
223
+ declare const OfferOption: {
224
+ fromDto: (dto: OfferDetailOptionDto) => OfferOption;
225
+ };
226
+ type FaqItem = {
227
+ question: string | null;
228
+ answer: string | null;
229
+ };
230
+ declare const FaqItem: {
231
+ fromDto: (dto: OfferDetailFaqDto) => FaqItem;
232
+ };
233
+ type Link = {
234
+ label: string | null;
235
+ url: string | null;
236
+ };
237
+ declare const Link: {
238
+ fromDto: (dto: OfferDetailLinkDto) => Link;
239
+ };
240
+ type TermItem = {
241
+ key: string | null;
242
+ value: string | null;
243
+ };
244
+ declare const TermItem: {
245
+ fromDto: (dto: OfferDetailTermDto) => TermItem;
246
+ };
247
+ type Milestone = {
248
+ name: string | null;
249
+ schedule: string | null;
250
+ status: 'completed' | 'active' | 'upcoming';
251
+ };
252
+ declare const Milestone: {
253
+ fromDto: (dto: OfferDetailMilestoneDto) => Milestone;
254
+ };
255
+
88
256
  type ParticipationStatusDto = 'prepared' | 'pending' | 'submitted' | 'completed' | 'failed' | 'remit_submitted' | 'remitted' | 'remit_failed';
89
257
  type ParticipationDto = {
90
258
  object: 'participation';
@@ -182,4 +350,38 @@ declare const CreateParticipationParams: {
182
350
  toDto: (params: CreateParticipationParams) => CreateParticipationDto;
183
351
  };
184
352
 
185
- export { AuthorizationCode as A, Blockchain as B, ClientId as C, type OAuthAccessToken as O, PaginatedResponse as P, RedirectUri as R, WalletAddress as W, ClientSecret as a, CodeChallenge as b, CodeVerifier as c, CreateParticipationParams as d, Cursor as e, OAuthRefreshToken as f, OAuthSession as g, type PaginatedResponseDto as h, PaginationParams as i, Participation as j, ParticipationId as k, type ParticipationStatus as l, ParticipationsPaginationParams as m, fetchAllPages as n, type Config as o };
353
+ type RequirementTypeDto = 'kyc_approved' | 'identity_verified' | 'proof_of_address' | 'source_of_funds' | 'external_wallet' | 'whitelisted_wallet' | 'jurisdiction' | 'accreditation';
354
+ type RequirementDto = {
355
+ object: 'requirement';
356
+ id: string;
357
+ type: RequirementTypeDto;
358
+ details: Record<string, unknown> | null;
359
+ };
360
+ type RequirementStatusValueDto = 'not_started' | 'in_progress' | 'action_needed' | 'completed' | 'rejected';
361
+ type RequirementStatusesDto = {
362
+ object: 'requirement_statuses';
363
+ offer_id: string;
364
+ statuses: Record<string, RequirementStatusValueDto>;
365
+ };
366
+
367
+ type RequirementId = Newtype<string, 'RequirementId'>;
368
+ declare const RequirementId: (value: string) => RequirementId;
369
+ type RequirementType = RequirementTypeDto;
370
+ type RequirementStatusValue = RequirementStatusValueDto;
371
+ type Requirement = {
372
+ id: RequirementId;
373
+ type: RequirementType;
374
+ details: Record<string, unknown> | null;
375
+ };
376
+ declare const Requirement: {
377
+ fromDto: (dto: RequirementDto) => Requirement;
378
+ };
379
+ type RequirementStatusInfo = {
380
+ id: RequirementId;
381
+ status: RequirementStatusValue;
382
+ };
383
+ declare const RequirementStatusInfo: {
384
+ fromStatusesDto: (dto: RequirementStatusesDto) => RequirementStatusInfo[];
385
+ };
386
+
387
+ export { AuthorizationCode as A, Blockchain as B, CodeVerifier as C, type ParticipationStatus as D, RedirectUri as E, FaqItem as F, RequirementId as G, fetchAllPages as H, Link as L, Milestone as M, type Newtype as N, type OAuthAccessToken as O, PaginationParams as P, Requirement as R, TermItem as T, WalletAddress as W, type Config as a, Offer as b, PaginatedResponse as c, OfferId as d, OfferDetail as e, Participation as f, ParticipationsPaginationParams as g, ParticipationId as h, CreateParticipationParams as i, OfferOptionId as j, RequirementStatusInfo as k, type RequirementType as l, type RequirementStatusValue as m, OAuthSession as n, ClientSecret as o, Asset as p, AssetCode as q, AssetId as r, ClientId as s, CodeChallenge as t, Cursor as u, OAuthRefreshToken as v, OfferOption as w, OfferOptionSlug as x, OfferSlug as y, type PaginatedResponseDto as z };
@@ -20,41 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/server/index.ts
21
21
  var server_exports = {};
22
22
  __export(server_exports, {
23
- AuthorizationCode: () => AuthorizationCode,
24
- Blockchain: () => Blockchain,
25
- ClientId: () => ClientId,
26
- ClientSecret: () => ClientSecret,
27
- CodeChallenge: () => CodeChallenge,
28
- CodeVerifier: () => CodeVerifier,
29
- CreateParticipationParams: () => CreateParticipationParams,
30
- Cursor: () => Cursor,
31
- FaqItem: () => FaqItem,
32
- Link: () => Link,
33
- Milestone: () => Milestone,
34
- NotAuthenticatedError: () => NotAuthenticatedError,
35
- NotImplementedError: () => NotImplementedError,
36
- OAuthRefreshToken: () => OAuthRefreshToken,
37
- OAuthSession: () => OAuthSession,
38
- Offer: () => Offer,
39
- OfferDetail: () => OfferDetail,
40
- OfferId: () => OfferId,
41
- OfferOption: () => OfferOption,
42
- OfferOptionId: () => OfferOptionId,
43
- OfferOptionSlug: () => OfferOptionSlug,
44
- OfferSlug: () => OfferSlug,
45
- PaginatedResponse: () => PaginatedResponse,
46
- PaginationParams: () => PaginationParams,
47
- Participation: () => Participation,
48
- ParticipationId: () => ParticipationId,
49
- ParticipationsPaginationParams: () => ParticipationsPaginationParams,
50
- RedirectUri: () => RedirectUri,
51
- Requirement: () => Requirement,
52
- RequirementId: () => RequirementId,
53
- RequirementStatusInfo: () => RequirementStatusInfo,
54
- TermItem: () => TermItem,
55
- WalletAddress: () => WalletAddress,
56
- createCoinListServer: () => createCoinListServer,
57
- fetchAllPages: () => fetchAllPages
23
+ createCoinListServer: () => createCoinListServer
58
24
  });
59
25
  module.exports = __toCommonJS(server_exports);
60
26
 
@@ -201,7 +167,7 @@ var Request = {
201
167
  concatAttributes
202
168
  };
203
169
 
204
- // src/shared/api/frontline/index.ts
170
+ // src/shared/api/frontline/config.ts
205
171
  var PUBLIC_API_BASE_URL = "https://api.coinlist.co";
206
172
  var HEADER_API_VERSION = "X-API-Version";
207
173
  var HEADER_IDEMPOTENCY_KEY = "Idempotency-Key";
@@ -581,7 +547,7 @@ var Milestone = {
581
547
  };
582
548
 
583
549
  // src/shared/api/frontline/offers.ts
584
- async function fetchAllOffers(api) {
550
+ async function fetchOffers(api) {
585
551
  return fetchAllPages((params) => fetchOffersPage(api, params));
586
552
  }
587
553
  async function fetchOffersPage(api, params) {
@@ -651,7 +617,7 @@ var CreateParticipationParams = {
651
617
  };
652
618
 
653
619
  // src/shared/api/frontline/participations.ts
654
- async function fetchAllParticipations(api, offerId) {
620
+ async function fetchParticipations(api, offerId) {
655
621
  return fetchAllPages(
656
622
  (params) => fetchParticipationsPage(api, params),
657
623
  { offerId }
@@ -724,12 +690,6 @@ async function fetchRequirementStatuses(api, offerId) {
724
690
  }
725
691
 
726
692
  // src/shared/types/errors.ts
727
- var NotImplementedError = class extends Error {
728
- constructor(message = "Not implemented yet") {
729
- super(message);
730
- this.name = "NotImplementedError";
731
- }
732
- };
733
693
  var NotAuthenticatedError = class extends Error {
734
694
  constructor(message = "The user is not authenticated. Go through the OAuth flow first!") {
735
695
  super(message);
@@ -850,9 +810,9 @@ var CoinListServerImpl = class {
850
810
  throw new NotAuthenticatedError();
851
811
  }
852
812
  }
853
- async fetchAllOffers() {
813
+ async fetchOffers() {
854
814
  await this.ensureAuthenticated();
855
- return fetchAllOffers(this.api);
815
+ return fetchOffers(this.api);
856
816
  }
857
817
  async fetchOffersPage(params) {
858
818
  await this.ensureAuthenticated();
@@ -862,9 +822,9 @@ var CoinListServerImpl = class {
862
822
  await this.ensureAuthenticated();
863
823
  return fetchOfferDetails(this.api, id);
864
824
  }
865
- async fetchAllParticipations(offerId) {
825
+ async fetchParticipations(offerId) {
866
826
  await this.ensureAuthenticated();
867
- return fetchAllParticipations(this.api, offerId);
827
+ return fetchParticipations(this.api, offerId);
868
828
  }
869
829
  async fetchParticipationsPage(params) {
870
830
  await this.ensureAuthenticated();
@@ -890,50 +850,8 @@ var CoinListServerImpl = class {
890
850
  function createCoinListServer(config) {
891
851
  return new CoinListServerImpl(config);
892
852
  }
893
-
894
- // src/shared/types/oauth.ts
895
- var AuthorizationCode = (value) => value;
896
- var CodeVerifier = (value) => value;
897
- var CodeChallenge = (value) => value;
898
- var RedirectUri = (value) => value;
899
- var ClientId = (value) => value;
900
- var ClientSecret = (value) => value;
901
853
  // Annotate the CommonJS export names for ESM import in node:
902
854
  0 && (module.exports = {
903
- AuthorizationCode,
904
- Blockchain,
905
- ClientId,
906
- ClientSecret,
907
- CodeChallenge,
908
- CodeVerifier,
909
- CreateParticipationParams,
910
- Cursor,
911
- FaqItem,
912
- Link,
913
- Milestone,
914
- NotAuthenticatedError,
915
- NotImplementedError,
916
- OAuthRefreshToken,
917
- OAuthSession,
918
- Offer,
919
- OfferDetail,
920
- OfferId,
921
- OfferOption,
922
- OfferOptionId,
923
- OfferOptionSlug,
924
- OfferSlug,
925
- PaginatedResponse,
926
- PaginationParams,
927
- Participation,
928
- ParticipationId,
929
- ParticipationsPaginationParams,
930
- RedirectUri,
931
- Requirement,
932
- RequirementId,
933
- RequirementStatusInfo,
934
- TermItem,
935
- WalletAddress,
936
- createCoinListServer,
937
- fetchAllPages
855
+ createCoinListServer
938
856
  });
939
857
  //# sourceMappingURL=index.cjs.map