@transak/hedera-transak 1.0.5 → 1.0.6
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/lib/index.d.ts +5 -3
- package/lib/index.js +7 -7
- package/lib/types.d.ts +1 -3
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { GetTransactionResult, SendTransactionResult, SendTransactionParams } fr
|
|
|
4
4
|
* @param network
|
|
5
5
|
* @param privateKey
|
|
6
6
|
* @param accountId
|
|
7
|
-
* @param
|
|
7
|
+
* @param userAccountId // user account id
|
|
8
|
+
* @param tokenId
|
|
8
9
|
* @returns
|
|
9
10
|
*/
|
|
10
11
|
declare function isTokenAssociated(network: string, privateKey: string, accountId: string, userAccountId: string, tokenId: string): Promise<boolean>;
|
|
@@ -20,9 +21,10 @@ declare function isTokenAssociated(network: string, privateKey: string, accountI
|
|
|
20
21
|
declare function getBalance(network: string, decimals: number, privateKey: string, accountId: string, tokenId?: string): Promise<number>;
|
|
21
22
|
/**
|
|
22
23
|
* Get the transaction details by transaction id
|
|
23
|
-
* @param
|
|
24
|
+
* @param txnId
|
|
24
25
|
* @param network
|
|
25
|
-
* @param
|
|
26
|
+
* @param privateKey
|
|
27
|
+
* @param accountId
|
|
26
28
|
* @returns
|
|
27
29
|
*/
|
|
28
30
|
declare function getTransaction(txnId: string, network: string, privateKey: string, accountId: string): Promise<GetTransactionResult | null>;
|
package/lib/index.js
CHANGED
|
@@ -61,7 +61,8 @@ function getClient(network, privateKey, accountId) {
|
|
|
61
61
|
* @param network
|
|
62
62
|
* @param privateKey
|
|
63
63
|
* @param accountId
|
|
64
|
-
* @param
|
|
64
|
+
* @param userAccountId // user account id
|
|
65
|
+
* @param tokenId
|
|
65
66
|
* @returns
|
|
66
67
|
*/
|
|
67
68
|
function isTokenAssociated(network, privateKey, accountId, userAccountId, tokenId) {
|
|
@@ -101,9 +102,10 @@ function getBalance(network, decimals, privateKey, accountId, tokenId) {
|
|
|
101
102
|
}
|
|
102
103
|
/**
|
|
103
104
|
* Get the transaction details by transaction id
|
|
104
|
-
* @param
|
|
105
|
+
* @param txnId
|
|
105
106
|
* @param network
|
|
106
|
-
* @param
|
|
107
|
+
* @param privateKey
|
|
108
|
+
* @param accountId
|
|
107
109
|
* @returns
|
|
108
110
|
*/
|
|
109
111
|
function getTransaction(txnId, network, privateKey, accountId) {
|
|
@@ -132,8 +134,7 @@ function getTransaction(txnId, network, privateKey, accountId) {
|
|
|
132
134
|
isInvalid: TransactionRecord.receipt.status.toString() !== 'SUCCESS',
|
|
133
135
|
network,
|
|
134
136
|
nonce: ((_c = TransactionRecord.transactionId.nonce) === null || _c === void 0 ? void 0 : _c.toNumber()) || 0,
|
|
135
|
-
transactionHash: TransactionRecord.
|
|
136
|
-
transactionId: TransactionRecord.transactionId.toString(),
|
|
137
|
+
transactionHash: TransactionRecord.transactionId.toString(),
|
|
137
138
|
transactionLink: getTransactionLink(TransactionRecord.transactionId.toString(), network),
|
|
138
139
|
},
|
|
139
140
|
};
|
|
@@ -179,8 +180,7 @@ function sendTransaction({ to, amount, network, accountId, privateKey, decimals,
|
|
|
179
180
|
network,
|
|
180
181
|
nonce: ((_b = sendTransactionResponse.transactionId.nonce) === null || _b === void 0 ? void 0 : _b.toNumber()) || 0,
|
|
181
182
|
to,
|
|
182
|
-
transactionHash: sendTransactionResponse.
|
|
183
|
-
transactionId: sendTransactionResponse.transactionId.toString(),
|
|
183
|
+
transactionHash: sendTransactionResponse.transactionId.toString(),
|
|
184
184
|
transactionLink: getTransactionLink(sendTransactionResponse.transactionId.toString(), network),
|
|
185
185
|
},
|
|
186
186
|
};
|
package/lib/types.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export declare type GetTransactionResult = {
|
|
|
21
21
|
network: string;
|
|
22
22
|
nonce: number;
|
|
23
23
|
transactionHash: string;
|
|
24
|
-
transactionId: string;
|
|
25
24
|
transactionLink: string;
|
|
26
25
|
};
|
|
27
26
|
};
|
|
@@ -44,9 +43,8 @@ export declare type SendTransactionResult = {
|
|
|
44
43
|
network: string;
|
|
45
44
|
nonce: number;
|
|
46
45
|
to: string;
|
|
47
|
-
transactionHash:
|
|
46
|
+
transactionHash: string;
|
|
48
47
|
transactionLink: string;
|
|
49
|
-
transactionId: string;
|
|
50
48
|
transactionReceipt: TransactionReceipt;
|
|
51
49
|
};
|
|
52
50
|
};
|