@hashgraphonline/hashinal-wc 1.0.0 → 1.0.3
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/hashinal-wc.es.js +17 -0
- package/dist/hashinal-wc.es.js.map +1 -0
- package/dist/{hedera-wallet-connect-sdk.js → hashinal-wc.umd.js} +2 -1
- package/dist/hashinal-wc.umd.js.map +1 -0
- package/dist/index-CisFDAGs.js +4092 -0
- package/dist/index-CisFDAGs.js.map +1 -0
- package/dist/index-DVnLv1FW.js +161253 -0
- package/dist/index-DVnLv1FW.js.map +1 -0
- package/dist/index.d.ts +91 -0
- package/package.json +12 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { SessionTypes, SignClientTypes } from '@walletconnect/types';
|
|
2
|
+
import { Transaction, TransactionReceipt, ContractFunctionParameters, PrivateKey } from '@hashgraph/sdk';
|
|
3
|
+
import { DAppConnector } from '@hashgraph/hedera-wallet-connect';
|
|
4
|
+
import { type HederaWalletConnectSDK } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Starts the DAppConnector, without opening a modal.
|
|
7
|
+
* @param projectId
|
|
8
|
+
* @param metadata
|
|
9
|
+
* @returns {DAppConnector}
|
|
10
|
+
*/
|
|
11
|
+
export declare function init(projectId: string, metadata: SignClientTypes.Metadata): Promise<DAppConnector>;
|
|
12
|
+
/**
|
|
13
|
+
* Opens Wallet Connect Modal to start a session.
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare function connect(): Promise<SessionTypes.Struct>;
|
|
17
|
+
/**
|
|
18
|
+
* Disconnects from all wallets
|
|
19
|
+
*/
|
|
20
|
+
export declare function disconnect(): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Executes a Transaction.
|
|
23
|
+
* @param {Transaction} tx
|
|
24
|
+
* @returns {Promise<TransactionResponse>}
|
|
25
|
+
*/
|
|
26
|
+
export declare const executeTransaction: (tx: Transaction) => Promise<TransactionReceipt>;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* Submits a new message to a Topic Id
|
|
30
|
+
* @param {string} topicId
|
|
31
|
+
* @param {string} message
|
|
32
|
+
* @param {string} submitKey
|
|
33
|
+
* @returns {Promise<TransactionReceipt>}
|
|
34
|
+
*/
|
|
35
|
+
export declare function submitMessageToTopic(topicId: string, message: string, submitKey?: PrivateKey): Promise<TransactionReceipt>;
|
|
36
|
+
/**
|
|
37
|
+
* Transfers HBAR from one Account Id to another.
|
|
38
|
+
* @param {string} fromAccountId
|
|
39
|
+
* @param {string} toAccountId
|
|
40
|
+
* @param {number} amount
|
|
41
|
+
* @returns {Promise<TransactionReceipt>}
|
|
42
|
+
*/
|
|
43
|
+
export declare function transferHbar(fromAccountId: string, toAccountId: string, amount: number): Promise<TransactionReceipt>;
|
|
44
|
+
/**
|
|
45
|
+
* Execute a smart contract given an id, name and params.
|
|
46
|
+
* @param contractId
|
|
47
|
+
* @param functionName
|
|
48
|
+
* @param parameters
|
|
49
|
+
* @param gas
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
export declare function executeSmartContract(contractId: string, functionName: string, parameters: ContractFunctionParameters, gas?: number): Promise<TransactionReceipt>;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the current account balance, formatted.
|
|
55
|
+
* @returns {string}
|
|
56
|
+
*/
|
|
57
|
+
export declare function getAccountBalance(): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Gets the current Account Id authenticated with Wallet Connect
|
|
60
|
+
* @returns {string}
|
|
61
|
+
*/
|
|
62
|
+
export declare function getAccountInfo(): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Function to create a new topic, with optional admin and submit keys
|
|
65
|
+
* @param {string} memo
|
|
66
|
+
* @param {string} adminKey
|
|
67
|
+
* @param {string} submitKey
|
|
68
|
+
* @returns {string} topicId
|
|
69
|
+
*/
|
|
70
|
+
export declare function createTopic(memo?: string, adminKey?: string, submitKey?: string): Promise<string>;
|
|
71
|
+
/**
|
|
72
|
+
* Create a new Token ID
|
|
73
|
+
* @param name
|
|
74
|
+
* @param symbol
|
|
75
|
+
* @param initialSupply
|
|
76
|
+
* @param decimals
|
|
77
|
+
* @param treasuryAccountId
|
|
78
|
+
* @param adminKey
|
|
79
|
+
* @param supplyKey
|
|
80
|
+
* @returns {Promise<TransactionReceipt>}
|
|
81
|
+
*/
|
|
82
|
+
export declare function createToken(name: string, symbol: string, initialSupply: number, decimals: number, treasuryAccountId: string, adminKey: string, supplyKey: string): Promise<string>;
|
|
83
|
+
/**
|
|
84
|
+
* Mint a new serial number onto a Token Id.
|
|
85
|
+
* @param {string} tokenId
|
|
86
|
+
* @param {string} metadata
|
|
87
|
+
* @returns {Promise<TransactionReceipt>}
|
|
88
|
+
*/
|
|
89
|
+
export declare function mintNFT(tokenId: string, metadata: string, supplyKey: PrivateKey): Promise<TransactionReceipt>;
|
|
90
|
+
declare const HederaWalletConnectSDK: HederaWalletConnectSDK;
|
|
91
|
+
export default HederaWalletConnectSDK;
|
package/package.json
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/hashinal-wc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "The official Hashinal Wallet Connect SDK. A set of easy-to-use functions to interact with Hedera through Wallet Connect.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
|
-
"main": "./dist/
|
|
9
|
+
"main": "./dist/hashinal-wc.umd.js",
|
|
10
|
+
"module": "./dist/hashinal-wc.es.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/hashinal-wc.es.js",
|
|
14
|
+
"require": "./dist/hashinal-wc.umd.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
10
17
|
"types": "./dist/index.d.ts",
|
|
11
18
|
"scripts": {
|
|
12
|
-
"build": "vite build"
|
|
19
|
+
"build": "tsc && vite build",
|
|
20
|
+
"pub": "npm publish --access public"
|
|
13
21
|
},
|
|
14
22
|
"dependencies": {
|
|
15
23
|
"@hashgraph/hedera-wallet-connect": "^1.3.2",
|
|
@@ -43,4 +51,4 @@
|
|
|
43
51
|
"webpack-cli": "^5.1.4",
|
|
44
52
|
"webpack-dev-server": "^5.0.4"
|
|
45
53
|
}
|
|
46
|
-
}
|
|
54
|
+
}
|