turing-wallet-provider 1.1.0 → 1.1.2
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 +23 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,7 +105,7 @@ const wallet = useTuringsWallet();
|
|
|
105
105
|
try{
|
|
106
106
|
const encryptedMessage = await wallet.encrypt(message);
|
|
107
107
|
if(encryptedMessage){
|
|
108
|
-
|
|
108
|
+
console.log(encryptedMessage)
|
|
109
109
|
}
|
|
110
110
|
}catch(error){
|
|
111
111
|
console.log(error);
|
|
@@ -119,7 +119,7 @@ const wallet = useTuringsWallet();
|
|
|
119
119
|
try{
|
|
120
120
|
const decryptedMessage = await wallet.decrypt(message);
|
|
121
121
|
if(decryptedMessage){
|
|
122
|
-
|
|
122
|
+
console.log(decryptedMessage)
|
|
123
123
|
}
|
|
124
124
|
}catch(error){
|
|
125
125
|
console.log(error);
|
|
@@ -130,10 +130,10 @@ try{
|
|
|
130
130
|
|
|
131
131
|
```tsx
|
|
132
132
|
interface FTData {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
name :string;
|
|
134
|
+
symbol :string;
|
|
135
|
+
decimal :number;
|
|
136
|
+
amount :number;
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
interface CollectionData {
|
|
@@ -146,7 +146,7 @@ interface CollectionData {
|
|
|
146
146
|
interface NFTData {
|
|
147
147
|
nftName: string;
|
|
148
148
|
symbol: string;
|
|
149
|
-
|
|
149
|
+
description: string;
|
|
150
150
|
attributes: string;
|
|
151
151
|
file?: string;//file为图片base64编码后数据,若无则为引用合集图片
|
|
152
152
|
};
|
|
@@ -157,7 +157,7 @@ interface RequestParam = {
|
|
|
157
157
|
satoshis?: number;//单位为satoshis
|
|
158
158
|
collection_data?: string; //json格式传
|
|
159
159
|
ft_data?: string; //json格式传
|
|
160
|
-
nft_data?: string;
|
|
160
|
+
nft_data?: string; //json格式传
|
|
161
161
|
collection_id?: string;
|
|
162
162
|
nft_contract_address?: string;
|
|
163
163
|
ft_contract_address?: string;
|
|
@@ -173,7 +173,7 @@ const params = [param:RequestParam] //目前参数里只能放一个对象,有
|
|
|
173
173
|
|
|
174
174
|
```
|
|
175
175
|
const params = [{
|
|
176
|
-
|
|
176
|
+
flag:"P2PKH",
|
|
177
177
|
satoshis: 1000,
|
|
178
178
|
address: "",
|
|
179
179
|
}] ;
|
|
@@ -184,7 +184,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
184
184
|
|
|
185
185
|
```
|
|
186
186
|
const params = [{
|
|
187
|
-
|
|
187
|
+
flag:"COLLECTION_CREATE",
|
|
188
188
|
collection_data:"",
|
|
189
189
|
}];
|
|
190
190
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
@@ -194,7 +194,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
194
194
|
|
|
195
195
|
```
|
|
196
196
|
const params = [{
|
|
197
|
-
|
|
197
|
+
flag:"NFT_CREATE",
|
|
198
198
|
nft_data:"",
|
|
199
199
|
collection_id:""
|
|
200
200
|
}];
|
|
@@ -205,7 +205,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
205
205
|
|
|
206
206
|
```ts
|
|
207
207
|
const params = [{
|
|
208
|
-
|
|
208
|
+
flag:"NFT_TRANSFER",
|
|
209
209
|
nft_contract_address:"",
|
|
210
210
|
address:""
|
|
211
211
|
}];
|
|
@@ -216,7 +216,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
216
216
|
|
|
217
217
|
```
|
|
218
218
|
const params = [{
|
|
219
|
-
|
|
219
|
+
flag:"FT_MINT",
|
|
220
220
|
ft_data:""
|
|
221
221
|
}];
|
|
222
222
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
@@ -226,7 +226,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
226
226
|
|
|
227
227
|
```
|
|
228
228
|
const params = [{
|
|
229
|
-
|
|
229
|
+
flag:"FT_TRANSFER",
|
|
230
230
|
ft_contract_address:"",
|
|
231
231
|
ft_amount:0.1,
|
|
232
232
|
address::""
|
|
@@ -238,8 +238,9 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
238
238
|
|
|
239
239
|
```
|
|
240
240
|
const params = [{
|
|
241
|
-
|
|
241
|
+
flag:"POOLNFT_MINT",
|
|
242
242
|
ft_contract_address:"",
|
|
243
|
+
with_lock?:false //默认值为false,为true则创建带哈希锁的poolNFT
|
|
243
244
|
}];
|
|
244
245
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
245
246
|
```
|
|
@@ -248,7 +249,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
248
249
|
|
|
249
250
|
```
|
|
250
251
|
const params = [{
|
|
251
|
-
|
|
252
|
+
flag:"POOLNFT_INIT",
|
|
252
253
|
nft_contract_address:"",
|
|
253
254
|
address:"",
|
|
254
255
|
tbc_amount:30,
|
|
@@ -261,7 +262,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
261
262
|
|
|
262
263
|
```
|
|
263
264
|
const params = [{
|
|
264
|
-
|
|
265
|
+
flag:"POOLNFT_LP_INCREASE",
|
|
265
266
|
nft_contract_address:"",
|
|
266
267
|
address:"",
|
|
267
268
|
tbc_amount:3
|
|
@@ -273,7 +274,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
273
274
|
|
|
274
275
|
```
|
|
275
276
|
const params = [{
|
|
276
|
-
|
|
277
|
+
flag:"POOLNFT_LP_CONSUME",
|
|
277
278
|
nft_contract_address:"",
|
|
278
279
|
address:""
|
|
279
280
|
ft_amount:100
|
|
@@ -285,7 +286,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
285
286
|
|
|
286
287
|
```
|
|
287
288
|
const params = [{
|
|
288
|
-
|
|
289
|
+
flag:"POOLNFT_SWAP_TO_TOKEN",
|
|
289
290
|
nft_contract_address:"",
|
|
290
291
|
address:"",
|
|
291
292
|
tbc_amount:10
|
|
@@ -297,7 +298,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
297
298
|
|
|
298
299
|
```
|
|
299
300
|
const params = [{
|
|
300
|
-
|
|
301
|
+
flag:"POOLNFT_SWAP_TO_TBC",
|
|
301
302
|
nft_contract_address:"",
|
|
302
303
|
address:"",
|
|
303
304
|
ft_amount:10
|
|
@@ -309,7 +310,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
309
310
|
|
|
310
311
|
```
|
|
311
312
|
const params = [{
|
|
312
|
-
|
|
313
|
+
flag:"POOLNFT_MERGE",
|
|
313
314
|
nft_contract_address:"",
|
|
314
315
|
merge_times:1; //1-10次
|
|
315
316
|
}];
|
|
@@ -320,9 +321,8 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
320
321
|
|
|
321
322
|
```
|
|
322
323
|
const params = [{
|
|
323
|
-
|
|
324
|
+
flag:"FTLP_MERGE",
|
|
324
325
|
nft_contract_address:""
|
|
325
326
|
}];
|
|
326
327
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
327
328
|
```
|
|
328
|
-
|