@hashgraphonline/hashinal-wc 1.0.70 → 1.0.72

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
@@ -26,7 +26,7 @@ This SDK provides a simple interface for interacting with the Hedera Hashgraph u
26
26
  No installation needed. Reference the script directly in your HTML:
27
27
 
28
28
  ```html
29
- <script data-src="hcs://1/0.0.7153927" data-script-id="wallet-connect"></script>
29
+ <script data-src="hcs://1/0.0.7337015" data-script-id="wallet-connect"></script>
30
30
  ```
31
31
 
32
32
  ### For NPM projects (ESM)
@@ -34,7 +34,7 @@ No installation needed. Reference the script directly in your HTML:
34
34
  Install the package:
35
35
 
36
36
  ```bash
37
- npm install @hashgraphonline/hashinals-wc @hashgraph/sdk @hashgraph/proto @hashgraph/hedera-wallet-connect @walletconnect/modal @walletconnect/qrcode-modal @walletconnect/utils @walletconnect/types @walletconnect/modal-core fetch-retry
37
+ npm install @hashgraphonline/hashinal-wc @hashgraph/sdk @hashgraph/proto @hashgraph/hedera-wallet-connect @walletconnect/modal @walletconnect/qrcode-modal @walletconnect/utils @walletconnect/types @walletconnect/modal-core fetch-retry
38
38
  ```
39
39
 
40
40
  ## Usage
@@ -52,7 +52,7 @@ const sdk = window.HashinalsWalletConnectSDK;
52
52
  Import and use the SDK:
53
53
 
54
54
  ```javascript
55
- import { HashinalsWalletConnectSDK } from '@hashgraphonline/hashinals-wc';
55
+ import { HashinalsWalletConnectSDK } from '@hashgraphonline/hashinal-wc';
56
56
  const sdk = HashinalsWalletConnectSDK.getInstance();
57
57
  ```
58
58
 
@@ -78,7 +78,7 @@ await window.HashinalsWalletConnectSDK.init(projectId, metadata);
78
78
  ESM Example:
79
79
 
80
80
  ```javascript
81
- import { HashinalsWalletConnectSDK } from '@hashgraphonline/hashinals-wc';
81
+ import { HashinalsWalletConnectSDK } from '@hashgraphonline/hashinal-wc';
82
82
  import { LedgerId } from '@hashgraph/sdk';
83
83
 
84
84
  const sdk = HashinalsWalletConnectSDK.getInstance();
@@ -529,6 +529,7 @@ Version 1.0.58 and onward correlate with the NPM Package version.
529
529
  | v1.0.58 | 0.0.7001143 | UMD |
530
530
  | v1.0.62 | 0.0.7111719 | UMD |
531
531
  | v1.0.64 | 0.0.7153927 | UMD |
532
+ | v1.0.71 | 0.0.7337015 | UMD |
532
533
 
533
534
  ## Contributing
534
535
 
@@ -1,6 +1,7 @@
1
1
  import * as HashgraphSDK from "@hashgraph/sdk";
2
2
  import { LedgerId, TopicMessageSubmitTransaction, TopicId, TransferTransaction, TransactionId, AccountId, Hbar, ContractExecuteTransaction, ContractId, TopicCreateTransaction, PrivateKey, TokenCreateTransaction, TokenType, TokenSupplyType, TokenMintTransaction, TokenId, AccountCreateTransaction, TokenAssociateTransaction, TokenDissociateTransaction, AccountUpdateTransaction, AccountAllowanceApproveTransaction } from "@hashgraph/sdk";
3
3
  import { DAppConnector, HederaJsonRpcMethod, HederaSessionEvent, HederaChainId } from "@hashgraph/hedera-wallet-connect";
4
+ import { base64StringToSignatureMap, prefixMessageToSign, verifyMessageSignature } from "@hashgraph/hedera-wallet-connect";
4
5
  import retryFetch from "fetch-retry";
5
6
  var buffer = {};
6
7
  var base64Js = {};
@@ -2138,6 +2139,20 @@ class HashinalsWalletConnectSDK {
2138
2139
  };
2139
2140
  }
2140
2141
  }
2142
+ async signMessage(message) {
2143
+ const dAppConnector = this.dAppConnector;
2144
+ if (!dAppConnector) {
2145
+ throw new Error("No active connection or signer");
2146
+ }
2147
+ const accountInfo = this.getAccountInfo();
2148
+ const accountId = accountInfo == null ? void 0 : accountInfo.accountId;
2149
+ const params = {
2150
+ signerAccountId: `hedera:${this.network}:${accountId}`,
2151
+ message
2152
+ };
2153
+ const result = await dAppConnector.signMessage(params);
2154
+ return { userSignature: result.signatureMap };
2155
+ }
2141
2156
  saveConnectionInfo(accountId, connectedNetwork) {
2142
2157
  if (!accountId) {
2143
2158
  localStorage.removeItem("connectedAccountId");
@@ -2326,6 +2341,9 @@ export {
2326
2341
  HashgraphSDK,
2327
2342
  HashinalsWalletConnectSDK,
2328
2343
  Name,
2329
- Result
2344
+ Result,
2345
+ base64StringToSignatureMap,
2346
+ prefixMessageToSign,
2347
+ verifyMessageSignature
2330
2348
  };
2331
2349
  //# sourceMappingURL=hashinal-wc.es.js.map