@hashgraph/hedera-wallet-connect 2.0.1-canary.ce3d8cf.0 → 2.0.1-canary.d03f482.0
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/dist/lib/dapp/index.d.ts
CHANGED
@@ -194,7 +194,9 @@ export declare class DAppConnector {
|
|
194
194
|
*
|
195
195
|
* @param {SignTransactionParams} params - The parameters of type {@link SignTransactionParams | `SignTransactionParams`} required for `Transaction` signing.
|
196
196
|
* @param {string} params.signerAccountId - a signer Hedera Account identifier in {@link https://hips.hedera.com/hip/hip-30 | HIP-30} (`<nework>:<shard>.<realm>.<num>`) form.
|
197
|
-
* @param {Transaction} params.transactionBody - a Transaction object
|
197
|
+
* @param {Transaction | string} params.transactionBody - a built Transaction object, or a base64 string of a transaction body( HIP-820).
|
198
|
+
* HIP-820 calls for a base64 encoded proto.TransactionBody and many wallets support a serialized Transaction object generated by the Hedera Javascript SDK.
|
199
|
+
* Both options are supported here for backwards compatibility.
|
198
200
|
* @returns Promise\<{@link SignTransactionResult}\>
|
199
201
|
* @example
|
200
202
|
* ```ts
|
package/dist/lib/dapp/index.js
CHANGED
@@ -501,7 +501,9 @@ export class DAppConnector {
|
|
501
501
|
*
|
502
502
|
* @param {SignTransactionParams} params - The parameters of type {@link SignTransactionParams | `SignTransactionParams`} required for `Transaction` signing.
|
503
503
|
* @param {string} params.signerAccountId - a signer Hedera Account identifier in {@link https://hips.hedera.com/hip/hip-30 | HIP-30} (`<nework>:<shard>.<realm>.<num>`) form.
|
504
|
-
* @param {Transaction} params.transactionBody - a Transaction object
|
504
|
+
* @param {Transaction | string} params.transactionBody - a built Transaction object, or a base64 string of a transaction body( HIP-820).
|
505
|
+
* HIP-820 calls for a base64 encoded proto.TransactionBody and many wallets support a serialized Transaction object generated by the Hedera Javascript SDK.
|
506
|
+
* Both options are supported here for backwards compatibility.
|
505
507
|
* @returns Promise\<{@link SignTransactionResult}\>
|
506
508
|
* @example
|
507
509
|
* ```ts
|
@@ -84,7 +84,7 @@ export interface SignAndExecuteTransactionResponse extends EngineTypes.RespondPa
|
|
84
84
|
}
|
85
85
|
export interface SignTransactionParams {
|
86
86
|
signerAccountId: string;
|
87
|
-
transactionBody: Transaction;
|
87
|
+
transactionBody: Transaction | string;
|
88
88
|
}
|
89
89
|
export interface SignTransactionRequest extends EngineTypes.RequestParams {
|
90
90
|
request: {
|
@@ -29,9 +29,10 @@ export declare function transactionToBase64String<T extends Transaction>(transac
|
|
29
29
|
export declare function base64StringToTransaction<T extends Transaction>(transactionBytes: string): T;
|
30
30
|
/**
|
31
31
|
* @param transaction - a base64 encoded string of proto.TransactionBody.encode().finish()
|
32
|
+
* @param nodeAccountId - an optional `AccountId` to set the node account ID for the transaction
|
32
33
|
* @returns `string`
|
33
34
|
* */
|
34
|
-
export declare function transactionToTransactionBody<T extends Transaction>(transaction: T):
|
35
|
+
export declare function transactionToTransactionBody<T extends Transaction>(transaction: T, nodeAccountId?: AccountId | null): proto.ITransactionBody;
|
35
36
|
export declare function transactionBodyToBase64String(transactionBody: proto.ITransactionBody): string;
|
36
37
|
/**
|
37
38
|
* @param transactionList - a proto.TransactionList object
|
package/dist/lib/shared/utils.js
CHANGED
@@ -54,12 +54,13 @@ export function base64StringToTransaction(transactionBytes) {
|
|
54
54
|
}
|
55
55
|
/**
|
56
56
|
* @param transaction - a base64 encoded string of proto.TransactionBody.encode().finish()
|
57
|
+
* @param nodeAccountId - an optional `AccountId` to set the node account ID for the transaction
|
57
58
|
* @returns `string`
|
58
59
|
* */
|
59
|
-
export function transactionToTransactionBody(transaction) {
|
60
|
+
export function transactionToTransactionBody(transaction, nodeAccountId = null) {
|
60
61
|
// This is a private function, though provides the capabilities to construct a proto.TransactionBody
|
61
62
|
//@ts-ignore
|
62
|
-
return transaction._makeTransactionBody(
|
63
|
+
return transaction._makeTransactionBody(nodeAccountId);
|
63
64
|
}
|
64
65
|
export function transactionBodyToBase64String(transactionBody) {
|
65
66
|
return Uint8ArrayToBase64String(proto.TransactionBody.encode(transactionBody).finish());
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hashgraph/hedera-wallet-connect",
|
3
|
-
"version": "2.0.1-canary.
|
3
|
+
"version": "2.0.1-canary.d03f482.0",
|
4
4
|
"description": "A library to facilitate integrating Hedera with WalletConnect",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -14,17 +14,15 @@
|
|
14
14
|
"walletconnect",
|
15
15
|
"reown",
|
16
16
|
"hashgraph",
|
17
|
-
"evm",
|
18
|
-
"ethereum",
|
19
|
-
"smart contracts",
|
20
17
|
"hbar",
|
21
|
-
"
|
18
|
+
"evm",
|
19
|
+
"smart contracts"
|
22
20
|
],
|
23
21
|
"license": "Apache-2.0",
|
24
22
|
"scripts": {
|
25
23
|
"build": "rimraf dist && tsc",
|
26
24
|
"watch": "nodemon --watch src/ --ext ts --exec \"npm run build\"",
|
27
|
-
"test": "jest",
|
25
|
+
"test": "jest --coverage",
|
28
26
|
"prepublishOnly": "rm -Rf dist && npm run test && npm run build",
|
29
27
|
"prettier:check": "prettier --check ./src/",
|
30
28
|
"prettier:fix": "prettier --write ./src/"
|
@@ -38,8 +36,8 @@
|
|
38
36
|
},
|
39
37
|
"devDependencies": {
|
40
38
|
"@swc/jest": "^0.2.37",
|
41
|
-
"@types/jest": "^
|
42
|
-
"jest": "^
|
39
|
+
"@types/jest": "^30.0.0",
|
40
|
+
"jest": "^30.0.3",
|
43
41
|
"prettier": "^3.5.3",
|
44
42
|
"ts-node": "^10.9.2",
|
45
43
|
"typescript": "^5.8.2"
|