@chipi-stack/types 0.1.0 → 1.0.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 +20 -21
- package/dist/index.d.ts +20 -21
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.d.mts
CHANGED
|
@@ -5,12 +5,12 @@ import { TypedData, Call } from 'starknet';
|
|
|
5
5
|
*/
|
|
6
6
|
interface ChipiSDKConfig {
|
|
7
7
|
apiPublicKey: string;
|
|
8
|
-
environment?:
|
|
8
|
+
environment?: "development" | "production";
|
|
9
9
|
nodeUrl?: string;
|
|
10
10
|
}
|
|
11
|
-
type Environment =
|
|
12
|
-
type Chain =
|
|
13
|
-
type ChainToken =
|
|
11
|
+
type Environment = "development" | "production";
|
|
12
|
+
type Chain = "STARKNET" | "STARKNET_SEPOLIA";
|
|
13
|
+
type ChainToken = "USDC" | "USDT" | "ETH" | "STRK" | "DAI" | "OTHER";
|
|
14
14
|
interface PaginationQuery {
|
|
15
15
|
page?: number;
|
|
16
16
|
limit?: number;
|
|
@@ -22,6 +22,10 @@ interface PaginatedResponse<T> {
|
|
|
22
22
|
limit: number;
|
|
23
23
|
totalPages: number;
|
|
24
24
|
}
|
|
25
|
+
declare const STARKNET_CONTRACTS: Record<ChainToken, {
|
|
26
|
+
contractAddress: string;
|
|
27
|
+
decimals: number;
|
|
28
|
+
}>;
|
|
25
29
|
|
|
26
30
|
/**
|
|
27
31
|
* Wallet-related types
|
|
@@ -32,14 +36,8 @@ interface WalletData {
|
|
|
32
36
|
}
|
|
33
37
|
interface CreateWalletParams {
|
|
34
38
|
encryptKey: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
interface CreateWalletParams {
|
|
39
|
-
encryptKey: string;
|
|
40
|
-
bearerToken: string;
|
|
41
|
-
apiPublicKey: string;
|
|
42
|
-
nodeUrl?: string;
|
|
39
|
+
externalUserId: string;
|
|
40
|
+
nodeUrl: string;
|
|
43
41
|
}
|
|
44
42
|
interface CreateWalletResponse {
|
|
45
43
|
success: boolean;
|
|
@@ -107,22 +105,24 @@ interface ExecuteSponsoredTransactionResponse {
|
|
|
107
105
|
success: boolean;
|
|
108
106
|
}
|
|
109
107
|
interface RecordSendTransactionParams {
|
|
110
|
-
walletAddress: string;
|
|
111
108
|
transactionHash: string;
|
|
112
|
-
|
|
109
|
+
expectedSender: string;
|
|
110
|
+
expectedRecipient: string;
|
|
111
|
+
expectedToken: ChainToken;
|
|
112
|
+
expectedAmount: string;
|
|
113
113
|
chain: Chain;
|
|
114
|
-
chainToken: ChainToken;
|
|
115
|
-
apiKey: any;
|
|
116
114
|
}
|
|
117
115
|
interface TransferParams {
|
|
118
116
|
encryptKey: string;
|
|
119
117
|
wallet: WalletData;
|
|
120
|
-
|
|
118
|
+
token: ChainToken;
|
|
119
|
+
otherToken?: {
|
|
120
|
+
contractAddress: string;
|
|
121
|
+
decimals: number;
|
|
122
|
+
};
|
|
121
123
|
recipient: string;
|
|
122
124
|
amount: string | number;
|
|
123
125
|
decimals?: number;
|
|
124
|
-
bearerToken: string;
|
|
125
|
-
apiPublicKey: string;
|
|
126
126
|
}
|
|
127
127
|
interface ApproveParams {
|
|
128
128
|
encryptKey: string;
|
|
@@ -194,7 +194,6 @@ interface CreateSkuTransactionParams {
|
|
|
194
194
|
mxnAmount: number;
|
|
195
195
|
reference: string;
|
|
196
196
|
transactionHash: string;
|
|
197
|
-
apiKey: any;
|
|
198
197
|
}
|
|
199
198
|
interface SkuTransaction {
|
|
200
199
|
id: string;
|
|
@@ -271,4 +270,4 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...a
|
|
|
271
270
|
type ValueOrFunction<T> = T | (() => T);
|
|
272
271
|
type MaybePromise<T> = T | Promise<T>;
|
|
273
272
|
|
|
274
|
-
export type
|
|
273
|
+
export { type ApiError, type ApiKey, type ApiResponse, type ApproveParams, type AsyncReturnType, type AuthContext, type CallAnyContractParams, type Chain, type ChainToken, type ChipiSDKConfig, 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 GetTransactionsParams, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ import { TypedData, Call } from 'starknet';
|
|
|
5
5
|
*/
|
|
6
6
|
interface ChipiSDKConfig {
|
|
7
7
|
apiPublicKey: string;
|
|
8
|
-
environment?:
|
|
8
|
+
environment?: "development" | "production";
|
|
9
9
|
nodeUrl?: string;
|
|
10
10
|
}
|
|
11
|
-
type Environment =
|
|
12
|
-
type Chain =
|
|
13
|
-
type ChainToken =
|
|
11
|
+
type Environment = "development" | "production";
|
|
12
|
+
type Chain = "STARKNET" | "STARKNET_SEPOLIA";
|
|
13
|
+
type ChainToken = "USDC" | "USDT" | "ETH" | "STRK" | "DAI" | "OTHER";
|
|
14
14
|
interface PaginationQuery {
|
|
15
15
|
page?: number;
|
|
16
16
|
limit?: number;
|
|
@@ -22,6 +22,10 @@ interface PaginatedResponse<T> {
|
|
|
22
22
|
limit: number;
|
|
23
23
|
totalPages: number;
|
|
24
24
|
}
|
|
25
|
+
declare const STARKNET_CONTRACTS: Record<ChainToken, {
|
|
26
|
+
contractAddress: string;
|
|
27
|
+
decimals: number;
|
|
28
|
+
}>;
|
|
25
29
|
|
|
26
30
|
/**
|
|
27
31
|
* Wallet-related types
|
|
@@ -32,14 +36,8 @@ interface WalletData {
|
|
|
32
36
|
}
|
|
33
37
|
interface CreateWalletParams {
|
|
34
38
|
encryptKey: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
interface CreateWalletParams {
|
|
39
|
-
encryptKey: string;
|
|
40
|
-
bearerToken: string;
|
|
41
|
-
apiPublicKey: string;
|
|
42
|
-
nodeUrl?: string;
|
|
39
|
+
externalUserId: string;
|
|
40
|
+
nodeUrl: string;
|
|
43
41
|
}
|
|
44
42
|
interface CreateWalletResponse {
|
|
45
43
|
success: boolean;
|
|
@@ -107,22 +105,24 @@ interface ExecuteSponsoredTransactionResponse {
|
|
|
107
105
|
success: boolean;
|
|
108
106
|
}
|
|
109
107
|
interface RecordSendTransactionParams {
|
|
110
|
-
walletAddress: string;
|
|
111
108
|
transactionHash: string;
|
|
112
|
-
|
|
109
|
+
expectedSender: string;
|
|
110
|
+
expectedRecipient: string;
|
|
111
|
+
expectedToken: ChainToken;
|
|
112
|
+
expectedAmount: string;
|
|
113
113
|
chain: Chain;
|
|
114
|
-
chainToken: ChainToken;
|
|
115
|
-
apiKey: any;
|
|
116
114
|
}
|
|
117
115
|
interface TransferParams {
|
|
118
116
|
encryptKey: string;
|
|
119
117
|
wallet: WalletData;
|
|
120
|
-
|
|
118
|
+
token: ChainToken;
|
|
119
|
+
otherToken?: {
|
|
120
|
+
contractAddress: string;
|
|
121
|
+
decimals: number;
|
|
122
|
+
};
|
|
121
123
|
recipient: string;
|
|
122
124
|
amount: string | number;
|
|
123
125
|
decimals?: number;
|
|
124
|
-
bearerToken: string;
|
|
125
|
-
apiPublicKey: string;
|
|
126
126
|
}
|
|
127
127
|
interface ApproveParams {
|
|
128
128
|
encryptKey: string;
|
|
@@ -194,7 +194,6 @@ interface CreateSkuTransactionParams {
|
|
|
194
194
|
mxnAmount: number;
|
|
195
195
|
reference: string;
|
|
196
196
|
transactionHash: string;
|
|
197
|
-
apiKey: any;
|
|
198
197
|
}
|
|
199
198
|
interface SkuTransaction {
|
|
200
199
|
id: string;
|
|
@@ -271,4 +270,4 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...a
|
|
|
271
270
|
type ValueOrFunction<T> = T | (() => T);
|
|
272
271
|
type MaybePromise<T> = T | Promise<T>;
|
|
273
272
|
|
|
274
|
-
export type
|
|
273
|
+
export { type ApiError, type ApiKey, type ApiResponse, type ApproveParams, type AsyncReturnType, type AuthContext, type CallAnyContractParams, type Chain, type ChainToken, type ChipiSDKConfig, 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 GetTransactionsParams, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// src/core.ts
|
|
4
|
+
var STARKNET_CONTRACTS = {
|
|
5
|
+
USDC: {
|
|
6
|
+
contractAddress: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
|
|
7
|
+
decimals: 6
|
|
8
|
+
},
|
|
9
|
+
USDT: {
|
|
10
|
+
contractAddress: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
|
|
11
|
+
decimals: 6
|
|
12
|
+
},
|
|
13
|
+
DAI: {
|
|
14
|
+
contractAddress: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
15
|
+
decimals: 18
|
|
16
|
+
},
|
|
17
|
+
STRK: {
|
|
18
|
+
contractAddress: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
19
|
+
decimals: 18
|
|
20
|
+
},
|
|
21
|
+
ETH: {
|
|
22
|
+
contractAddress: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
23
|
+
decimals: 18
|
|
24
|
+
},
|
|
25
|
+
OTHER: {
|
|
26
|
+
contractAddress: "",
|
|
27
|
+
decimals: 18
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.STARKNET_CONTRACTS = STARKNET_CONTRACTS;
|
|
3
32
|
//# sourceMappingURL=index.js.map
|
|
4
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../src/core.ts"],"names":[],"mappings":";;;AA6BO,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,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}\n\nexport type Environment = \"development\" | \"production\";\n\nexport type Chain = \"STARKNET\" | \"STARKNET_SEPOLIA\";\n\nexport type ChainToken = \"USDC\" | \"USDT\" | \"ETH\" | \"STRK\" | \"DAI\" | \"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 \"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8\",\n decimals: 6,\n },\n DAI: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n STRK: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n ETH: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n OTHER: {\n contractAddress: \"\",\n decimals: 18,\n },\n};\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
// src/core.ts
|
|
2
|
+
var STARKNET_CONTRACTS = {
|
|
3
|
+
USDC: {
|
|
4
|
+
contractAddress: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
|
|
5
|
+
decimals: 6
|
|
6
|
+
},
|
|
7
|
+
USDT: {
|
|
8
|
+
contractAddress: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
|
|
9
|
+
decimals: 6
|
|
10
|
+
},
|
|
11
|
+
DAI: {
|
|
12
|
+
contractAddress: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
13
|
+
decimals: 18
|
|
14
|
+
},
|
|
15
|
+
STRK: {
|
|
16
|
+
contractAddress: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
17
|
+
decimals: 18
|
|
18
|
+
},
|
|
19
|
+
ETH: {
|
|
20
|
+
contractAddress: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
21
|
+
decimals: 18
|
|
22
|
+
},
|
|
23
|
+
OTHER: {
|
|
24
|
+
contractAddress: "",
|
|
25
|
+
decimals: 18
|
|
26
|
+
}
|
|
27
|
+
};
|
|
1
28
|
|
|
29
|
+
export { STARKNET_CONTRACTS };
|
|
2
30
|
//# sourceMappingURL=index.mjs.map
|
|
3
31
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
1
|
+
{"version":3,"sources":["../src/core.ts"],"names":[],"mappings":";AA6BO,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,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}\n\nexport type Environment = \"development\" | \"production\";\n\nexport type Chain = \"STARKNET\" | \"STARKNET_SEPOLIA\";\n\nexport type ChainToken = \"USDC\" | \"USDT\" | \"ETH\" | \"STRK\" | \"DAI\" | \"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 \"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8\",\n decimals: 6,\n },\n DAI: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n STRK: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n ETH: {\n contractAddress:\n \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n decimals: 18,\n },\n OTHER: {\n contractAddress: \"\",\n decimals: 18,\n },\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipi-stack/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Type definitions for Chipi SDK packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chipi",
|
|
@@ -27,16 +27,6 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tsup --env.NODE_ENV production",
|
|
32
|
-
"build:declarations": "tsc -p tsconfig.declarations.json",
|
|
33
|
-
"clean": "rimraf ./dist",
|
|
34
|
-
"dev": "tsup --watch",
|
|
35
|
-
"format": "prettier --write src/**/*.ts",
|
|
36
|
-
"format:check": "prettier --check src/**/*.ts",
|
|
37
|
-
"lint": "eslint src",
|
|
38
|
-
"typecheck": "tsc --noEmit"
|
|
39
|
-
},
|
|
40
30
|
"dependencies": {
|
|
41
31
|
"starknet": ">=6.23.1"
|
|
42
32
|
},
|
|
@@ -53,5 +43,15 @@
|
|
|
53
43
|
},
|
|
54
44
|
"publishConfig": {
|
|
55
45
|
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsup --env.NODE_ENV production",
|
|
49
|
+
"build:declarations": "tsc -p tsconfig.declarations.json",
|
|
50
|
+
"clean": "rimraf ./dist",
|
|
51
|
+
"dev": "tsup --watch",
|
|
52
|
+
"format": "prettier --write src/**/*.ts",
|
|
53
|
+
"format:check": "prettier --check src/**/*.ts",
|
|
54
|
+
"lint": "eslint src",
|
|
55
|
+
"typecheck": "tsc --noEmit"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|