@hashgraphonline/hashinal-wc 1.0.96 → 1.0.97
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 +35 -21
- package/dist/umd/hashinal-wc.umd.js +21 -11
- package/dist/umd/hashinal-wc.umd.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -253,7 +253,7 @@ const receipt = await sdk.transferToken(
|
|
|
253
253
|
|
|
254
254
|
### `createAccount(initialBalance: number)`
|
|
255
255
|
|
|
256
|
-
Creates a new account on the Hedera
|
|
256
|
+
Creates a new account on the Hedera Hashgraph.
|
|
257
257
|
|
|
258
258
|
UMD Example:
|
|
259
259
|
|
|
@@ -377,7 +377,7 @@ console.log('Account balance:', balance);
|
|
|
377
377
|
|
|
378
378
|
### `createTopic(memo?: string, adminKey?: string, submitKey?: string)`
|
|
379
379
|
|
|
380
|
-
Creates a new topic on the Hedera
|
|
380
|
+
Creates a new topic on the Hedera Hashgraph.
|
|
381
381
|
|
|
382
382
|
UMD Example:
|
|
383
383
|
|
|
@@ -413,7 +413,7 @@ console.log('New topic created:', topicId);
|
|
|
413
413
|
|
|
414
414
|
### `createToken(name: string, symbol: string, initialSupply: number, decimals: number, treasuryAccountId: string, adminKey: string, supplyKey: string)`
|
|
415
415
|
|
|
416
|
-
Creates a new token on the Hedera
|
|
416
|
+
Creates a new token on the Hedera Hashgraph.
|
|
417
417
|
|
|
418
418
|
UMD Example:
|
|
419
419
|
|
|
@@ -529,8 +529,10 @@ Retrieves transaction details by transaction ID from the mirror node.
|
|
|
529
529
|
UMD Example:
|
|
530
530
|
|
|
531
531
|
```javascript
|
|
532
|
-
const transactionId =
|
|
533
|
-
const transaction = await window.HashinalsWalletConnectSDK.getTransaction(
|
|
532
|
+
const transactionId = '0.0.123456@1234567890.000000000';
|
|
533
|
+
const transaction = await window.HashinalsWalletConnectSDK.getTransaction(
|
|
534
|
+
transactionId
|
|
535
|
+
);
|
|
534
536
|
console.log(transaction);
|
|
535
537
|
```
|
|
536
538
|
|
|
@@ -547,8 +549,9 @@ Retrieves transaction details by consensus timestamp from the mirror node.
|
|
|
547
549
|
UMD Example:
|
|
548
550
|
|
|
549
551
|
```javascript
|
|
550
|
-
const timestamp =
|
|
551
|
-
const transaction =
|
|
552
|
+
const timestamp = '1234567890.000000000';
|
|
553
|
+
const transaction =
|
|
554
|
+
await window.HashinalsWalletConnectSDK.getTransactionByTimestamp(timestamp);
|
|
552
555
|
console.log(transaction);
|
|
553
556
|
```
|
|
554
557
|
|
|
@@ -565,13 +568,16 @@ Retrieves all NFTs owned by an account, with optional filtering by token ID.
|
|
|
565
568
|
UMD Example:
|
|
566
569
|
|
|
567
570
|
```javascript
|
|
568
|
-
const accountId =
|
|
571
|
+
const accountId = '0.0.123456';
|
|
569
572
|
const nfts = await window.HashinalsWalletConnectSDK.getAccountNFTs(accountId);
|
|
570
573
|
console.log(nfts);
|
|
571
574
|
|
|
572
575
|
// With token filter
|
|
573
|
-
const tokenId =
|
|
574
|
-
const filteredNfts = await window.HashinalsWalletConnectSDK.getAccountNFTs(
|
|
576
|
+
const tokenId = '0.0.789012';
|
|
577
|
+
const filteredNfts = await window.HashinalsWalletConnectSDK.getAccountNFTs(
|
|
578
|
+
accountId,
|
|
579
|
+
tokenId
|
|
580
|
+
);
|
|
575
581
|
```
|
|
576
582
|
|
|
577
583
|
ESM Example:
|
|
@@ -588,11 +594,15 @@ Validates if an account owns a specific NFT by serial number and token ID.
|
|
|
588
594
|
UMD Example:
|
|
589
595
|
|
|
590
596
|
```javascript
|
|
591
|
-
const serialNumber =
|
|
592
|
-
const accountId =
|
|
593
|
-
const tokenId =
|
|
594
|
-
const nft = await window.HashinalsWalletConnectSDK.validateNFTOwnership(
|
|
595
|
-
|
|
597
|
+
const serialNumber = '1';
|
|
598
|
+
const accountId = '0.0.123456';
|
|
599
|
+
const tokenId = '0.0.789012';
|
|
600
|
+
const nft = await window.HashinalsWalletConnectSDK.validateNFTOwnership(
|
|
601
|
+
serialNumber,
|
|
602
|
+
accountId,
|
|
603
|
+
tokenId
|
|
604
|
+
);
|
|
605
|
+
console.log(nft ? 'Account owns this NFT' : 'Account does not own this NFT');
|
|
596
606
|
```
|
|
597
607
|
|
|
598
608
|
ESM Example:
|
|
@@ -608,10 +618,14 @@ Makes a read-only call to a smart contract on the mirror node.
|
|
|
608
618
|
UMD Example:
|
|
609
619
|
|
|
610
620
|
```javascript
|
|
611
|
-
const data =
|
|
612
|
-
const fromAccount = window.HashgraphSDK.AccountId.fromString(
|
|
613
|
-
const contractId = window.HashgraphSDK.ContractId.fromString(
|
|
614
|
-
const result = await window.HashinalsWalletConnectSDK.readSmartContract(
|
|
621
|
+
const data = '0x...'; // Contract call data
|
|
622
|
+
const fromAccount = window.HashgraphSDK.AccountId.fromString('0.0.123456');
|
|
623
|
+
const contractId = window.HashgraphSDK.ContractId.fromString('0.0.789012');
|
|
624
|
+
const result = await window.HashinalsWalletConnectSDK.readSmartContract(
|
|
625
|
+
data,
|
|
626
|
+
fromAccount,
|
|
627
|
+
contractId
|
|
628
|
+
);
|
|
615
629
|
console.log(result);
|
|
616
630
|
```
|
|
617
631
|
|
|
@@ -620,8 +634,8 @@ ESM Example:
|
|
|
620
634
|
```javascript
|
|
621
635
|
import { AccountId, ContractId } from '@hashgraph/sdk';
|
|
622
636
|
|
|
623
|
-
const fromAccount = AccountId.fromString(
|
|
624
|
-
const contractId = ContractId.fromString(
|
|
637
|
+
const fromAccount = AccountId.fromString('0.0.123456');
|
|
638
|
+
const contractId = ContractId.fromString('0.0.789012');
|
|
625
639
|
const result = await sdk.readSmartContract(data, fromAccount, contractId);
|
|
626
640
|
```
|
|
627
641
|
|