turing-wallet-provider 1.1.3 → 1.1.5
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 +4 -0
- package/dist/types/providerTypes.d.ts +64 -47
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,6 +164,8 @@ interface RequestParam = {
|
|
|
164
164
|
tbc_amount?: number;
|
|
165
165
|
ft_amount?: number;
|
|
166
166
|
merge_times?:number;
|
|
167
|
+
with_lock? boolean;
|
|
168
|
+
version? number;
|
|
167
169
|
};
|
|
168
170
|
|
|
169
171
|
const params = [param:RequestParam] //目前参数里只能放一个对象,有批量发送需求再扩展
|
|
@@ -241,6 +243,7 @@ const params = [{
|
|
|
241
243
|
flag:"POOLNFT_MINT",
|
|
242
244
|
ft_contract_address:"",
|
|
243
245
|
with_lock?:false //默认值为false,为true则创建带哈希锁的poolNFT
|
|
246
|
+
version:number
|
|
244
247
|
}];
|
|
245
248
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
246
249
|
```
|
|
@@ -254,6 +257,7 @@ const params = [{
|
|
|
254
257
|
address:"",
|
|
255
258
|
tbc_amount:30,
|
|
256
259
|
ft_amount:1000
|
|
260
|
+
version:number
|
|
257
261
|
}];
|
|
258
262
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
259
263
|
```
|
|
@@ -1,85 +1,102 @@
|
|
|
1
1
|
export type PubKey = {
|
|
2
|
-
|
|
2
|
+
tbcPubKey: string;
|
|
3
3
|
};
|
|
4
4
|
|
|
5
5
|
export type Address = {
|
|
6
|
-
|
|
6
|
+
tbcAddress: string;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export type Balance = {
|
|
10
|
-
|
|
10
|
+
tbc: number;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export type SignedMessage = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
address: string;
|
|
15
|
+
pubKey: string;
|
|
16
|
+
sig: string;
|
|
17
|
+
message: string;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export type TransactionFlag =
|
|
20
|
+
export type TransactionFlag =
|
|
21
|
+
| "P2PKH"
|
|
22
|
+
| "COLLECTION_CREATE"
|
|
23
|
+
| "NFT_CREATE"
|
|
24
|
+
| "NFT_TRANSFER"
|
|
25
|
+
| "FT_MINT"
|
|
26
|
+
| "FT_TRANSFER"
|
|
27
|
+
| "POOLNFT_MINT"
|
|
28
|
+
| "POOLNFT_INIT"
|
|
29
|
+
| "POOLNFT_LP_INCREASE"
|
|
30
|
+
| "POOLNFT_LP_CONSUME"
|
|
31
|
+
| "POOLNFT_SWAP_TO_TOKEN"
|
|
32
|
+
| "POOLNFT_SWAP_TO_TBC"
|
|
33
|
+
| "POOLNFT_MERGE"
|
|
34
|
+
| "FTLP_MERGE";
|
|
21
35
|
|
|
22
36
|
export type SendTransaction = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
flag: TransactionFlag;
|
|
38
|
+
satoshis?: number;
|
|
39
|
+
address?: string;
|
|
40
|
+
collection_data?: string;
|
|
41
|
+
ft_data?: string;
|
|
42
|
+
nft_data?: string;
|
|
43
|
+
collection_id?: string;
|
|
44
|
+
nft_contract_address?: string;
|
|
45
|
+
ft_contract_address?: string;
|
|
46
|
+
tbc_amount?: number;
|
|
47
|
+
ft_amount?: number;
|
|
48
|
+
merge_times?: number;
|
|
49
|
+
with_lock?: boolean;
|
|
50
|
+
poolNFT_version?: number;
|
|
51
|
+
serviceFeeRate?: number;
|
|
36
52
|
};
|
|
37
53
|
|
|
38
54
|
export type SignMessage = {
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
message: string;
|
|
56
|
+
encoding?: "utf8" | "hex" | "base64";
|
|
41
57
|
};
|
|
42
58
|
|
|
43
59
|
export type Utxos = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
satoshis: number;
|
|
61
|
+
script: string;
|
|
62
|
+
txid: string;
|
|
63
|
+
vout: number;
|
|
48
64
|
};
|
|
49
65
|
|
|
50
66
|
export type SendTransactionResponse = {
|
|
51
|
-
|
|
52
|
-
|
|
67
|
+
txid: string;
|
|
68
|
+
rawtx: string;
|
|
53
69
|
};
|
|
54
70
|
|
|
55
71
|
export type Encrypt = {
|
|
56
|
-
|
|
72
|
+
message: string;
|
|
57
73
|
};
|
|
58
74
|
|
|
59
75
|
export type Decrypt = {
|
|
60
|
-
|
|
76
|
+
message: string;
|
|
61
77
|
};
|
|
62
78
|
|
|
63
79
|
export type EncryptResponse = {
|
|
64
|
-
|
|
80
|
+
encryptedMessage: string;
|
|
65
81
|
};
|
|
66
82
|
|
|
67
83
|
export type DecryptResponse = {
|
|
68
|
-
|
|
84
|
+
decryptedMessage: string;
|
|
69
85
|
};
|
|
70
86
|
|
|
71
|
-
|
|
72
87
|
export type TuringProviderType = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
isReady: boolean;
|
|
89
|
+
connect: () => Promise<string | undefined>;
|
|
90
|
+
disconnect: () => Promise<boolean>;
|
|
91
|
+
isConnected: () => Promise<boolean>;
|
|
92
|
+
getPubKey: () => Promise<PubKey | undefined>;
|
|
93
|
+
getAddress: () => Promise<Address | undefined>;
|
|
94
|
+
getBalance: () => Promise<Balance | undefined>;
|
|
95
|
+
sendTransaction: (
|
|
96
|
+
params: SendTransaction[]
|
|
97
|
+
) => Promise<SendTransactionResponse | undefined>;
|
|
98
|
+
signMessage: (params: SignMessage) => Promise<SignedMessage | undefined>;
|
|
99
|
+
getPaymentUtxos: () => Promise<Utxos[] | undefined>;
|
|
100
|
+
encrypt: (params: Encrypt) => Promise<EncryptResponse | undefined>;
|
|
101
|
+
decrypt: (params: Decrypt) => Promise<DecryptResponse | undefined>;
|
|
102
|
+
};
|