@chipi-stack/types 11.6.0 → 11.8.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/dist/index.d.mts CHANGED
@@ -5,7 +5,7 @@ import { TypedData, Call } from 'starknet';
5
5
  */
6
6
  interface ChipiSDKConfig {
7
7
  apiPublicKey: string;
8
- environment?: "development" | "production";
8
+ isInternalChipiDeveloper?: "False" | "True";
9
9
  nodeUrl?: string;
10
10
  apiSecretKey?: string;
11
11
  }
@@ -15,12 +15,13 @@ interface ChipiServerSDKConfig extends ChipiSDKConfig {
15
15
  interface ChipiBrowserSDKConfig extends Omit<ChipiSDKConfig, 'apiSecretKey'> {
16
16
  apiSecretKey?: never;
17
17
  }
18
- type Environment = "development" | "production";
18
+ type isInternalChipiDeveloper = "False" | "True";
19
19
  type Chain = "STARKNET";
20
20
  type ChainToken = "USDC" | "USDT" | "ETH" | "STRK" | "DAI" | "WBTC" | "OTHER";
21
21
  interface PaginationQuery {
22
22
  page?: number;
23
23
  limit?: number;
24
+ offset?: number;
24
25
  }
25
26
  interface PaginatedResponse<T> {
26
27
  data: T[];
@@ -154,14 +155,33 @@ interface TransferParams {
154
155
  recipient: string;
155
156
  amount: string;
156
157
  }
158
+ interface TransferHookInput {
159
+ encryptKey: string;
160
+ wallet: WalletData;
161
+ token: ChainToken;
162
+ otherToken?: {
163
+ contractAddress: string;
164
+ decimals: number;
165
+ };
166
+ recipient: string;
167
+ amount: number;
168
+ }
157
169
  interface ApproveParams {
158
170
  encryptKey: string;
159
171
  wallet: WalletData;
160
172
  contractAddress: string;
161
173
  spender: string;
162
- amount: string | number;
174
+ amount: string;
163
175
  decimals?: number;
164
176
  }
177
+ interface ApproveHookInput {
178
+ encryptKey: string;
179
+ wallet: WalletData;
180
+ contractAddress: string;
181
+ spender: string;
182
+ decimals?: number;
183
+ amount: number;
184
+ }
165
185
  interface CallAnyContractParams {
166
186
  encryptKey: string;
167
187
  wallet: WalletData;
@@ -174,19 +194,6 @@ interface GetTransactionsParams {
174
194
  orgId: string;
175
195
  }
176
196
 
177
- interface StakeVesuUsdcParams {
178
- encryptKey: string;
179
- wallet: WalletData;
180
- amount: number;
181
- receiverWallet: string;
182
- }
183
- interface WithdrawVesuUsdcParams {
184
- encryptKey: string;
185
- wallet: WalletData;
186
- amount: number;
187
- recipient: string;
188
- }
189
-
190
197
  /**
191
198
  * SKU (Stock Keeping Unit) related types
192
199
  */
@@ -199,25 +206,24 @@ interface Sku {
199
206
  price: number;
200
207
  currency: string;
201
208
  isActive: boolean;
202
- metadata?: Record<string, any>;
209
+ metadata?: Record<string, unknown>;
203
210
  createdAt: Date;
204
211
  updatedAt: Date;
205
212
  }
206
213
  interface FindSkusParams {
207
214
  categories?: SkuCategory[];
208
215
  }
216
+ interface GetSkusDto extends PaginationQuery {
217
+ categories?: SkuCategory[];
218
+ }
219
+ interface GetSkusQuery extends PaginationQuery {
220
+ provider?: string;
221
+ category?: SkuCategory;
222
+ }
209
223
  interface FindSkusResponse {
210
224
  skus: Sku[];
211
225
  }
212
- interface CreateSkuTransactionParams {
213
- walletAddress: string;
214
- skuId: string;
215
- chain: Chain;
216
- chainToken: ChainToken;
217
- mxnAmount: number;
218
- reference: string;
219
- transactionHash: string;
220
- }
226
+
221
227
  interface SkuTransaction {
222
228
  id: string;
223
229
  walletAddress: string;
@@ -232,6 +238,39 @@ interface SkuTransaction {
232
238
  createdAt: Date;
233
239
  updatedAt: Date;
234
240
  }
241
+ interface CreateSkuTransactionParams {
242
+ wallet: WalletData;
243
+ skuId: string;
244
+ mxnAmount: number;
245
+ reference: string;
246
+ encryptKey: string;
247
+ externalUserId: string;
248
+ }
249
+
250
+ interface StakeVesuUsdcHookInputParams {
251
+ encryptKey: string;
252
+ wallet: WalletData;
253
+ amount: number;
254
+ receiverWallet: string;
255
+ }
256
+ interface StakeVesuUsdcParams {
257
+ encryptKey: string;
258
+ wallet: WalletData;
259
+ amount: string;
260
+ receiverWallet: string;
261
+ }
262
+ interface WithdrawVesuUsdcParams {
263
+ encryptKey: string;
264
+ wallet: WalletData;
265
+ amount: string;
266
+ recipient: string;
267
+ }
268
+ interface WithdrawVesuUsdcHookInputParams {
269
+ encryptKey: string;
270
+ wallet: WalletData;
271
+ amount: number;
272
+ recipient: string;
273
+ }
235
274
 
236
275
  /**
237
276
  * API-related types and interfaces
@@ -292,4 +331,4 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...a
292
331
  type ValueOrFunction<T> = T | (() => T);
293
332
  type MaybePromise<T> = T | Promise<T>;
294
333
 
295
- export { type ApiError, type ApiKey, type ApiResponse, type ApproveParams, type AsyncReturnType, type AuthContext, type CallAnyContractParams, type Chain, type ChainToken, type ChipiBrowserSDKConfig, type ChipiSDKConfig, type ChipiServerSDKConfig, type CreateCustodialWalletParams, type CreateSkuTransactionParams, type CreateWalletParams, type CreateWalletResponse, type DeepPartial, type Environment, type ErrorWithCode, type ExecuteSponsoredTransactionParams, type ExecuteSponsoredTransactionResponse, type ExecuteTransactionParams, type FindSkusParams, type FindSkusResponse, type GetMerchantWalletParams, type GetTokenBalanceParams, type GetTokenBalanceResponse, type GetTransactionsParams, type GetWalletParams, type GetWalletResponse, type JwtPayload, type MaybePromise, type NonEmptyArray, type Optional, type PaginatedResponse, type PaginationQuery, type PrepareTypedDataParams, type PrepareWalletCreationParams, type PrepareWalletCreationResponse, type Prettify, type RecordSendTransactionParams, type RequireAtLeastOne, STARKNET_CONTRACTS, type Sku, type SkuCategory, type SkuTransaction, type StakeVesuUsdcParams, type Transaction, type TransferParams, type ValueOrFunction, type WalletData, type WithdrawVesuUsdcParams };
334
+ export { type ApiError, type ApiKey, type ApiResponse, type ApproveHookInput, type ApproveParams, type AsyncReturnType, type AuthContext, type CallAnyContractParams, type Chain, type ChainToken, type ChipiBrowserSDKConfig, type ChipiSDKConfig, type ChipiServerSDKConfig, type CreateCustodialWalletParams, type CreateSkuTransactionParams, type CreateWalletParams, type CreateWalletResponse, type DeepPartial, type ErrorWithCode, type ExecuteSponsoredTransactionParams, type ExecuteSponsoredTransactionResponse, type ExecuteTransactionParams, type FindSkusParams, type FindSkusResponse, type GetMerchantWalletParams, type GetSkusDto, type GetSkusQuery, type GetTokenBalanceParams, type GetTokenBalanceResponse, type GetTransactionsParams, type GetWalletParams, type GetWalletResponse, type JwtPayload, type MaybePromise, type NonEmptyArray, type Optional, type PaginatedResponse, type PaginationQuery, type PrepareTypedDataParams, type PrepareWalletCreationParams, type PrepareWalletCreationResponse, type Prettify, type RecordSendTransactionParams, type RequireAtLeastOne, STARKNET_CONTRACTS, type Sku, type SkuCategory, type SkuTransaction, type StakeVesuUsdcHookInputParams, type StakeVesuUsdcParams, type Transaction, type TransferHookInput, type TransferParams, type ValueOrFunction, type WalletData, type WithdrawVesuUsdcHookInputParams, type WithdrawVesuUsdcParams, type isInternalChipiDeveloper };
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { TypedData, Call } from 'starknet';
5
5
  */
6
6
  interface ChipiSDKConfig {
7
7
  apiPublicKey: string;
8
- environment?: "development" | "production";
8
+ isInternalChipiDeveloper?: "False" | "True";
9
9
  nodeUrl?: string;
10
10
  apiSecretKey?: string;
11
11
  }
@@ -15,12 +15,13 @@ interface ChipiServerSDKConfig extends ChipiSDKConfig {
15
15
  interface ChipiBrowserSDKConfig extends Omit<ChipiSDKConfig, 'apiSecretKey'> {
16
16
  apiSecretKey?: never;
17
17
  }
18
- type Environment = "development" | "production";
18
+ type isInternalChipiDeveloper = "False" | "True";
19
19
  type Chain = "STARKNET";
20
20
  type ChainToken = "USDC" | "USDT" | "ETH" | "STRK" | "DAI" | "WBTC" | "OTHER";
21
21
  interface PaginationQuery {
22
22
  page?: number;
23
23
  limit?: number;
24
+ offset?: number;
24
25
  }
25
26
  interface PaginatedResponse<T> {
26
27
  data: T[];
@@ -154,14 +155,33 @@ interface TransferParams {
154
155
  recipient: string;
155
156
  amount: string;
156
157
  }
158
+ interface TransferHookInput {
159
+ encryptKey: string;
160
+ wallet: WalletData;
161
+ token: ChainToken;
162
+ otherToken?: {
163
+ contractAddress: string;
164
+ decimals: number;
165
+ };
166
+ recipient: string;
167
+ amount: number;
168
+ }
157
169
  interface ApproveParams {
158
170
  encryptKey: string;
159
171
  wallet: WalletData;
160
172
  contractAddress: string;
161
173
  spender: string;
162
- amount: string | number;
174
+ amount: string;
163
175
  decimals?: number;
164
176
  }
177
+ interface ApproveHookInput {
178
+ encryptKey: string;
179
+ wallet: WalletData;
180
+ contractAddress: string;
181
+ spender: string;
182
+ decimals?: number;
183
+ amount: number;
184
+ }
165
185
  interface CallAnyContractParams {
166
186
  encryptKey: string;
167
187
  wallet: WalletData;
@@ -174,19 +194,6 @@ interface GetTransactionsParams {
174
194
  orgId: string;
175
195
  }
176
196
 
177
- interface StakeVesuUsdcParams {
178
- encryptKey: string;
179
- wallet: WalletData;
180
- amount: number;
181
- receiverWallet: string;
182
- }
183
- interface WithdrawVesuUsdcParams {
184
- encryptKey: string;
185
- wallet: WalletData;
186
- amount: number;
187
- recipient: string;
188
- }
189
-
190
197
  /**
191
198
  * SKU (Stock Keeping Unit) related types
192
199
  */
@@ -199,25 +206,24 @@ interface Sku {
199
206
  price: number;
200
207
  currency: string;
201
208
  isActive: boolean;
202
- metadata?: Record<string, any>;
209
+ metadata?: Record<string, unknown>;
203
210
  createdAt: Date;
204
211
  updatedAt: Date;
205
212
  }
206
213
  interface FindSkusParams {
207
214
  categories?: SkuCategory[];
208
215
  }
216
+ interface GetSkusDto extends PaginationQuery {
217
+ categories?: SkuCategory[];
218
+ }
219
+ interface GetSkusQuery extends PaginationQuery {
220
+ provider?: string;
221
+ category?: SkuCategory;
222
+ }
209
223
  interface FindSkusResponse {
210
224
  skus: Sku[];
211
225
  }
212
- interface CreateSkuTransactionParams {
213
- walletAddress: string;
214
- skuId: string;
215
- chain: Chain;
216
- chainToken: ChainToken;
217
- mxnAmount: number;
218
- reference: string;
219
- transactionHash: string;
220
- }
226
+
221
227
  interface SkuTransaction {
222
228
  id: string;
223
229
  walletAddress: string;
@@ -232,6 +238,39 @@ interface SkuTransaction {
232
238
  createdAt: Date;
233
239
  updatedAt: Date;
234
240
  }
241
+ interface CreateSkuTransactionParams {
242
+ wallet: WalletData;
243
+ skuId: string;
244
+ mxnAmount: number;
245
+ reference: string;
246
+ encryptKey: string;
247
+ externalUserId: string;
248
+ }
249
+
250
+ interface StakeVesuUsdcHookInputParams {
251
+ encryptKey: string;
252
+ wallet: WalletData;
253
+ amount: number;
254
+ receiverWallet: string;
255
+ }
256
+ interface StakeVesuUsdcParams {
257
+ encryptKey: string;
258
+ wallet: WalletData;
259
+ amount: string;
260
+ receiverWallet: string;
261
+ }
262
+ interface WithdrawVesuUsdcParams {
263
+ encryptKey: string;
264
+ wallet: WalletData;
265
+ amount: string;
266
+ recipient: string;
267
+ }
268
+ interface WithdrawVesuUsdcHookInputParams {
269
+ encryptKey: string;
270
+ wallet: WalletData;
271
+ amount: number;
272
+ recipient: string;
273
+ }
235
274
 
236
275
  /**
237
276
  * API-related types and interfaces
@@ -292,4 +331,4 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...a
292
331
  type ValueOrFunction<T> = T | (() => T);
293
332
  type MaybePromise<T> = T | Promise<T>;
294
333
 
295
- export { type ApiError, type ApiKey, type ApiResponse, type ApproveParams, type AsyncReturnType, type AuthContext, type CallAnyContractParams, type Chain, type ChainToken, type ChipiBrowserSDKConfig, type ChipiSDKConfig, type ChipiServerSDKConfig, type CreateCustodialWalletParams, type CreateSkuTransactionParams, type CreateWalletParams, type CreateWalletResponse, type DeepPartial, type Environment, type ErrorWithCode, type ExecuteSponsoredTransactionParams, type ExecuteSponsoredTransactionResponse, type ExecuteTransactionParams, type FindSkusParams, type FindSkusResponse, type GetMerchantWalletParams, type GetTokenBalanceParams, type GetTokenBalanceResponse, type GetTransactionsParams, type GetWalletParams, type GetWalletResponse, type JwtPayload, type MaybePromise, type NonEmptyArray, type Optional, type PaginatedResponse, type PaginationQuery, type PrepareTypedDataParams, type PrepareWalletCreationParams, type PrepareWalletCreationResponse, type Prettify, type RecordSendTransactionParams, type RequireAtLeastOne, STARKNET_CONTRACTS, type Sku, type SkuCategory, type SkuTransaction, type StakeVesuUsdcParams, type Transaction, type TransferParams, type ValueOrFunction, type WalletData, type WithdrawVesuUsdcParams };
334
+ export { type ApiError, type ApiKey, type ApiResponse, type ApproveHookInput, type ApproveParams, type AsyncReturnType, type AuthContext, type CallAnyContractParams, type Chain, type ChainToken, type ChipiBrowserSDKConfig, type ChipiSDKConfig, type ChipiServerSDKConfig, type CreateCustodialWalletParams, type CreateSkuTransactionParams, type CreateWalletParams, type CreateWalletResponse, type DeepPartial, type ErrorWithCode, type ExecuteSponsoredTransactionParams, type ExecuteSponsoredTransactionResponse, type ExecuteTransactionParams, type FindSkusParams, type FindSkusResponse, type GetMerchantWalletParams, type GetSkusDto, type GetSkusQuery, type GetTokenBalanceParams, type GetTokenBalanceResponse, type GetTransactionsParams, type GetWalletParams, type GetWalletResponse, type JwtPayload, type MaybePromise, type NonEmptyArray, type Optional, type PaginatedResponse, type PaginationQuery, type PrepareTypedDataParams, type PrepareWalletCreationParams, type PrepareWalletCreationResponse, type Prettify, type RecordSendTransactionParams, type RequireAtLeastOne, STARKNET_CONTRACTS, type Sku, type SkuCategory, type SkuTransaction, type StakeVesuUsdcHookInputParams, type StakeVesuUsdcParams, type Transaction, type TransferHookInput, type TransferParams, type ValueOrFunction, type WalletData, type WithdrawVesuUsdcHookInputParams, type WithdrawVesuUsdcParams, type isInternalChipiDeveloper };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core.ts"],"names":[],"mappings":";;;AAsCO,IAAM,kBAAA,GAAwF;AAAA,EACnG,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,GAAA,EAAK;AAAA,IACH,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,GAAA,EAAK;AAAA,IACH,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,KAAA,EAAO;AAAA,IACL,eAAA,EAAiB,EAAA;AAAA,IACjB,QAAA,EAAU;AAAA;AAEd","file":"index.js","sourcesContent":["/**\n * Core configuration and environment types\n */\n\nexport interface ChipiSDKConfig {\n apiPublicKey: string;\n environment?: \"development\" | \"production\";\n nodeUrl?: string;\n apiSecretKey?: string;\n}\n\nexport interface ChipiServerSDKConfig extends ChipiSDKConfig {\n apiSecretKey: string;\n}\n\nexport interface ChipiBrowserSDKConfig extends Omit<ChipiSDKConfig, 'apiSecretKey'> {\n apiSecretKey?: never;\n}\n\nexport type Environment = \"development\" | \"production\";\n\nexport type Chain = \"STARKNET\";\n\nexport type ChainToken = \"USDC\" | \"USDT\" | \"ETH\" | \"STRK\" | \"DAI\" | \"WBTC\" | \"OTHER\";\n\nexport interface PaginationQuery {\n page?: number;\n limit?: number;\n}\n\nexport interface PaginatedResponse<T> {\n data: T[];\n total: number;\n page: number;\n limit: number;\n totalPages: number;\n}\n\nexport const STARKNET_CONTRACTS: Record<ChainToken, { contractAddress: string; decimals: number }> = {\n USDC: {\n contractAddress:\n \"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8\",\n decimals: 6,\n },\n USDT: {\n contractAddress:\n \"0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8\",\n decimals: 6,\n },\n DAI: {\n contractAddress:\n \"0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad\",\n decimals: 18,\n },\n STRK: {\n contractAddress:\n \"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\",\n decimals: 18,\n },\n ETH: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n WBTC: {\n contractAddress:\n \"0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac\",\n decimals: 8,\n },\n OTHER: {\n contractAddress: \"\",\n decimals: 18,\n },\n};\n"]}
1
+ {"version":3,"sources":["../src/core.ts"],"names":[],"mappings":";;;AAuCO,IAAM,kBAAA,GAAwF;AAAA,EACnG,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,GAAA,EAAK;AAAA,IACH,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,GAAA,EAAK;AAAA,IACH,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,KAAA,EAAO;AAAA,IACL,eAAA,EAAiB,EAAA;AAAA,IACjB,QAAA,EAAU;AAAA;AAEd","file":"index.js","sourcesContent":["/**\n * Core configuration and environment types\n */\n\nexport interface ChipiSDKConfig {\n apiPublicKey: string;\n isInternalChipiDeveloper?: \"False\" | \"True\";\n nodeUrl?: string;\n apiSecretKey?: string;\n}\n\nexport interface ChipiServerSDKConfig extends ChipiSDKConfig {\n apiSecretKey: string;\n}\n\nexport interface ChipiBrowserSDKConfig extends Omit<ChipiSDKConfig, 'apiSecretKey'> {\n apiSecretKey?: never;\n}\n\nexport type isInternalChipiDeveloper = \"False\" | \"True\";\n\nexport type Chain = \"STARKNET\";\n\nexport type ChainToken = \"USDC\" | \"USDT\" | \"ETH\" | \"STRK\" | \"DAI\" | \"WBTC\" | \"OTHER\";\n\nexport interface PaginationQuery {\n page?: number;\n limit?: number;\n offset?: number;\n}\n\nexport interface PaginatedResponse<T> {\n data: T[];\n total: number;\n page: number;\n limit: number;\n totalPages: number;\n}\n\nexport const STARKNET_CONTRACTS: Record<ChainToken, { contractAddress: string; decimals: number }> = {\n USDC: {\n contractAddress:\n \"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8\",\n decimals: 6,\n },\n USDT: {\n contractAddress:\n \"0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8\",\n decimals: 6,\n },\n DAI: {\n contractAddress:\n \"0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad\",\n decimals: 18,\n },\n STRK: {\n contractAddress:\n \"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\",\n decimals: 18,\n },\n ETH: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n WBTC: {\n contractAddress:\n \"0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac\",\n decimals: 8,\n },\n OTHER: {\n contractAddress: \"\",\n decimals: 18,\n },\n};\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core.ts"],"names":[],"mappings":";AAsCO,IAAM,kBAAA,GAAwF;AAAA,EACnG,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,GAAA,EAAK;AAAA,IACH,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,GAAA,EAAK;AAAA,IACH,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,KAAA,EAAO;AAAA,IACL,eAAA,EAAiB,EAAA;AAAA,IACjB,QAAA,EAAU;AAAA;AAEd","file":"index.mjs","sourcesContent":["/**\n * Core configuration and environment types\n */\n\nexport interface ChipiSDKConfig {\n apiPublicKey: string;\n environment?: \"development\" | \"production\";\n nodeUrl?: string;\n apiSecretKey?: string;\n}\n\nexport interface ChipiServerSDKConfig extends ChipiSDKConfig {\n apiSecretKey: string;\n}\n\nexport interface ChipiBrowserSDKConfig extends Omit<ChipiSDKConfig, 'apiSecretKey'> {\n apiSecretKey?: never;\n}\n\nexport type Environment = \"development\" | \"production\";\n\nexport type Chain = \"STARKNET\";\n\nexport type ChainToken = \"USDC\" | \"USDT\" | \"ETH\" | \"STRK\" | \"DAI\" | \"WBTC\" | \"OTHER\";\n\nexport interface PaginationQuery {\n page?: number;\n limit?: number;\n}\n\nexport interface PaginatedResponse<T> {\n data: T[];\n total: number;\n page: number;\n limit: number;\n totalPages: number;\n}\n\nexport const STARKNET_CONTRACTS: Record<ChainToken, { contractAddress: string; decimals: number }> = {\n USDC: {\n contractAddress:\n \"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8\",\n decimals: 6,\n },\n USDT: {\n contractAddress:\n \"0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8\",\n decimals: 6,\n },\n DAI: {\n contractAddress:\n \"0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad\",\n decimals: 18,\n },\n STRK: {\n contractAddress:\n \"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\",\n decimals: 18,\n },\n ETH: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n WBTC: {\n contractAddress:\n \"0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac\",\n decimals: 8,\n },\n OTHER: {\n contractAddress: \"\",\n decimals: 18,\n },\n};\n"]}
1
+ {"version":3,"sources":["../src/core.ts"],"names":[],"mappings":";AAuCO,IAAM,kBAAA,GAAwF;AAAA,EACnG,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,GAAA,EAAK;AAAA,IACH,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,GAAA,EAAK;AAAA,IACH,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,eAAA,EACE,oEAAA;AAAA,IACF,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,KAAA,EAAO;AAAA,IACL,eAAA,EAAiB,EAAA;AAAA,IACjB,QAAA,EAAU;AAAA;AAEd","file":"index.mjs","sourcesContent":["/**\n * Core configuration and environment types\n */\n\nexport interface ChipiSDKConfig {\n apiPublicKey: string;\n isInternalChipiDeveloper?: \"False\" | \"True\";\n nodeUrl?: string;\n apiSecretKey?: string;\n}\n\nexport interface ChipiServerSDKConfig extends ChipiSDKConfig {\n apiSecretKey: string;\n}\n\nexport interface ChipiBrowserSDKConfig extends Omit<ChipiSDKConfig, 'apiSecretKey'> {\n apiSecretKey?: never;\n}\n\nexport type isInternalChipiDeveloper = \"False\" | \"True\";\n\nexport type Chain = \"STARKNET\";\n\nexport type ChainToken = \"USDC\" | \"USDT\" | \"ETH\" | \"STRK\" | \"DAI\" | \"WBTC\" | \"OTHER\";\n\nexport interface PaginationQuery {\n page?: number;\n limit?: number;\n offset?: number;\n}\n\nexport interface PaginatedResponse<T> {\n data: T[];\n total: number;\n page: number;\n limit: number;\n totalPages: number;\n}\n\nexport const STARKNET_CONTRACTS: Record<ChainToken, { contractAddress: string; decimals: number }> = {\n USDC: {\n contractAddress:\n \"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8\",\n decimals: 6,\n },\n USDT: {\n contractAddress:\n \"0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8\",\n decimals: 6,\n },\n DAI: {\n contractAddress:\n \"0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad\",\n decimals: 18,\n },\n STRK: {\n contractAddress:\n \"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\",\n decimals: 18,\n },\n ETH: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n WBTC: {\n contractAddress:\n \"0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac\",\n decimals: 8,\n },\n OTHER: {\n contractAddress: \"\",\n decimals: 18,\n },\n};\n\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipi-stack/types",
3
- "version": "11.6.0",
3
+ "version": "11.8.0",
4
4
  "description": "Type definitions for Chipi SDK packages",
5
5
  "keywords": [
6
6
  "chipi",
@@ -36,7 +36,8 @@
36
36
  "prettier": "^3.0.0",
37
37
  "rimraf": "^5.0.0",
38
38
  "tsup": "^8.3.6",
39
- "typescript": "^5.7.3"
39
+ "typescript": "^5.7.3",
40
+ "vitest": "^3.2.4"
40
41
  },
41
42
  "engines": {
42
43
  "node": ">=18.17.0"
@@ -52,6 +53,10 @@
52
53
  "format": "prettier --write src/**/*.ts",
53
54
  "format:check": "prettier --check src/**/*.ts",
54
55
  "lint": "eslint src",
55
- "typecheck": "tsc --noEmit"
56
+ "typecheck": "tsc --noEmit",
57
+ "test": "vitest run",
58
+ "test:watch": "vitest watch",
59
+ "test:ui": "vitest --ui",
60
+ "test:coverage": "vitest run --coverage"
56
61
  }
57
62
  }