@echoxyz/sonar-core 0.13.0 → 0.14.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @echoxyz/sonar-core
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add wrapper function and hook for ReadCommitmentData endpoint
8
+
3
9
  ## 0.13.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -316,6 +316,16 @@ var SonarClient = class {
316
316
  SaleUUID: args.saleUUID
317
317
  });
318
318
  }
319
+ // Public API
320
+ async readCommitmentData(args) {
321
+ return this.postJSON(
322
+ "/sales.ReadCommitmentData",
323
+ {
324
+ SaleUUID: args.saleUUID
325
+ },
326
+ { includeAuth: false }
327
+ );
328
+ }
319
329
  };
320
330
  var APIError = class extends Error {
321
331
  status;
package/dist/index.d.cts CHANGED
@@ -126,6 +126,22 @@ type EntityInvestment = {
126
126
  type EntityInvestmentHistoryResponse = {
127
127
  Investments: EntityInvestment[];
128
128
  };
129
+ type Commitment = {
130
+ CommitmentID: Hex;
131
+ SaleSpecificEntityID: Hex;
132
+ PriceNumerator: string;
133
+ PriceDenominator: string;
134
+ PriceMicroUSD?: string;
135
+ Amounts: WalletTokenAmount[];
136
+ CreatedAt: string;
137
+ ExtraRaw: Hex;
138
+ ExtraDataParsed: unknown;
139
+ };
140
+ type WalletTokenAmount = {
141
+ Wallet: Hex;
142
+ Token: Hex;
143
+ Amount: string;
144
+ };
129
145
 
130
146
  type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
131
147
  type PrePurchaseCheckResponse = {
@@ -148,6 +164,16 @@ type ReadEntityResponse = {
148
164
  type ListAvailableEntitiesResponse = {
149
165
  Entities: EntityDetails[];
150
166
  };
167
+ type ReadCommitmentDataResponse = {
168
+ TotalCommitmentAmount: string;
169
+ ClearingPriceNumerator?: string;
170
+ ClearingPriceDenominator?: string;
171
+ ClearingPriceMicroUSD?: string;
172
+ PaymentTokenDecimals: number;
173
+ OfferedTokenDecimals?: number;
174
+ UniqueCommitmentCount: number;
175
+ Commitments: Commitment[];
176
+ };
151
177
  type TokenResponse = {
152
178
  access_token: string;
153
179
  refresh_token: string;
@@ -205,6 +231,9 @@ declare class SonarClient {
205
231
  listAvailableEntities(args: {
206
232
  saleUUID: string;
207
233
  }): Promise<ListAvailableEntitiesResponse>;
234
+ readCommitmentData(args: {
235
+ saleUUID: string;
236
+ }): Promise<ReadCommitmentDataResponse>;
208
237
  }
209
238
  declare class APIError extends Error {
210
239
  readonly status: number;
@@ -239,4 +268,4 @@ type CreateClientOptions = {
239
268
  };
240
269
  declare function createClient(options?: CreateClientOptions): SonarClient;
241
270
 
242
- export { APIError, type AllocationPermit, type BasicPermit, type BasicPermitV2, type BasicPermitV3, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, type EntityID, type EntityInvestment, type EntityInvestmentHistoryResponse, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type LimitsResponse, type ListAvailableEntitiesResponse, type MyProfileResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
271
+ export { APIError, type AllocationPermit, type BasicPermit, type BasicPermitV2, type BasicPermitV3, type BuildAuthorizationUrlArgs, type ClientOptions, type Commitment, type CreateClientOptions, type EntityDetails, type EntityID, type EntityInvestment, type EntityInvestmentHistoryResponse, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type LimitsResponse, type ListAvailableEntitiesResponse, type MyProfileResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadCommitmentDataResponse, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, type WalletTokenAmount, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
package/dist/index.d.ts CHANGED
@@ -126,6 +126,22 @@ type EntityInvestment = {
126
126
  type EntityInvestmentHistoryResponse = {
127
127
  Investments: EntityInvestment[];
128
128
  };
129
+ type Commitment = {
130
+ CommitmentID: Hex;
131
+ SaleSpecificEntityID: Hex;
132
+ PriceNumerator: string;
133
+ PriceDenominator: string;
134
+ PriceMicroUSD?: string;
135
+ Amounts: WalletTokenAmount[];
136
+ CreatedAt: string;
137
+ ExtraRaw: Hex;
138
+ ExtraDataParsed: unknown;
139
+ };
140
+ type WalletTokenAmount = {
141
+ Wallet: Hex;
142
+ Token: Hex;
143
+ Amount: string;
144
+ };
129
145
 
130
146
  type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
131
147
  type PrePurchaseCheckResponse = {
@@ -148,6 +164,16 @@ type ReadEntityResponse = {
148
164
  type ListAvailableEntitiesResponse = {
149
165
  Entities: EntityDetails[];
150
166
  };
167
+ type ReadCommitmentDataResponse = {
168
+ TotalCommitmentAmount: string;
169
+ ClearingPriceNumerator?: string;
170
+ ClearingPriceDenominator?: string;
171
+ ClearingPriceMicroUSD?: string;
172
+ PaymentTokenDecimals: number;
173
+ OfferedTokenDecimals?: number;
174
+ UniqueCommitmentCount: number;
175
+ Commitments: Commitment[];
176
+ };
151
177
  type TokenResponse = {
152
178
  access_token: string;
153
179
  refresh_token: string;
@@ -205,6 +231,9 @@ declare class SonarClient {
205
231
  listAvailableEntities(args: {
206
232
  saleUUID: string;
207
233
  }): Promise<ListAvailableEntitiesResponse>;
234
+ readCommitmentData(args: {
235
+ saleUUID: string;
236
+ }): Promise<ReadCommitmentDataResponse>;
208
237
  }
209
238
  declare class APIError extends Error {
210
239
  readonly status: number;
@@ -239,4 +268,4 @@ type CreateClientOptions = {
239
268
  };
240
269
  declare function createClient(options?: CreateClientOptions): SonarClient;
241
270
 
242
- export { APIError, type AllocationPermit, type BasicPermit, type BasicPermitV2, type BasicPermitV3, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, type EntityID, type EntityInvestment, type EntityInvestmentHistoryResponse, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type LimitsResponse, type ListAvailableEntitiesResponse, type MyProfileResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
271
+ export { APIError, type AllocationPermit, type BasicPermit, type BasicPermitV2, type BasicPermitV3, type BuildAuthorizationUrlArgs, type ClientOptions, type Commitment, type CreateClientOptions, type EntityDetails, type EntityID, type EntityInvestment, type EntityInvestmentHistoryResponse, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type LimitsResponse, type ListAvailableEntitiesResponse, type MyProfileResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadCommitmentDataResponse, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, type WalletTokenAmount, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
package/dist/index.js CHANGED
@@ -279,6 +279,16 @@ var SonarClient = class {
279
279
  SaleUUID: args.saleUUID
280
280
  });
281
281
  }
282
+ // Public API
283
+ async readCommitmentData(args) {
284
+ return this.postJSON(
285
+ "/sales.ReadCommitmentData",
286
+ {
287
+ SaleUUID: args.saleUUID
288
+ },
289
+ { includeAuth: false }
290
+ );
291
+ }
282
292
  };
283
293
  var APIError = class extends Error {
284
294
  status;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@echoxyz/sonar-core",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",