@echoxyz/sonar-core 0.8.0 → 0.10.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 +16 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +20 -6
- package/dist/index.d.ts +20 -6
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @echoxyz/sonar-core
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d42882b: Changed entityID parameter names
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- d3dce74: Change EntityID type to a string and add SaleSpecificEntityID
|
|
12
|
+
|
|
13
|
+
## 0.9.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- cbf7964: Support new V2 permit
|
|
18
|
+
|
|
3
19
|
## 0.8.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -398,6 +398,7 @@ var SaleEligibility = /* @__PURE__ */ ((SaleEligibility2) => {
|
|
|
398
398
|
})(SaleEligibility || {});
|
|
399
399
|
var PurchasePermitType = /* @__PURE__ */ ((PurchasePermitType2) => {
|
|
400
400
|
PurchasePermitType2["BASIC"] = "basic";
|
|
401
|
+
PurchasePermitType2["BASIC_V2"] = "basic-v2";
|
|
401
402
|
PurchasePermitType2["ALLOCATION"] = "allocation";
|
|
402
403
|
return PurchasePermitType2;
|
|
403
404
|
})(PurchasePermitType || {});
|
package/dist/index.d.cts
CHANGED
|
@@ -28,6 +28,7 @@ declare class AuthSession {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
type Hex = `0x${string}`;
|
|
31
|
+
type EntityID = string;
|
|
31
32
|
declare enum EntityType {
|
|
32
33
|
USER = "user",
|
|
33
34
|
ORGANIZATION = "organization"
|
|
@@ -59,11 +60,23 @@ type AllocationPermit = {
|
|
|
59
60
|
MaxAmount: string;
|
|
60
61
|
MinAmount: string;
|
|
61
62
|
};
|
|
63
|
+
type BasicPermitV2 = {
|
|
64
|
+
EntityID: Hex;
|
|
65
|
+
SaleUUID: Hex;
|
|
66
|
+
Wallet: Hex;
|
|
67
|
+
ExpiresAt: number;
|
|
68
|
+
MinAmount: string;
|
|
69
|
+
MaxAmount: string;
|
|
70
|
+
MinPrice: number;
|
|
71
|
+
MaxPrice: number;
|
|
72
|
+
Payload: Hex;
|
|
73
|
+
};
|
|
62
74
|
declare enum PurchasePermitType {
|
|
63
75
|
BASIC = "basic",
|
|
76
|
+
BASIC_V2 = "basic-v2",
|
|
64
77
|
ALLOCATION = "allocation"
|
|
65
78
|
}
|
|
66
|
-
type PurchasePermit<T extends PurchasePermitType> = T extends PurchasePermitType.BASIC ? BasicPermit : T extends PurchasePermitType.ALLOCATION ? AllocationPermit : never;
|
|
79
|
+
type PurchasePermit<T extends PurchasePermitType> = T extends PurchasePermitType.BASIC ? BasicPermit : T extends PurchasePermitType.BASIC_V2 ? BasicPermitV2 : T extends PurchasePermitType.ALLOCATION ? AllocationPermit : never;
|
|
67
80
|
declare enum PrePurchaseFailureReason {
|
|
68
81
|
UNKNOWN = "unknown",
|
|
69
82
|
WALLET_RISK = "wallet-risk",
|
|
@@ -80,7 +93,8 @@ declare enum InvestingRegion {
|
|
|
80
93
|
}
|
|
81
94
|
type EntityDetails = {
|
|
82
95
|
Label: string;
|
|
83
|
-
EntityID:
|
|
96
|
+
EntityID: EntityID;
|
|
97
|
+
SaleSpecificEntityID: Hex;
|
|
84
98
|
EntityType: EntityType;
|
|
85
99
|
EntitySetupState: EntitySetupState;
|
|
86
100
|
SaleEligibility: SaleEligibility;
|
|
@@ -94,7 +108,7 @@ type PrePurchaseCheckResponse = {
|
|
|
94
108
|
LivenessCheckURL: string;
|
|
95
109
|
};
|
|
96
110
|
type GeneratePurchasePermitResponse = {
|
|
97
|
-
PermitJSON: BasicPermit | AllocationPermit;
|
|
111
|
+
PermitJSON: BasicPermit | BasicPermitV2 | AllocationPermit;
|
|
98
112
|
Signature: Hex;
|
|
99
113
|
};
|
|
100
114
|
type AllocationResponse = {
|
|
@@ -144,12 +158,12 @@ declare class SonarClient {
|
|
|
144
158
|
}): Promise<TokenResponse>;
|
|
145
159
|
prePurchaseCheck(args: {
|
|
146
160
|
saleUUID: string;
|
|
147
|
-
entityID:
|
|
161
|
+
entityID: EntityID;
|
|
148
162
|
walletAddress: string;
|
|
149
163
|
}): Promise<PrePurchaseCheckResponse>;
|
|
150
164
|
generatePurchasePermit(args: {
|
|
151
165
|
saleUUID: string;
|
|
152
|
-
entityID:
|
|
166
|
+
entityID: EntityID;
|
|
153
167
|
walletAddress: string;
|
|
154
168
|
}): Promise<GeneratePurchasePermitResponse>;
|
|
155
169
|
fetchAllocation(args: {
|
|
@@ -197,4 +211,4 @@ type CreateClientOptions = {
|
|
|
197
211
|
};
|
|
198
212
|
declare function createClient(options?: CreateClientOptions): SonarClient;
|
|
199
213
|
|
|
200
|
-
export { APIError, type AllocationPermit, type AllocationResponse, type BasicPermit, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type ListAvailableEntitiesResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
|
|
214
|
+
export { APIError, type AllocationPermit, type AllocationResponse, type BasicPermit, type BasicPermitV2, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, type EntityID, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type ListAvailableEntitiesResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ declare class AuthSession {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
type Hex = `0x${string}`;
|
|
31
|
+
type EntityID = string;
|
|
31
32
|
declare enum EntityType {
|
|
32
33
|
USER = "user",
|
|
33
34
|
ORGANIZATION = "organization"
|
|
@@ -59,11 +60,23 @@ type AllocationPermit = {
|
|
|
59
60
|
MaxAmount: string;
|
|
60
61
|
MinAmount: string;
|
|
61
62
|
};
|
|
63
|
+
type BasicPermitV2 = {
|
|
64
|
+
EntityID: Hex;
|
|
65
|
+
SaleUUID: Hex;
|
|
66
|
+
Wallet: Hex;
|
|
67
|
+
ExpiresAt: number;
|
|
68
|
+
MinAmount: string;
|
|
69
|
+
MaxAmount: string;
|
|
70
|
+
MinPrice: number;
|
|
71
|
+
MaxPrice: number;
|
|
72
|
+
Payload: Hex;
|
|
73
|
+
};
|
|
62
74
|
declare enum PurchasePermitType {
|
|
63
75
|
BASIC = "basic",
|
|
76
|
+
BASIC_V2 = "basic-v2",
|
|
64
77
|
ALLOCATION = "allocation"
|
|
65
78
|
}
|
|
66
|
-
type PurchasePermit<T extends PurchasePermitType> = T extends PurchasePermitType.BASIC ? BasicPermit : T extends PurchasePermitType.ALLOCATION ? AllocationPermit : never;
|
|
79
|
+
type PurchasePermit<T extends PurchasePermitType> = T extends PurchasePermitType.BASIC ? BasicPermit : T extends PurchasePermitType.BASIC_V2 ? BasicPermitV2 : T extends PurchasePermitType.ALLOCATION ? AllocationPermit : never;
|
|
67
80
|
declare enum PrePurchaseFailureReason {
|
|
68
81
|
UNKNOWN = "unknown",
|
|
69
82
|
WALLET_RISK = "wallet-risk",
|
|
@@ -80,7 +93,8 @@ declare enum InvestingRegion {
|
|
|
80
93
|
}
|
|
81
94
|
type EntityDetails = {
|
|
82
95
|
Label: string;
|
|
83
|
-
EntityID:
|
|
96
|
+
EntityID: EntityID;
|
|
97
|
+
SaleSpecificEntityID: Hex;
|
|
84
98
|
EntityType: EntityType;
|
|
85
99
|
EntitySetupState: EntitySetupState;
|
|
86
100
|
SaleEligibility: SaleEligibility;
|
|
@@ -94,7 +108,7 @@ type PrePurchaseCheckResponse = {
|
|
|
94
108
|
LivenessCheckURL: string;
|
|
95
109
|
};
|
|
96
110
|
type GeneratePurchasePermitResponse = {
|
|
97
|
-
PermitJSON: BasicPermit | AllocationPermit;
|
|
111
|
+
PermitJSON: BasicPermit | BasicPermitV2 | AllocationPermit;
|
|
98
112
|
Signature: Hex;
|
|
99
113
|
};
|
|
100
114
|
type AllocationResponse = {
|
|
@@ -144,12 +158,12 @@ declare class SonarClient {
|
|
|
144
158
|
}): Promise<TokenResponse>;
|
|
145
159
|
prePurchaseCheck(args: {
|
|
146
160
|
saleUUID: string;
|
|
147
|
-
entityID:
|
|
161
|
+
entityID: EntityID;
|
|
148
162
|
walletAddress: string;
|
|
149
163
|
}): Promise<PrePurchaseCheckResponse>;
|
|
150
164
|
generatePurchasePermit(args: {
|
|
151
165
|
saleUUID: string;
|
|
152
|
-
entityID:
|
|
166
|
+
entityID: EntityID;
|
|
153
167
|
walletAddress: string;
|
|
154
168
|
}): Promise<GeneratePurchasePermitResponse>;
|
|
155
169
|
fetchAllocation(args: {
|
|
@@ -197,4 +211,4 @@ type CreateClientOptions = {
|
|
|
197
211
|
};
|
|
198
212
|
declare function createClient(options?: CreateClientOptions): SonarClient;
|
|
199
213
|
|
|
200
|
-
export { APIError, type AllocationPermit, type AllocationResponse, type BasicPermit, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type ListAvailableEntitiesResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
|
|
214
|
+
export { APIError, type AllocationPermit, type AllocationResponse, type BasicPermit, type BasicPermitV2, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, type EntityID, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type ListAvailableEntitiesResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
|
package/dist/index.js
CHANGED
|
@@ -361,6 +361,7 @@ var SaleEligibility = /* @__PURE__ */ ((SaleEligibility2) => {
|
|
|
361
361
|
})(SaleEligibility || {});
|
|
362
362
|
var PurchasePermitType = /* @__PURE__ */ ((PurchasePermitType2) => {
|
|
363
363
|
PurchasePermitType2["BASIC"] = "basic";
|
|
364
|
+
PurchasePermitType2["BASIC_V2"] = "basic-v2";
|
|
364
365
|
PurchasePermitType2["ALLOCATION"] = "allocation";
|
|
365
366
|
return PurchasePermitType2;
|
|
366
367
|
})(PurchasePermitType || {});
|