@weblock-wallet/sdk 0.1.25
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 +150 -0
- package/dist/index.cjs +106468 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +491 -0
- package/dist/index.d.ts +491 -0
- package/dist/index.js +106439 -0
- package/dist/index.js.map +1 -0
- package/package.json +67 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
declare enum SDKErrorCode {
|
|
2
|
+
NOT_INITIALIZED = "NOT_INITIALIZED",
|
|
3
|
+
INVALID_CONFIG = "INVALID_CONFIG",
|
|
4
|
+
AUTH_REQUIRED = "AUTH_REQUIRED",
|
|
5
|
+
REQUEST_FAILED = "REQUEST_FAILED",
|
|
6
|
+
AUTH_FAILED = "AUTH_FAILED",
|
|
7
|
+
AUTH_NO_USER = "AUTH_NO_USER",
|
|
8
|
+
AUTH_NO_EMAIL = "AUTH_NO_EMAIL",
|
|
9
|
+
AUTH_PROVIDER_ERROR = "AUTH_PROVIDER_ERROR",
|
|
10
|
+
AUTH_SIGNOUT_FAILED = "AUTH_SIGNOUT_FAILED",
|
|
11
|
+
WALLET_NOT_FOUND = "WALLET_NOT_FOUND",
|
|
12
|
+
WALLET_ALREADY_EXISTS = "WALLET_ALREADY_EXISTS",
|
|
13
|
+
WALLET_CREATION_FAILED = "WALLET_CREATION_FAILED",
|
|
14
|
+
INVALID_PASSWORD = "INVALID_PASSWORD",
|
|
15
|
+
ASSET_NOT_FOUND = "ASSET_NOT_FOUND",
|
|
16
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
17
|
+
TRANSFER_FAILED = "TRANSFER_FAILED",
|
|
18
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
19
|
+
INVALID_RESPONSE = "INVALID_RESPONSE",
|
|
20
|
+
TIMEOUT = "TIMEOUT",
|
|
21
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
22
|
+
INVALID_PARAMS = "INVALID_PARAMS",
|
|
23
|
+
WALLET_CREATION_VERIFICATION_FAILED = "WALLET_CREATION_VERIFICATION_FAILED",
|
|
24
|
+
WALLET_RECOVERY_FAILED = "WALLET_RECOVERY_FAILED",
|
|
25
|
+
INVALID_NETWORK = "INVALID_NETWORK",
|
|
26
|
+
WALLET_RETRIEVAL_FAILED = "WALLET_RETRIEVAL_FAILED",
|
|
27
|
+
NOT_LOGGED_IN = "NOT_LOGGED_IN",
|
|
28
|
+
NETWORK_SWITCH_FAILED = "NETWORK_SWITCH_FAILED",
|
|
29
|
+
TRANSACTION_FAILED = "TRANSACTION_FAILED"
|
|
30
|
+
}
|
|
31
|
+
declare class SDKError extends Error {
|
|
32
|
+
readonly code: SDKErrorCode;
|
|
33
|
+
readonly details?: unknown | undefined;
|
|
34
|
+
constructor(message: string, code: SDKErrorCode, details?: unknown | undefined);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* SDK 초기화 옵션
|
|
39
|
+
*/
|
|
40
|
+
interface SDKOptions {
|
|
41
|
+
/** SDK 환경 설정 (local, dev, stage, prod) */
|
|
42
|
+
environment: 'local' | 'dev' | 'stage' | 'prod';
|
|
43
|
+
/** SDK API 키 */
|
|
44
|
+
apiKey: string;
|
|
45
|
+
/** 허용 호스트 */
|
|
46
|
+
orgHost: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 토큰 타입
|
|
50
|
+
*/
|
|
51
|
+
declare enum TokenType {
|
|
52
|
+
/** ERC20 토큰 */
|
|
53
|
+
ERC20 = "ERC20",
|
|
54
|
+
/** 보안토큰 */
|
|
55
|
+
SECURITY = "SECURITY",
|
|
56
|
+
/** 네이티브 토큰 */
|
|
57
|
+
NATIVE = "NATIVE"
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 트랜잭션 상태
|
|
61
|
+
*/
|
|
62
|
+
declare enum TransactionStatus {
|
|
63
|
+
/** 처리 중 */
|
|
64
|
+
PENDING = "PENDING",
|
|
65
|
+
/** 성공 */
|
|
66
|
+
SUCCESS = "SUCCESS",
|
|
67
|
+
/** 실패 */
|
|
68
|
+
FAILED = "FAILED"
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 트랜잭션 타입
|
|
72
|
+
*/
|
|
73
|
+
declare enum TransactionType {
|
|
74
|
+
/** 송금 */
|
|
75
|
+
SEND = "SEND",
|
|
76
|
+
/** 수금 */
|
|
77
|
+
RECEIVE = "RECEIVE"
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 로그인 상태
|
|
81
|
+
*/
|
|
82
|
+
declare enum SignInStatus {
|
|
83
|
+
/** 신규 사용자 */
|
|
84
|
+
NEW_USER = "NEW_USER",
|
|
85
|
+
/** 지갑 준비됨 */
|
|
86
|
+
WALLET_READY = "WALLET_READY",
|
|
87
|
+
/** 비밀번호 필요 */
|
|
88
|
+
NEEDS_PASSWORD = "NEEDS_PASSWORD"
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 네트워크 정보
|
|
92
|
+
*/
|
|
93
|
+
interface NetworkInfo {
|
|
94
|
+
/** 네트워크 고유 식별자 */
|
|
95
|
+
id: string;
|
|
96
|
+
/** 네트워크 표시 이름 */
|
|
97
|
+
name: string;
|
|
98
|
+
/** 체인 ID */
|
|
99
|
+
chainId: number;
|
|
100
|
+
/** 네트워크 기본 토큰 심볼 */
|
|
101
|
+
symbol: string;
|
|
102
|
+
/** RPC 엔드포인트 */
|
|
103
|
+
rpcUrl: string;
|
|
104
|
+
/** 블록 익스플로러 URL */
|
|
105
|
+
explorerUrl: string;
|
|
106
|
+
/** 테스트넷 여부 */
|
|
107
|
+
isTestnet: boolean;
|
|
108
|
+
/** 네트워크 아이콘 URL */
|
|
109
|
+
icon?: string;
|
|
110
|
+
/** 네트워크 기본 토큰 소수점 자리수 */
|
|
111
|
+
decimals: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* 토큰 잔액 정보
|
|
115
|
+
*/
|
|
116
|
+
interface TokenBalance {
|
|
117
|
+
/** 원본 값 (Wei) */
|
|
118
|
+
raw: string;
|
|
119
|
+
/** 변환된 값 */
|
|
120
|
+
formatted: string;
|
|
121
|
+
/** 소수점 자리수 */
|
|
122
|
+
decimals: number;
|
|
123
|
+
/** 토큰 심볼 */
|
|
124
|
+
symbol: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 토큰 정보
|
|
128
|
+
*/
|
|
129
|
+
interface TokenInfo {
|
|
130
|
+
/** 토큰 심볼 */
|
|
131
|
+
symbol: string;
|
|
132
|
+
/** 토큰 이름 */
|
|
133
|
+
name: string;
|
|
134
|
+
/** 컨트랙트 주소 */
|
|
135
|
+
address: string;
|
|
136
|
+
/** 토큰 잔액 */
|
|
137
|
+
balance: TokenBalance;
|
|
138
|
+
/** 토큰 소수점 자리수 */
|
|
139
|
+
decimals: number;
|
|
140
|
+
/** 토큰 총 발행량 */
|
|
141
|
+
totalSupply: TokenBalance;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* NFT 컬렉션 정보 (TODO: ERC721 구현 시 확장)
|
|
145
|
+
*/
|
|
146
|
+
interface NFTCollection {
|
|
147
|
+
/** 컬렉션 이름 */
|
|
148
|
+
name: string;
|
|
149
|
+
/** 컨트랙트 주소 */
|
|
150
|
+
address: string;
|
|
151
|
+
/** 보유 중인 NFT 목록 */
|
|
152
|
+
tokens: Array<{
|
|
153
|
+
/** 토큰 ID */
|
|
154
|
+
tokenId: string;
|
|
155
|
+
/** NFT 이미지 URL */
|
|
156
|
+
image?: string;
|
|
157
|
+
}>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* 보안토큰 정보 (TODO: ERC3643 구현 시 확장)
|
|
161
|
+
*/
|
|
162
|
+
interface SecurityTokenInfo {
|
|
163
|
+
/** 토큰 심볼 */
|
|
164
|
+
symbol: string;
|
|
165
|
+
/** 토큰 이름 */
|
|
166
|
+
name: string;
|
|
167
|
+
/** 컨트랙트 주소 */
|
|
168
|
+
address: string;
|
|
169
|
+
/** 토큰 잔액 */
|
|
170
|
+
balance: string | null;
|
|
171
|
+
/** 토큰 소수점 자리수 */
|
|
172
|
+
decimals: number;
|
|
173
|
+
/** 토큰 총 발행량 */
|
|
174
|
+
totalSupply: string;
|
|
175
|
+
/** 컴플라이언스 정보 */
|
|
176
|
+
compliance: {
|
|
177
|
+
/** 검증 여부 */
|
|
178
|
+
isVerified: boolean;
|
|
179
|
+
/** 전송 가능 여부 */
|
|
180
|
+
canTransfer: boolean;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* 트랜잭션 정보
|
|
185
|
+
*/
|
|
186
|
+
interface Transaction {
|
|
187
|
+
/** 트랜잭션 해시 */
|
|
188
|
+
hash: string;
|
|
189
|
+
/** 트랜잭션 타입 */
|
|
190
|
+
type: TransactionType;
|
|
191
|
+
/** 트랜잭션 상태 */
|
|
192
|
+
status: TransactionStatus;
|
|
193
|
+
/** 트랜잭션 타임스탬프 */
|
|
194
|
+
timestamp: number;
|
|
195
|
+
/** 거래 금액 */
|
|
196
|
+
value: string;
|
|
197
|
+
/** 토큰 심볼 */
|
|
198
|
+
symbol: string;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* 지갑 정보
|
|
202
|
+
*/
|
|
203
|
+
interface WalletInfo {
|
|
204
|
+
/** 지갑 주소 */
|
|
205
|
+
address: string;
|
|
206
|
+
/** 네트워크 정보 */
|
|
207
|
+
network: {
|
|
208
|
+
/** 현재 선택된 네트워크 */
|
|
209
|
+
current: NetworkInfo | null;
|
|
210
|
+
/** 사용 가능한 네트워크 목록 */
|
|
211
|
+
available: NetworkInfo[];
|
|
212
|
+
};
|
|
213
|
+
/** 자산 정보 */
|
|
214
|
+
assets: {
|
|
215
|
+
/** 현재 네트워크의 ��본 토큰 정보 */
|
|
216
|
+
native: {
|
|
217
|
+
symbol: string;
|
|
218
|
+
balance: TokenBalance;
|
|
219
|
+
decimals: number;
|
|
220
|
+
};
|
|
221
|
+
/** ERC20 토큰 목록 */
|
|
222
|
+
tokens: TokenInfo[];
|
|
223
|
+
/** NFT 컬렉션 목록 */
|
|
224
|
+
nfts: NFTCollection[];
|
|
225
|
+
/** 보안토큰 목록 */
|
|
226
|
+
securities: SecurityTokenInfo[];
|
|
227
|
+
};
|
|
228
|
+
/** 최근 트랜잭션 */
|
|
229
|
+
latestTransaction?: Transaction;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* 로그인 응답
|
|
233
|
+
*/
|
|
234
|
+
interface SignInResponse {
|
|
235
|
+
/** 로그인 상태 */
|
|
236
|
+
status: SignInStatus;
|
|
237
|
+
/** 사용자 이메일 */
|
|
238
|
+
email: string;
|
|
239
|
+
/** 프로필 이미지 URL */
|
|
240
|
+
photoURL: string | null;
|
|
241
|
+
/** 지갑 정보 (WALLET_READY 상태일 때만) */
|
|
242
|
+
wallet?: WalletInfo;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* 지갑 생성/복구 응답
|
|
246
|
+
*/
|
|
247
|
+
interface WalletResponse {
|
|
248
|
+
/** 지갑 정보 */
|
|
249
|
+
wallet: WalletInfo;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* 네트워크 변경 응답
|
|
253
|
+
*/
|
|
254
|
+
interface SwitchNetworkResponse {
|
|
255
|
+
network: NetworkInfo;
|
|
256
|
+
assets: WalletInfo['assets'];
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* 토큰 전송 요청
|
|
260
|
+
*/
|
|
261
|
+
interface TransferRequest {
|
|
262
|
+
/** 네트워크 ID */
|
|
263
|
+
networkId: string;
|
|
264
|
+
/** 토큰 컨트랙트 주소 */
|
|
265
|
+
tokenAddress: string;
|
|
266
|
+
/** 수신자 주소 */
|
|
267
|
+
to: string;
|
|
268
|
+
/** 전송 금액 */
|
|
269
|
+
amount: string;
|
|
270
|
+
/** 토큰 타입 */
|
|
271
|
+
type: 'NATIVE' | 'ERC20';
|
|
272
|
+
/** 토큰 심볼 */
|
|
273
|
+
symbol?: string;
|
|
274
|
+
/** 가스 제한 */
|
|
275
|
+
gasLimit?: string;
|
|
276
|
+
/** 가스 가격 */
|
|
277
|
+
gasPrice?: string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* 토큰 전송 응답
|
|
281
|
+
*/
|
|
282
|
+
interface TransferResponse {
|
|
283
|
+
transaction: Transaction;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* 네트워크 등록 요청
|
|
287
|
+
*/
|
|
288
|
+
interface AddNetworkRequest {
|
|
289
|
+
/** 네트워크 이름 (예: "Ethereum Mainnet", "Polygon Mumbai") */
|
|
290
|
+
name: string;
|
|
291
|
+
/** RPC URL */
|
|
292
|
+
rpcUrl: string;
|
|
293
|
+
/** 체인 ID */
|
|
294
|
+
chainId: number;
|
|
295
|
+
}
|
|
296
|
+
interface TokenBalanceParams {
|
|
297
|
+
networkId: string;
|
|
298
|
+
tokenAddress: string;
|
|
299
|
+
walletAddress: string;
|
|
300
|
+
}
|
|
301
|
+
interface TokenApprovalParams {
|
|
302
|
+
networkId: string;
|
|
303
|
+
tokenAddress: string;
|
|
304
|
+
spender: string;
|
|
305
|
+
amount: string;
|
|
306
|
+
}
|
|
307
|
+
interface TokenAllowanceParams {
|
|
308
|
+
networkId: string;
|
|
309
|
+
tokenAddress: string;
|
|
310
|
+
owner: string;
|
|
311
|
+
spender: string;
|
|
312
|
+
}
|
|
313
|
+
interface TokenInfoParams {
|
|
314
|
+
networkId: string;
|
|
315
|
+
tokenAddress: string;
|
|
316
|
+
}
|
|
317
|
+
interface SendTransactionParams {
|
|
318
|
+
to: string;
|
|
319
|
+
value: string;
|
|
320
|
+
data?: string;
|
|
321
|
+
chainId: number;
|
|
322
|
+
gasLimit?: string;
|
|
323
|
+
gasPrice?: string;
|
|
324
|
+
nonce?: number;
|
|
325
|
+
}
|
|
326
|
+
interface TransactionReceipt {
|
|
327
|
+
transactionHash: string;
|
|
328
|
+
transactionIndex: string;
|
|
329
|
+
blockHash: string;
|
|
330
|
+
blockNumber: string;
|
|
331
|
+
from: string;
|
|
332
|
+
to: string;
|
|
333
|
+
cumulativeGasUsed: string;
|
|
334
|
+
gasUsed: string;
|
|
335
|
+
contractAddress: string | null;
|
|
336
|
+
logs: Array<Log>;
|
|
337
|
+
status: string;
|
|
338
|
+
logsBloom: string;
|
|
339
|
+
effectiveGasPrice?: string;
|
|
340
|
+
}
|
|
341
|
+
interface Log {
|
|
342
|
+
address: string;
|
|
343
|
+
topics: string[];
|
|
344
|
+
data: string;
|
|
345
|
+
blockNumber: string;
|
|
346
|
+
transactionHash: string;
|
|
347
|
+
transactionIndex: string;
|
|
348
|
+
blockHash: string;
|
|
349
|
+
logIndex: string;
|
|
350
|
+
removed: boolean;
|
|
351
|
+
}
|
|
352
|
+
interface TransactionStatusEvent {
|
|
353
|
+
hash: string;
|
|
354
|
+
status: TransactionStatus;
|
|
355
|
+
error?: string;
|
|
356
|
+
timestamp: number;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
interface TokenMetadata {
|
|
360
|
+
address: string;
|
|
361
|
+
name: string;
|
|
362
|
+
symbol: string;
|
|
363
|
+
decimals: number;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
declare class TokenAmount {
|
|
367
|
+
/**
|
|
368
|
+
* Wei 단위의 값을 사용자가 읽을 수 있는 형태로 변환
|
|
369
|
+
* @param value - Wei 단위의 값 (hex string 또는 decimal string)
|
|
370
|
+
* @param decimals - 토큰의 소수점 자리수
|
|
371
|
+
* @returns 변환된 문자열
|
|
372
|
+
*/
|
|
373
|
+
static fromWei(value: string, decimals: number): string;
|
|
374
|
+
/**
|
|
375
|
+
* 사용자 입력값을 Wei 단위로 변환
|
|
376
|
+
* @param value - 사용자 입력값 (예: "1.5")
|
|
377
|
+
* @param decimals - 토큰의 소수점 자리수
|
|
378
|
+
* @returns Wei 단위의 값
|
|
379
|
+
*/
|
|
380
|
+
static toWei(value: string, decimals: number): string;
|
|
381
|
+
/**
|
|
382
|
+
* 표시용 포맷으로 변환
|
|
383
|
+
* @param value - Wei 단위의 값
|
|
384
|
+
* @param decimals - 토큰의 소수점 자리수
|
|
385
|
+
* @param maxDecimals - 최대 표시할 소수점 자리수 (기본값: 4)
|
|
386
|
+
* @returns 포맷된 문자열
|
|
387
|
+
*/
|
|
388
|
+
static format(value: string, decimals: number, maxDecimals?: number): string;
|
|
389
|
+
/**
|
|
390
|
+
* 값이 유효한지 검증
|
|
391
|
+
* @param value - 검증할 값
|
|
392
|
+
* @returns 유효성 여부
|
|
393
|
+
*/
|
|
394
|
+
static isValid(value: string): boolean;
|
|
395
|
+
}
|
|
396
|
+
declare const DECIMALS: {
|
|
397
|
+
readonly ETH: 18;
|
|
398
|
+
readonly USDC: 6;
|
|
399
|
+
readonly USDT: 6;
|
|
400
|
+
readonly DAI: 18;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* WeBlock Wallet SDK
|
|
405
|
+
* 논커스토디얼 웹3 지갑 SDK
|
|
406
|
+
*/
|
|
407
|
+
declare class WeBlockSDK {
|
|
408
|
+
private readonly core;
|
|
409
|
+
private readonly userModule;
|
|
410
|
+
private readonly walletModule;
|
|
411
|
+
private readonly assetModule;
|
|
412
|
+
private readonly networkModule;
|
|
413
|
+
private initialized;
|
|
414
|
+
constructor(options: SDKOptions);
|
|
415
|
+
private validateOptions;
|
|
416
|
+
private ensureInitialized;
|
|
417
|
+
isInitialized(): boolean;
|
|
418
|
+
readonly user: {
|
|
419
|
+
signIn: (provider: "google.com") => Promise<SignInResponse>;
|
|
420
|
+
createWallet: (password: string) => Promise<WalletResponse>;
|
|
421
|
+
retrieveWallet: (password: string) => Promise<WalletResponse>;
|
|
422
|
+
signOut: () => Promise<void>;
|
|
423
|
+
};
|
|
424
|
+
readonly wallet: {
|
|
425
|
+
getInfo: () => Promise<WalletInfo>;
|
|
426
|
+
onWalletUpdate: (callback: (wallet: WalletInfo) => void) => (() => void);
|
|
427
|
+
onTransactionUpdate: (callback: (tx: Transaction | undefined) => void) => (() => void);
|
|
428
|
+
getBalance: (address: string, chainId: number) => Promise<TokenBalance>;
|
|
429
|
+
getTransactionCount: (address: string, chainId: number) => Promise<number>;
|
|
430
|
+
getBlockNumber: (chainId: number) => Promise<number>;
|
|
431
|
+
sendRawTransaction: (signedTx: string, chainId: number) => Promise<string>;
|
|
432
|
+
getTransactionReceipt: (txHash: string, chainId: number) => Promise<any>;
|
|
433
|
+
getTransaction: (txHash: string, chainId: number) => Promise<any>;
|
|
434
|
+
estimateGas: (txParams: any, chainId: number) => Promise<number>;
|
|
435
|
+
getGasPrice: (chainId: number) => Promise<string>;
|
|
436
|
+
call: (txParams: any, blockParam: string | number, chainId: number) => Promise<string>;
|
|
437
|
+
};
|
|
438
|
+
readonly network: {
|
|
439
|
+
getAvailableNetworks: () => Promise<NetworkInfo[]>;
|
|
440
|
+
addNetwork: (request: AddNetworkRequest) => Promise<void>;
|
|
441
|
+
switchNetwork: (networkId: string) => Promise<void>;
|
|
442
|
+
getCurrentNetwork: () => Promise<NetworkInfo | null>;
|
|
443
|
+
};
|
|
444
|
+
readonly asset: {
|
|
445
|
+
transfer: (params: TransferRequest) => Promise<TransferResponse>;
|
|
446
|
+
addToken: (params: {
|
|
447
|
+
type: "ERC20" | "SECURITY";
|
|
448
|
+
networkId: string;
|
|
449
|
+
address: string;
|
|
450
|
+
symbol?: string;
|
|
451
|
+
decimals?: number;
|
|
452
|
+
name?: string;
|
|
453
|
+
}) => Promise<void>;
|
|
454
|
+
addNFTCollection: (params: {
|
|
455
|
+
networkId: string;
|
|
456
|
+
address: string;
|
|
457
|
+
name?: string;
|
|
458
|
+
}) => Promise<void>;
|
|
459
|
+
getTokenBalance: (params: {
|
|
460
|
+
networkId: string;
|
|
461
|
+
tokenAddress: string;
|
|
462
|
+
walletAddress: string;
|
|
463
|
+
}) => Promise<string>;
|
|
464
|
+
approveToken: (params: {
|
|
465
|
+
networkId: string;
|
|
466
|
+
tokenAddress: string;
|
|
467
|
+
spender: string;
|
|
468
|
+
amount: string;
|
|
469
|
+
}) => Promise<string>;
|
|
470
|
+
getAllowance: (params: {
|
|
471
|
+
networkId: string;
|
|
472
|
+
tokenAddress: string;
|
|
473
|
+
owner: string;
|
|
474
|
+
spender: string;
|
|
475
|
+
}) => Promise<string>;
|
|
476
|
+
on: (event: string, listener: (...args: any[]) => void) => void;
|
|
477
|
+
off: (event: string, listener: (...args: any[]) => void) => void;
|
|
478
|
+
getTokenInfo: (params: TokenInfoParams) => Promise<TokenMetadata>;
|
|
479
|
+
registerToken: (params: {
|
|
480
|
+
networkId: string;
|
|
481
|
+
tokenAddress: string;
|
|
482
|
+
}) => Promise<void>;
|
|
483
|
+
getTokenFullInfo: (params: {
|
|
484
|
+
networkId: string;
|
|
485
|
+
tokenAddress: string;
|
|
486
|
+
walletAddress: string;
|
|
487
|
+
}) => Promise<TokenInfo>;
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export { type AddNetworkRequest, DECIMALS, type NFTCollection, type NetworkInfo, SDKError, SDKErrorCode, type SDKOptions, type SecurityTokenInfo, type SendTransactionParams, type SignInResponse, SignInStatus, type SwitchNetworkResponse, type TokenAllowanceParams, TokenAmount, type TokenApprovalParams, type TokenBalance, type TokenBalanceParams, type TokenInfo, type TokenInfoParams, type TokenMetadata, TokenType, type Transaction, type TransactionReceipt, TransactionStatus, type TransactionStatusEvent, TransactionType, type TransferRequest, type TransferResponse, type WalletInfo, type WalletResponse, WeBlockSDK, WeBlockSDK as default };
|