turing-wallet-provider 1.2.1 → 1.2.3
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 +36 -31
- package/dist/types/providerTypes.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -131,7 +131,7 @@ try{
|
|
|
131
131
|
```tsx
|
|
132
132
|
interface FTData {
|
|
133
133
|
name:string;
|
|
134
|
-
|
|
134
|
+
symbol :string;
|
|
135
135
|
decimal :number;
|
|
136
136
|
amount :number;
|
|
137
137
|
};
|
|
@@ -163,10 +163,12 @@ interface RequestParam = {
|
|
|
163
163
|
ft_contract_address?: string;
|
|
164
164
|
tbc_amount?: number;
|
|
165
165
|
ft_amount?: number;
|
|
166
|
-
merge_times?:number;
|
|
166
|
+
merge_times?:number; //可选字段 不提供默认为10
|
|
167
167
|
with_lock? boolean;
|
|
168
|
-
poolNFT_version?: number; // 1或2
|
|
169
|
-
serviceFeeRate?: number; // 0-100
|
|
168
|
+
poolNFT_version?: number; // 1或2 不提供默认为2
|
|
169
|
+
serviceFeeRate?: number; // 0-100 poolNFT_version为2有效 不提供默认为25
|
|
170
|
+
serverProvider_tag?:string; //poolNFT_version为2时为必需字段 poolNFT_version为1无效
|
|
171
|
+
lpPlan?:number //1或2 不提供默认为2 lp手续费方案, 方案1: LP 0.25% swap服务商 0.09% 协议0.01%; 方案2: LP 0.05% swap服务商 0.29% 协议0.01%
|
|
170
172
|
};
|
|
171
173
|
|
|
172
174
|
const params = [param:RequestParam] //目前参数里只能放一个对象,有批量发送需求再扩展
|
|
@@ -187,7 +189,7 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
187
189
|
|
|
188
190
|
```ts
|
|
189
191
|
const params = [{
|
|
190
|
-
|
|
192
|
+
flag:"COLLECTION_CREATE",
|
|
191
193
|
collection_data:"",
|
|
192
194
|
}];
|
|
193
195
|
const { txid } = await wallet.sendTransaction(params);
|
|
@@ -197,7 +199,7 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
197
199
|
|
|
198
200
|
```ts
|
|
199
201
|
const params = [{
|
|
200
|
-
|
|
202
|
+
flag:"NFT_CREATE",
|
|
201
203
|
nft_data:"",
|
|
202
204
|
collection_id:""
|
|
203
205
|
}];
|
|
@@ -219,7 +221,7 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
219
221
|
|
|
220
222
|
```ts
|
|
221
223
|
const params = [{
|
|
222
|
-
|
|
224
|
+
flag:"FT_MINT",
|
|
223
225
|
ft_data:""
|
|
224
226
|
}];
|
|
225
227
|
const { txid } = await wallet.sendTransaction(params);
|
|
@@ -229,7 +231,7 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
229
231
|
|
|
230
232
|
```ts
|
|
231
233
|
const params = [{
|
|
232
|
-
|
|
234
|
+
flag:"FT_TRANSFER",
|
|
233
235
|
ft_contract_address:"",
|
|
234
236
|
ft_amount:0.1,
|
|
235
237
|
address:""
|
|
@@ -241,12 +243,13 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
241
243
|
|
|
242
244
|
```ts
|
|
243
245
|
const params = [{
|
|
244
|
-
|
|
246
|
+
flag:"POOLNFT_MINT",
|
|
245
247
|
ft_contract_address:"",
|
|
246
|
-
poolNFT_version
|
|
247
|
-
|
|
248
|
+
poolNFT_version?:2,
|
|
249
|
+
serverProvider_tag?:"",
|
|
250
|
+
serviceFeeRate?:25, // poolNFT_version为2时此参数有效,默认为25
|
|
248
251
|
with_lock?:false //默认值为false,为true则创建带哈希锁的poolNFT
|
|
249
|
-
|
|
252
|
+
lpPlan?:2 //默认值为2
|
|
250
253
|
}];
|
|
251
254
|
const { txid } = await wallet.sendTransaction(params);
|
|
252
255
|
```
|
|
@@ -255,12 +258,12 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
255
258
|
|
|
256
259
|
```ts
|
|
257
260
|
const params = [{
|
|
258
|
-
|
|
261
|
+
flag:"POOLNFT_INIT",
|
|
259
262
|
nft_contract_address:"",
|
|
260
263
|
address:"",
|
|
261
264
|
tbc_amount:30,
|
|
262
|
-
ft_amount:1000
|
|
263
|
-
poolNFT_version
|
|
265
|
+
ft_amount:1000,
|
|
266
|
+
poolNFT_version?:2
|
|
264
267
|
}];
|
|
265
268
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
266
269
|
```
|
|
@@ -269,11 +272,11 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
269
272
|
|
|
270
273
|
```ts
|
|
271
274
|
const params = [{
|
|
272
|
-
|
|
275
|
+
flag:"POOLNFT_LP_INCREASE",
|
|
273
276
|
nft_contract_address:"",
|
|
274
277
|
address:"",
|
|
275
|
-
tbc_amount:3
|
|
276
|
-
poolNFT_version
|
|
278
|
+
tbc_amount:3,
|
|
279
|
+
poolNFT_version?:2
|
|
277
280
|
}];
|
|
278
281
|
const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
279
282
|
```
|
|
@@ -282,11 +285,11 @@ const { txid, rawtx } = await wallet.sendTransaction(params);
|
|
|
282
285
|
|
|
283
286
|
```ts
|
|
284
287
|
const params = [{
|
|
285
|
-
|
|
288
|
+
flag:"POOLNFT_LP_CONSUME",
|
|
286
289
|
nft_contract_address:"",
|
|
287
|
-
address:""
|
|
288
|
-
ft_amount:100
|
|
289
|
-
poolNFT_version
|
|
290
|
+
address:"",
|
|
291
|
+
ft_amount:100,
|
|
292
|
+
poolNFT_version?:2
|
|
290
293
|
}];
|
|
291
294
|
const { txid } = await wallet.sendTransaction(params);
|
|
292
295
|
```
|
|
@@ -295,11 +298,12 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
295
298
|
|
|
296
299
|
```ts
|
|
297
300
|
const params = [{
|
|
298
|
-
|
|
301
|
+
flag:"POOLNFT_SWAP_TO_TOKEN",
|
|
299
302
|
nft_contract_address:"",
|
|
300
303
|
address:"",
|
|
301
|
-
tbc_amount:10
|
|
302
|
-
poolNFT_version
|
|
304
|
+
tbc_amount:10,
|
|
305
|
+
poolNFT_version?:2
|
|
306
|
+
lpPlan?:2 //默认值为2
|
|
303
307
|
}];
|
|
304
308
|
const { txid } = await wallet.sendTransaction(params);
|
|
305
309
|
```
|
|
@@ -308,11 +312,12 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
308
312
|
|
|
309
313
|
```ts
|
|
310
314
|
const params = [{
|
|
311
|
-
|
|
315
|
+
flag:"POOLNFT_SWAP_TO_TBC",
|
|
312
316
|
nft_contract_address:"",
|
|
313
317
|
address:"",
|
|
314
318
|
ft_amount:10,
|
|
315
|
-
poolNFT_version
|
|
319
|
+
poolNFT_version?:2
|
|
320
|
+
lpPlan?:2 //默认值为2
|
|
316
321
|
}];
|
|
317
322
|
const { txid } = await wallet.sendTransaction(params);
|
|
318
323
|
```
|
|
@@ -321,9 +326,9 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
321
326
|
|
|
322
327
|
```ts
|
|
323
328
|
const params = [{
|
|
324
|
-
|
|
329
|
+
flag:"POOLNFT_MERGE",
|
|
325
330
|
nft_contract_address:"",
|
|
326
|
-
poolNFT_version
|
|
331
|
+
poolNFT_version?:2,
|
|
327
332
|
merge_times?:1, //1-10次 默认为10次 不足10次会提前终止
|
|
328
333
|
}];
|
|
329
334
|
const { txid } = await wallet.sendTransaction(params);
|
|
@@ -333,9 +338,9 @@ const { txid } = await wallet.sendTransaction(params);
|
|
|
333
338
|
|
|
334
339
|
```ts
|
|
335
340
|
const params = [{
|
|
336
|
-
|
|
341
|
+
flag:"FTLP_MERGE",
|
|
337
342
|
nft_contract_address:"",
|
|
338
|
-
poolNFT_version
|
|
343
|
+
poolNFT_version?:2
|
|
339
344
|
}];
|
|
340
345
|
const { txid } = await wallet.sendTransaction(params);
|
|
341
346
|
```
|