turing-wallet-provider 1.0.15 → 1.1.1
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 +22 -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,7 +238,7 @@ 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
243
|
}];
|
|
244
244
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
@@ -248,7 +248,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
248
248
|
|
|
249
249
|
```
|
|
250
250
|
const params = [{
|
|
251
|
-
|
|
251
|
+
flag:"POOLNFT_INIT",
|
|
252
252
|
nft_contract_address:"",
|
|
253
253
|
address:"",
|
|
254
254
|
tbc_amount:30,
|
|
@@ -261,7 +261,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
261
261
|
|
|
262
262
|
```
|
|
263
263
|
const params = [{
|
|
264
|
-
|
|
264
|
+
flag:"POOLNFT_LP_INCREASE",
|
|
265
265
|
nft_contract_address:"",
|
|
266
266
|
address:"",
|
|
267
267
|
tbc_amount:3
|
|
@@ -273,7 +273,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
273
273
|
|
|
274
274
|
```
|
|
275
275
|
const params = [{
|
|
276
|
-
|
|
276
|
+
flag:"POOLNFT_LP_CONSUME",
|
|
277
277
|
nft_contract_address:"",
|
|
278
278
|
address:""
|
|
279
279
|
ft_amount:100
|
|
@@ -285,7 +285,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
285
285
|
|
|
286
286
|
```
|
|
287
287
|
const params = [{
|
|
288
|
-
|
|
288
|
+
flag:"POOLNFT_SWAP_TO_TOKEN",
|
|
289
289
|
nft_contract_address:"",
|
|
290
290
|
address:"",
|
|
291
291
|
tbc_amount:10
|
|
@@ -297,7 +297,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
297
297
|
|
|
298
298
|
```
|
|
299
299
|
const params = [{
|
|
300
|
-
|
|
300
|
+
flag:"POOLNFT_SWAP_TO_TBC",
|
|
301
301
|
nft_contract_address:"",
|
|
302
302
|
address:"",
|
|
303
303
|
ft_amount:10
|
|
@@ -309,7 +309,7 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
309
309
|
|
|
310
310
|
```
|
|
311
311
|
const params = [{
|
|
312
|
-
|
|
312
|
+
flag:"POOLNFT_MERGE",
|
|
313
313
|
nft_contract_address:"",
|
|
314
314
|
merge_times:1; //1-10次
|
|
315
315
|
}];
|
|
@@ -320,9 +320,8 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
320
320
|
|
|
321
321
|
```
|
|
322
322
|
const params = [{
|
|
323
|
-
|
|
323
|
+
flag:"FTLP_MERGE",
|
|
324
324
|
nft_contract_address:""
|
|
325
325
|
}];
|
|
326
326
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
327
327
|
```
|
|
328
|
-
|