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