tresori-sdk 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/README.md +603 -0
- package/dist/angular/index.d.ts +1 -0
- package/dist/angular/index.js +5 -0
- package/dist/angular/tresori-sdk.service.d.ts +44 -0
- package/dist/angular/tresori-sdk.service.js +121 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +5 -0
- package/dist/react/useTresoriSDK.d.ts +17 -0
- package/dist/react/useTresoriSDK.js +47 -0
- package/dist/react-native/index.d.ts +2 -0
- package/dist/react-native/index.js +20 -0
- package/dist/tresori-sdk.d.ts +46 -0
- package/dist/tresori-sdk.js +250 -0
- package/dist/types.d.ts +181 -0
- package/dist/types.js +2 -0
- package/package.json +93 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export type WalletType = "CUSTODIAL" | "NON_CUSTODIAL";
|
|
2
|
+
export interface CreateWalletRequest {
|
|
3
|
+
walletType: WalletType;
|
|
4
|
+
chainId: number;
|
|
5
|
+
userId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateWalletResponse {
|
|
8
|
+
status: number;
|
|
9
|
+
message: string;
|
|
10
|
+
result: {
|
|
11
|
+
address: string;
|
|
12
|
+
balance: string;
|
|
13
|
+
publicKey: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface GetBalanceRequest {
|
|
17
|
+
chainId: number;
|
|
18
|
+
address: string;
|
|
19
|
+
smartContractAddress?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface TokenBalance {
|
|
22
|
+
balance: string;
|
|
23
|
+
symbol: string;
|
|
24
|
+
name: string | null;
|
|
25
|
+
contractAddress: string;
|
|
26
|
+
decimals: number;
|
|
27
|
+
}
|
|
28
|
+
export interface GetBalanceResponse {
|
|
29
|
+
status: number;
|
|
30
|
+
message: string;
|
|
31
|
+
result: string | {
|
|
32
|
+
native: string;
|
|
33
|
+
token: TokenBalance;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface SendTransactionRequest {
|
|
37
|
+
chainId: number;
|
|
38
|
+
to: string;
|
|
39
|
+
amount: number;
|
|
40
|
+
address: string;
|
|
41
|
+
smartContractAddress?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface TransactionSignature {
|
|
44
|
+
_type: string;
|
|
45
|
+
networkV: number | null;
|
|
46
|
+
r: string;
|
|
47
|
+
s: string;
|
|
48
|
+
v: number;
|
|
49
|
+
}
|
|
50
|
+
export interface TransactionResponse {
|
|
51
|
+
_type: string;
|
|
52
|
+
accessList: any[];
|
|
53
|
+
blockNumber: number | null;
|
|
54
|
+
blockHash: string | null;
|
|
55
|
+
blobVersionedHashes: string[] | null;
|
|
56
|
+
chainId: string;
|
|
57
|
+
data: string;
|
|
58
|
+
from: string;
|
|
59
|
+
gasLimit: string;
|
|
60
|
+
gasPrice: string | null;
|
|
61
|
+
hash: string;
|
|
62
|
+
maxFeePerGas: string;
|
|
63
|
+
maxPriorityFeePerGas: string;
|
|
64
|
+
maxFeePerBlobGas: string | null;
|
|
65
|
+
nonce: number;
|
|
66
|
+
signature: TransactionSignature;
|
|
67
|
+
to: string;
|
|
68
|
+
type: number;
|
|
69
|
+
value: string;
|
|
70
|
+
}
|
|
71
|
+
export interface SendTransactionResponse {
|
|
72
|
+
status: number;
|
|
73
|
+
message: string;
|
|
74
|
+
result: TransactionResponse;
|
|
75
|
+
}
|
|
76
|
+
export interface CheckTransactionStatusRequest {
|
|
77
|
+
transactionHash: string;
|
|
78
|
+
chainId: number;
|
|
79
|
+
}
|
|
80
|
+
export interface TokenTransfer {
|
|
81
|
+
amount: string;
|
|
82
|
+
}
|
|
83
|
+
export interface CheckTransactionStatusResponse {
|
|
84
|
+
status: number;
|
|
85
|
+
message: string;
|
|
86
|
+
result: {
|
|
87
|
+
status: string;
|
|
88
|
+
transactionHash: string;
|
|
89
|
+
blockNumber: number;
|
|
90
|
+
from: string;
|
|
91
|
+
to: string;
|
|
92
|
+
contractAddress: string | null;
|
|
93
|
+
gasUsed: string;
|
|
94
|
+
gasPrice: string;
|
|
95
|
+
effectiveGasPrice: string;
|
|
96
|
+
cumulativeGasUsed: string;
|
|
97
|
+
tokenTransfer: TokenTransfer;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export interface CompileSolCodeResponse {
|
|
101
|
+
status: number;
|
|
102
|
+
message: string;
|
|
103
|
+
result: {
|
|
104
|
+
abi: any[];
|
|
105
|
+
bytecode: string;
|
|
106
|
+
contractName: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export interface DeployContractRequest {
|
|
110
|
+
address: string;
|
|
111
|
+
chainId: number;
|
|
112
|
+
abi: any[];
|
|
113
|
+
bytecode: string;
|
|
114
|
+
contractName: string;
|
|
115
|
+
constructorArgs?: any[];
|
|
116
|
+
}
|
|
117
|
+
export interface DeployContractResponse {
|
|
118
|
+
status: number;
|
|
119
|
+
message: string;
|
|
120
|
+
result: {
|
|
121
|
+
blockchain: string;
|
|
122
|
+
transactionType: string;
|
|
123
|
+
fromAddress: string;
|
|
124
|
+
toAddress: string;
|
|
125
|
+
transactionHash: string;
|
|
126
|
+
blockchainUrl: string;
|
|
127
|
+
network: string;
|
|
128
|
+
status: string;
|
|
129
|
+
gasUsed: number;
|
|
130
|
+
gasPrice: number;
|
|
131
|
+
contractAddress: string;
|
|
132
|
+
contractName: string;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
export interface WriteTransactionRequest {
|
|
136
|
+
contractAddress: string;
|
|
137
|
+
functionName: string;
|
|
138
|
+
params: any[];
|
|
139
|
+
abi: any[];
|
|
140
|
+
fromAddress: string;
|
|
141
|
+
chainId: number;
|
|
142
|
+
}
|
|
143
|
+
export interface WriteTransactionResponse {
|
|
144
|
+
status: number;
|
|
145
|
+
message: string;
|
|
146
|
+
result: {
|
|
147
|
+
success: boolean;
|
|
148
|
+
txHash: string;
|
|
149
|
+
message: string;
|
|
150
|
+
blockNumber: number;
|
|
151
|
+
gasUsed: string;
|
|
152
|
+
explorerUrl: string;
|
|
153
|
+
isGasless: boolean;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export interface RelayerSendTransactionRequest {
|
|
157
|
+
fromAddress: string;
|
|
158
|
+
to: string;
|
|
159
|
+
amount: number;
|
|
160
|
+
chainId: number;
|
|
161
|
+
tokenAddress?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface RelayerSendTransactionResponse {
|
|
164
|
+
status: number;
|
|
165
|
+
message: string;
|
|
166
|
+
result: {
|
|
167
|
+
success: boolean;
|
|
168
|
+
txHash: string;
|
|
169
|
+
message: string;
|
|
170
|
+
blockNumber: number;
|
|
171
|
+
gasUsed: string;
|
|
172
|
+
explorerUrl: string;
|
|
173
|
+
isGasless: boolean;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
export interface TresoriSDKConfig {
|
|
177
|
+
/** Your API key for authentication */
|
|
178
|
+
apiKey: string;
|
|
179
|
+
/** Base URL for the API (e.g., https://api.tresori.com for production, https://sandbox-api.tresori.com for sandbox) */
|
|
180
|
+
baseUrl?: string;
|
|
181
|
+
}
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tresori-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Tresori SDK for wallet operations, transactions, and smart contract interactions",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./react": {
|
|
14
|
+
"import": "./dist/react/index.js",
|
|
15
|
+
"require": "./dist/react/index.js",
|
|
16
|
+
"types": "./dist/react/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./angular": {
|
|
19
|
+
"import": "./dist/angular/index.js",
|
|
20
|
+
"require": "./dist/angular/index.js",
|
|
21
|
+
"types": "./dist/angular/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./react-native": {
|
|
24
|
+
"import": "./dist/react-native/index.js",
|
|
25
|
+
"require": "./dist/react-native/index.js",
|
|
26
|
+
"types": "./dist/react-native/index.d.ts"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc",
|
|
31
|
+
"prepublishOnly": "npm run build",
|
|
32
|
+
"test": "node examples/test-node.js",
|
|
33
|
+
"test:browser": "echo \"Open examples/test-browser.html in a browser\"",
|
|
34
|
+
"test:node": "node examples/test-node.js"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"wallet",
|
|
38
|
+
"blockchain",
|
|
39
|
+
"ethereum",
|
|
40
|
+
"tresori",
|
|
41
|
+
"sdk",
|
|
42
|
+
"crypto",
|
|
43
|
+
"web3",
|
|
44
|
+
"react-native",
|
|
45
|
+
"mobile",
|
|
46
|
+
"android",
|
|
47
|
+
"ios"
|
|
48
|
+
],
|
|
49
|
+
"author": "",
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@angular/core": "^15.0.0",
|
|
53
|
+
"@types/node": "^20.10.0",
|
|
54
|
+
"@types/react": "^18.2.0",
|
|
55
|
+
"rxjs": "^7.8.0",
|
|
56
|
+
"typescript": "^5.3.3"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"axios": "^1.6.2"
|
|
60
|
+
},
|
|
61
|
+
"optionalDependencies": {
|
|
62
|
+
"form-data": "^4.0.0"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"react": ">=16.8.0",
|
|
66
|
+
"@angular/core": ">=12.0.0",
|
|
67
|
+
"rxjs": ">=6.0.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"react": {
|
|
71
|
+
"optional": true
|
|
72
|
+
},
|
|
73
|
+
"@angular/core": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
76
|
+
"rxjs": {
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"files": [
|
|
81
|
+
"dist",
|
|
82
|
+
"README.md"
|
|
83
|
+
],
|
|
84
|
+
"repository": {
|
|
85
|
+
"type": "git",
|
|
86
|
+
"url": "https://github.com/hrajput2507/nimbly-npm.git"
|
|
87
|
+
},
|
|
88
|
+
"bugs": {
|
|
89
|
+
"url": "https://github.com/hrajput2507/nimbly-npm/issues"
|
|
90
|
+
},
|
|
91
|
+
"homepage": "https://github.com/hrajput2507/nimbly-npm#readme"
|
|
92
|
+
}
|
|
93
|
+
|