@hashgraphonline/hashinal-wc 1.0.66 → 1.0.67
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/es/hashinal-wc.es.js +12 -1
- package/dist/es/hashinal-wc.es.js.map +1 -1
- package/dist/es/index.d.ts +69 -0
- package/dist/es/logger/logger.d.ts +14 -0
- package/dist/es/types.d.ts +179 -0
- package/dist/es/utils/retry.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/types.d.ts +180 -0
- package/dist/umd/hashinal-wc.umd.js +3 -3
- package/dist/umd/hashinal-wc.umd.js.map +1 -1
- package/dist/umd/index.d.ts +69 -0
- package/dist/umd/logger/logger.d.ts +14 -0
- package/dist/umd/types.d.ts +179 -0
- package/dist/umd/utils/retry.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { SessionTypes, SignClientTypes } from '@walletconnect/types';
|
|
2
|
+
import { Transaction, LedgerId, TransactionReceipt, ContractFunctionParameters, PrivateKey } from '@hashgraph/sdk';
|
|
3
|
+
import { DAppConnector } from '@hashgraph/hedera-wallet-connect';
|
|
4
|
+
import { FetchMessagesResult, TokenBalance, HederaAccountResponse } from './types';
|
|
5
|
+
import { ILogger } from './logger/logger';
|
|
6
|
+
import * as HashgraphSDK from '@hashgraph/sdk';
|
|
7
|
+
declare class HashinalsWalletConnectSDK {
|
|
8
|
+
private static instance;
|
|
9
|
+
dAppConnector: DAppConnector | undefined;
|
|
10
|
+
private logger;
|
|
11
|
+
private network;
|
|
12
|
+
constructor(logger?: ILogger, network?: LedgerId);
|
|
13
|
+
static getInstance(logger?: ILogger, network?: LedgerId): HashinalsWalletConnectSDK;
|
|
14
|
+
setLogger(logger: ILogger): void;
|
|
15
|
+
setNetwork(network: LedgerId): void;
|
|
16
|
+
getNetwork(): LedgerId;
|
|
17
|
+
setLogLevel(level: 'error' | 'warn' | 'info' | 'debug'): void;
|
|
18
|
+
init(projectId: string, metadata: SignClientTypes.Metadata, network?: LedgerId): Promise<DAppConnector>;
|
|
19
|
+
connect(): Promise<SessionTypes.Struct>;
|
|
20
|
+
disconnect(): Promise<boolean>;
|
|
21
|
+
executeTransaction(tx: Transaction, disableSigner?: boolean): Promise<TransactionReceipt>;
|
|
22
|
+
executeTransactionWithErrorHandling(tx: Transaction, disableSigner: boolean): Promise<{
|
|
23
|
+
result?: TransactionReceipt;
|
|
24
|
+
error?: string;
|
|
25
|
+
}>;
|
|
26
|
+
submitMessageToTopic(topicId: string, message: string, submitKey?: PrivateKey): Promise<TransactionReceipt>;
|
|
27
|
+
transferHbar(fromAccountId: string, toAccountId: string, amount: number): Promise<TransactionReceipt>;
|
|
28
|
+
executeSmartContract(contractId: string, functionName: string, parameters: ContractFunctionParameters, gas?: number): Promise<TransactionReceipt>;
|
|
29
|
+
private handleNewSession;
|
|
30
|
+
private getNetworkPrefix;
|
|
31
|
+
requestAccount(account: string): Promise<HederaAccountResponse>;
|
|
32
|
+
getAccountBalance(): Promise<string>;
|
|
33
|
+
getAccountInfo(): {
|
|
34
|
+
accountId: string;
|
|
35
|
+
network: LedgerId;
|
|
36
|
+
};
|
|
37
|
+
createTopic(memo?: string, adminKey?: string, submitKey?: string): Promise<string>;
|
|
38
|
+
createToken(name: string, symbol: string, initialSupply: number, decimals: number, treasuryAccountId: string, adminKey: string, supplyKey: string): Promise<string>;
|
|
39
|
+
mintNFT(tokenId: string, metadata: string, supplyKey: PrivateKey): Promise<TransactionReceipt>;
|
|
40
|
+
getMessages(topicId: string, lastTimestamp?: number, disableTimestampFilter?: boolean): Promise<FetchMessagesResult>;
|
|
41
|
+
private saveConnectionInfo;
|
|
42
|
+
loadConnectionInfo(): {
|
|
43
|
+
accountId: string | null;
|
|
44
|
+
network: string | null;
|
|
45
|
+
};
|
|
46
|
+
connectWallet(PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata, network?: LedgerId): Promise<{
|
|
47
|
+
accountId: string;
|
|
48
|
+
balance: string;
|
|
49
|
+
session: SessionTypes.Struct;
|
|
50
|
+
}>;
|
|
51
|
+
disconnectWallet(clearStorage?: boolean): Promise<boolean>;
|
|
52
|
+
initAccount(PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata): Promise<{
|
|
53
|
+
accountId: string;
|
|
54
|
+
balance: string;
|
|
55
|
+
} | null>;
|
|
56
|
+
private ensureInitialized;
|
|
57
|
+
static run(): void;
|
|
58
|
+
transferToken(tokenId: string, fromAccountId: string, toAccountId: string, amount: number): Promise<TransactionReceipt>;
|
|
59
|
+
createAccount(initialBalance: number): Promise<TransactionReceipt>;
|
|
60
|
+
associateTokenToAccount(accountId: string, tokenId: string): Promise<TransactionReceipt>;
|
|
61
|
+
dissociateTokenFromAccount(accountId: string, tokenId: string): Promise<TransactionReceipt>;
|
|
62
|
+
updateAccount(accountId: string, maxAutomaticTokenAssociations: number): Promise<TransactionReceipt>;
|
|
63
|
+
approveAllowance(spenderAccountId: string, tokenId: string, amount: number, ownerAccountId: string): Promise<TransactionReceipt>;
|
|
64
|
+
getAccountTokens(accountId: string): Promise<{
|
|
65
|
+
tokens: TokenBalance[];
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
export * from './types';
|
|
69
|
+
export { HashinalsWalletConnectSDK, HashgraphSDK };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ILogger {
|
|
2
|
+
error(message: string, ...args: any[]): void;
|
|
3
|
+
warn(message: string, ...args: any[]): void;
|
|
4
|
+
info(message: string, ...args: any[]): void;
|
|
5
|
+
debug(message: string, ...args: any[]): void;
|
|
6
|
+
}
|
|
7
|
+
export declare class DefaultLogger implements ILogger {
|
|
8
|
+
private logLevel;
|
|
9
|
+
setLogLevel(level: 'error' | 'warn' | 'info' | 'debug'): void;
|
|
10
|
+
error(message: string, ...args: any[]): void;
|
|
11
|
+
warn(message: string, ...args: any[]): void;
|
|
12
|
+
info(message: string, ...args: any[]): void;
|
|
13
|
+
debug(message: string, ...args: any[]): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { DAppConnector } from '@hashgraph/hedera-wallet-connect';
|
|
2
|
+
import { default as hashgraph, PrivateKey, Transaction, ContractFunctionParameters, TransactionReceipt } from '@hashgraph/sdk';
|
|
3
|
+
import { SessionTypes, SignClientTypes } from '@walletconnect/types';
|
|
4
|
+
export interface HederaAccountResponse {
|
|
5
|
+
account: string;
|
|
6
|
+
alias: null;
|
|
7
|
+
auto_renew_period: number;
|
|
8
|
+
balance: Balance;
|
|
9
|
+
created_timestamp: string;
|
|
10
|
+
decline_reward: boolean;
|
|
11
|
+
deleted: boolean;
|
|
12
|
+
ethereum_nonce: number;
|
|
13
|
+
evm_address: string;
|
|
14
|
+
expiry_timestamp: string;
|
|
15
|
+
key: Key;
|
|
16
|
+
max_automatic_token_associations: number;
|
|
17
|
+
memo: string;
|
|
18
|
+
pending_reward: number;
|
|
19
|
+
receiver_sig_required: boolean;
|
|
20
|
+
staked_account_id: null;
|
|
21
|
+
staked_node_id: number;
|
|
22
|
+
stake_period_start: string;
|
|
23
|
+
transactions: HBARTransaction[];
|
|
24
|
+
links: Links;
|
|
25
|
+
}
|
|
26
|
+
export interface Balance {
|
|
27
|
+
balance: number;
|
|
28
|
+
timestamp: string;
|
|
29
|
+
tokens: Token[];
|
|
30
|
+
}
|
|
31
|
+
export interface Token {
|
|
32
|
+
token_id: string;
|
|
33
|
+
balance: number;
|
|
34
|
+
}
|
|
35
|
+
export interface Key {
|
|
36
|
+
_type: string;
|
|
37
|
+
key: string;
|
|
38
|
+
}
|
|
39
|
+
export interface Links {
|
|
40
|
+
next: string;
|
|
41
|
+
}
|
|
42
|
+
export interface HBARTransaction {
|
|
43
|
+
bytes: null;
|
|
44
|
+
charged_tx_fee: number;
|
|
45
|
+
consensus_timestamp: string;
|
|
46
|
+
entity_id: null | string;
|
|
47
|
+
max_fee: string;
|
|
48
|
+
memo_base64: string;
|
|
49
|
+
name: Name;
|
|
50
|
+
nft_transfers: NftTransfer[];
|
|
51
|
+
node: string;
|
|
52
|
+
nonce: number;
|
|
53
|
+
parent_consensus_timestamp: null;
|
|
54
|
+
result: Result;
|
|
55
|
+
scheduled: boolean;
|
|
56
|
+
staking_reward_transfers: StakingRewardTransfer[];
|
|
57
|
+
token_transfers: Transfer[];
|
|
58
|
+
transaction_hash: string;
|
|
59
|
+
transaction_id: string;
|
|
60
|
+
transfers: Transfer[];
|
|
61
|
+
valid_duration_seconds: string;
|
|
62
|
+
valid_start_timestamp: string;
|
|
63
|
+
}
|
|
64
|
+
export declare enum Name {
|
|
65
|
+
Contractcall = "CONTRACTCALL",
|
|
66
|
+
Cryptotransfer = "CRYPTOTRANSFER"
|
|
67
|
+
}
|
|
68
|
+
export interface NftTransfer {
|
|
69
|
+
is_approval: boolean;
|
|
70
|
+
receiver_account_id: string;
|
|
71
|
+
sender_account_id: string;
|
|
72
|
+
serial_number: number;
|
|
73
|
+
token_id: string;
|
|
74
|
+
}
|
|
75
|
+
export declare enum Result {
|
|
76
|
+
Success = "SUCCESS"
|
|
77
|
+
}
|
|
78
|
+
export interface StakingRewardTransfer {
|
|
79
|
+
account: string;
|
|
80
|
+
amount: number;
|
|
81
|
+
}
|
|
82
|
+
export interface Transfer {
|
|
83
|
+
token_id?: string;
|
|
84
|
+
account: string;
|
|
85
|
+
amount: number;
|
|
86
|
+
is_approval: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface Message {
|
|
89
|
+
payer: string;
|
|
90
|
+
created: Date;
|
|
91
|
+
consensus_timestamp: string;
|
|
92
|
+
sequence_number: number;
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
}
|
|
95
|
+
export interface FetchMessagesResult {
|
|
96
|
+
messages: Message[];
|
|
97
|
+
error?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface Account {
|
|
100
|
+
account: string;
|
|
101
|
+
alias: null;
|
|
102
|
+
auto_renew_period: number;
|
|
103
|
+
balance: Balance;
|
|
104
|
+
decline_reward: boolean;
|
|
105
|
+
deleted: boolean;
|
|
106
|
+
ethereum_nonce: null;
|
|
107
|
+
evm_address: null;
|
|
108
|
+
expiry_timestamp: string;
|
|
109
|
+
key: Key;
|
|
110
|
+
max_automatic_token_associations: number;
|
|
111
|
+
memo: string;
|
|
112
|
+
receiver_sig_required: null;
|
|
113
|
+
staked_account_id: null;
|
|
114
|
+
staked_node_id: null;
|
|
115
|
+
stake_period_start: null;
|
|
116
|
+
}
|
|
117
|
+
export interface Balance {
|
|
118
|
+
balance: number;
|
|
119
|
+
timestamp: string;
|
|
120
|
+
tokens: Token[];
|
|
121
|
+
}
|
|
122
|
+
export interface Token {
|
|
123
|
+
token_id: string;
|
|
124
|
+
balance: number;
|
|
125
|
+
}
|
|
126
|
+
export interface Key {
|
|
127
|
+
_type: string;
|
|
128
|
+
key: string;
|
|
129
|
+
}
|
|
130
|
+
export interface TokenBalance {
|
|
131
|
+
tokenId: string;
|
|
132
|
+
balance: string;
|
|
133
|
+
decimals: number;
|
|
134
|
+
created_timestamp: Date;
|
|
135
|
+
formatted_balance: string;
|
|
136
|
+
}
|
|
137
|
+
export type HashinalsWalletConnectSDK = {
|
|
138
|
+
run: () => void;
|
|
139
|
+
init: (projectId: string, metadata: SignClientTypes.Metadata) => Promise<DAppConnector>;
|
|
140
|
+
connect: () => Promise<SessionTypes.Struct>;
|
|
141
|
+
connectWallet(PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata): Promise<{
|
|
142
|
+
accountId: string;
|
|
143
|
+
balance: string;
|
|
144
|
+
session: SessionTypes.Struct;
|
|
145
|
+
}>;
|
|
146
|
+
disconnect: () => Promise<boolean>;
|
|
147
|
+
disconnectWallet: () => Promise<boolean>;
|
|
148
|
+
loadConnectionInfo: () => string | null;
|
|
149
|
+
saveConnectionInfo: (accountId: string) => void;
|
|
150
|
+
executeTransaction: (tx: Transaction, disableSigner: boolean) => Promise<TransactionReceipt>;
|
|
151
|
+
executeTransationWithErrorHandling: (tx: Transaction, disableSigner: boolean) => Promise<{
|
|
152
|
+
result?: TransactionReceipt;
|
|
153
|
+
error?: string;
|
|
154
|
+
}>;
|
|
155
|
+
submitMessageToTopic: (topicId: string, message: string) => Promise<TransactionReceipt>;
|
|
156
|
+
transferHbar: (fromAccountId: string, toAccountId: string, amount: number) => Promise<TransactionReceipt>;
|
|
157
|
+
executeSmartContract: (contractId: string, functionName: string, parameters: ContractFunctionParameters, gas?: number) => Promise<TransactionReceipt>;
|
|
158
|
+
getAccountBalance: () => Promise<string>;
|
|
159
|
+
getAccountInfo: () => string;
|
|
160
|
+
createTopic: (memo?: string, adminKey?: string, submitKey?: string) => Promise<string>;
|
|
161
|
+
createToken: (name: string, symbol: string, initialSupply: number, decimals: number, treasuryAccountId: string, adminKey: string, supplyKey: string) => Promise<string>;
|
|
162
|
+
mintNFT: (tokenId: string, metadata: string, supplyKey: PrivateKey) => Promise<TransactionReceipt>;
|
|
163
|
+
dAppConnector?: DAppConnector;
|
|
164
|
+
getMessages: (topicId: string, collectedMessages: Message[], lastTimestamp?: number, disableTimestampFilter?: boolean, nextUrl?: string) => Promise<FetchMessagesResult>;
|
|
165
|
+
initAccount: (PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata) => Promise<{
|
|
166
|
+
accountId: string;
|
|
167
|
+
balance: string;
|
|
168
|
+
} | null>;
|
|
169
|
+
transferToken: (tokenId: string, fromAccountId: string, toAccountId: string, amount: number) => Promise<TransactionReceipt>;
|
|
170
|
+
createAccount: (initialBalance: number) => Promise<TransactionReceipt>;
|
|
171
|
+
associateTokenToAccount: (accountId: string, tokenId: string) => Promise<TransactionReceipt>;
|
|
172
|
+
dissociateTokenFromAccount: (accountId: string, tokenId: string) => Promise<TransactionReceipt>;
|
|
173
|
+
updateAccount: (accountId: string, maxAutomaticTokenAssociations: number) => Promise<TransactionReceipt>;
|
|
174
|
+
approveAllowance: (spenderAccountId: string, tokenId: string, amount: number, ownerAccountId: string) => Promise<TransactionReceipt>;
|
|
175
|
+
getAccountTokens: (accountId: string) => Promise<{
|
|
176
|
+
tokens: TokenBalance[];
|
|
177
|
+
}>;
|
|
178
|
+
HashgraphSDK: typeof hashgraph;
|
|
179
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetchWithRetry: () => (input: string | Request | URL, init?: import('fetch-retry').RequestInitWithRetry<typeof fetch>) => Promise<Response>;
|
package/dist/index.d.ts
CHANGED
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { DAppConnector } from '@hashgraph/hedera-wallet-connect';
|
|
2
|
+
import hashgraph, { PrivateKey, Transaction } from '@hashgraph/sdk';
|
|
3
|
+
import { ContractFunctionParameters, TransactionReceipt } from '@hashgraph/sdk';
|
|
4
|
+
import { SessionTypes, SignClientTypes } from '@walletconnect/types';
|
|
5
|
+
export interface HederaAccountResponse {
|
|
6
|
+
account: string;
|
|
7
|
+
alias: null;
|
|
8
|
+
auto_renew_period: number;
|
|
9
|
+
balance: Balance;
|
|
10
|
+
created_timestamp: string;
|
|
11
|
+
decline_reward: boolean;
|
|
12
|
+
deleted: boolean;
|
|
13
|
+
ethereum_nonce: number;
|
|
14
|
+
evm_address: string;
|
|
15
|
+
expiry_timestamp: string;
|
|
16
|
+
key: Key;
|
|
17
|
+
max_automatic_token_associations: number;
|
|
18
|
+
memo: string;
|
|
19
|
+
pending_reward: number;
|
|
20
|
+
receiver_sig_required: boolean;
|
|
21
|
+
staked_account_id: null;
|
|
22
|
+
staked_node_id: number;
|
|
23
|
+
stake_period_start: string;
|
|
24
|
+
transactions: HBARTransaction[];
|
|
25
|
+
links: Links;
|
|
26
|
+
}
|
|
27
|
+
export interface Balance {
|
|
28
|
+
balance: number;
|
|
29
|
+
timestamp: string;
|
|
30
|
+
tokens: Token[];
|
|
31
|
+
}
|
|
32
|
+
export interface Token {
|
|
33
|
+
token_id: string;
|
|
34
|
+
balance: number;
|
|
35
|
+
}
|
|
36
|
+
export interface Key {
|
|
37
|
+
_type: string;
|
|
38
|
+
key: string;
|
|
39
|
+
}
|
|
40
|
+
export interface Links {
|
|
41
|
+
next: string;
|
|
42
|
+
}
|
|
43
|
+
export interface HBARTransaction {
|
|
44
|
+
bytes: null;
|
|
45
|
+
charged_tx_fee: number;
|
|
46
|
+
consensus_timestamp: string;
|
|
47
|
+
entity_id: null | string;
|
|
48
|
+
max_fee: string;
|
|
49
|
+
memo_base64: string;
|
|
50
|
+
name: Name;
|
|
51
|
+
nft_transfers: NftTransfer[];
|
|
52
|
+
node: string;
|
|
53
|
+
nonce: number;
|
|
54
|
+
parent_consensus_timestamp: null;
|
|
55
|
+
result: Result;
|
|
56
|
+
scheduled: boolean;
|
|
57
|
+
staking_reward_transfers: StakingRewardTransfer[];
|
|
58
|
+
token_transfers: Transfer[];
|
|
59
|
+
transaction_hash: string;
|
|
60
|
+
transaction_id: string;
|
|
61
|
+
transfers: Transfer[];
|
|
62
|
+
valid_duration_seconds: string;
|
|
63
|
+
valid_start_timestamp: string;
|
|
64
|
+
}
|
|
65
|
+
export declare enum Name {
|
|
66
|
+
Contractcall = "CONTRACTCALL",
|
|
67
|
+
Cryptotransfer = "CRYPTOTRANSFER"
|
|
68
|
+
}
|
|
69
|
+
export interface NftTransfer {
|
|
70
|
+
is_approval: boolean;
|
|
71
|
+
receiver_account_id: string;
|
|
72
|
+
sender_account_id: string;
|
|
73
|
+
serial_number: number;
|
|
74
|
+
token_id: string;
|
|
75
|
+
}
|
|
76
|
+
export declare enum Result {
|
|
77
|
+
Success = "SUCCESS"
|
|
78
|
+
}
|
|
79
|
+
export interface StakingRewardTransfer {
|
|
80
|
+
account: string;
|
|
81
|
+
amount: number;
|
|
82
|
+
}
|
|
83
|
+
export interface Transfer {
|
|
84
|
+
token_id?: string;
|
|
85
|
+
account: string;
|
|
86
|
+
amount: number;
|
|
87
|
+
is_approval: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface Message {
|
|
90
|
+
payer: string;
|
|
91
|
+
created: Date;
|
|
92
|
+
consensus_timestamp: string;
|
|
93
|
+
sequence_number: number;
|
|
94
|
+
[key: string]: any;
|
|
95
|
+
}
|
|
96
|
+
export interface FetchMessagesResult {
|
|
97
|
+
messages: Message[];
|
|
98
|
+
error?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface Account {
|
|
101
|
+
account: string;
|
|
102
|
+
alias: null;
|
|
103
|
+
auto_renew_period: number;
|
|
104
|
+
balance: Balance;
|
|
105
|
+
decline_reward: boolean;
|
|
106
|
+
deleted: boolean;
|
|
107
|
+
ethereum_nonce: null;
|
|
108
|
+
evm_address: null;
|
|
109
|
+
expiry_timestamp: string;
|
|
110
|
+
key: Key;
|
|
111
|
+
max_automatic_token_associations: number;
|
|
112
|
+
memo: string;
|
|
113
|
+
receiver_sig_required: null;
|
|
114
|
+
staked_account_id: null;
|
|
115
|
+
staked_node_id: null;
|
|
116
|
+
stake_period_start: null;
|
|
117
|
+
}
|
|
118
|
+
export interface Balance {
|
|
119
|
+
balance: number;
|
|
120
|
+
timestamp: string;
|
|
121
|
+
tokens: Token[];
|
|
122
|
+
}
|
|
123
|
+
export interface Token {
|
|
124
|
+
token_id: string;
|
|
125
|
+
balance: number;
|
|
126
|
+
}
|
|
127
|
+
export interface Key {
|
|
128
|
+
_type: string;
|
|
129
|
+
key: string;
|
|
130
|
+
}
|
|
131
|
+
export interface TokenBalance {
|
|
132
|
+
tokenId: string;
|
|
133
|
+
balance: string;
|
|
134
|
+
decimals: number;
|
|
135
|
+
created_timestamp: Date;
|
|
136
|
+
formatted_balance: string;
|
|
137
|
+
}
|
|
138
|
+
export type HashinalsWalletConnectSDK = {
|
|
139
|
+
run: () => void;
|
|
140
|
+
init: (projectId: string, metadata: SignClientTypes.Metadata) => Promise<DAppConnector>;
|
|
141
|
+
connect: () => Promise<SessionTypes.Struct>;
|
|
142
|
+
connectWallet(PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata): Promise<{
|
|
143
|
+
accountId: string;
|
|
144
|
+
balance: string;
|
|
145
|
+
session: SessionTypes.Struct;
|
|
146
|
+
}>;
|
|
147
|
+
disconnect: () => Promise<boolean>;
|
|
148
|
+
disconnectWallet: () => Promise<boolean>;
|
|
149
|
+
loadConnectionInfo: () => string | null;
|
|
150
|
+
saveConnectionInfo: (accountId: string) => void;
|
|
151
|
+
executeTransaction: (tx: Transaction, disableSigner: boolean) => Promise<TransactionReceipt>;
|
|
152
|
+
executeTransationWithErrorHandling: (tx: Transaction, disableSigner: boolean) => Promise<{
|
|
153
|
+
result?: TransactionReceipt;
|
|
154
|
+
error?: string;
|
|
155
|
+
}>;
|
|
156
|
+
submitMessageToTopic: (topicId: string, message: string) => Promise<TransactionReceipt>;
|
|
157
|
+
transferHbar: (fromAccountId: string, toAccountId: string, amount: number) => Promise<TransactionReceipt>;
|
|
158
|
+
executeSmartContract: (contractId: string, functionName: string, parameters: ContractFunctionParameters, gas?: number) => Promise<TransactionReceipt>;
|
|
159
|
+
getAccountBalance: () => Promise<string>;
|
|
160
|
+
getAccountInfo: () => string;
|
|
161
|
+
createTopic: (memo?: string, adminKey?: string, submitKey?: string) => Promise<string>;
|
|
162
|
+
createToken: (name: string, symbol: string, initialSupply: number, decimals: number, treasuryAccountId: string, adminKey: string, supplyKey: string) => Promise<string>;
|
|
163
|
+
mintNFT: (tokenId: string, metadata: string, supplyKey: PrivateKey) => Promise<TransactionReceipt>;
|
|
164
|
+
dAppConnector?: DAppConnector;
|
|
165
|
+
getMessages: (topicId: string, collectedMessages: Message[], lastTimestamp?: number, disableTimestampFilter?: boolean, nextUrl?: string) => Promise<FetchMessagesResult>;
|
|
166
|
+
initAccount: (PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata) => Promise<{
|
|
167
|
+
accountId: string;
|
|
168
|
+
balance: string;
|
|
169
|
+
} | null>;
|
|
170
|
+
transferToken: (tokenId: string, fromAccountId: string, toAccountId: string, amount: number) => Promise<TransactionReceipt>;
|
|
171
|
+
createAccount: (initialBalance: number) => Promise<TransactionReceipt>;
|
|
172
|
+
associateTokenToAccount: (accountId: string, tokenId: string) => Promise<TransactionReceipt>;
|
|
173
|
+
dissociateTokenFromAccount: (accountId: string, tokenId: string) => Promise<TransactionReceipt>;
|
|
174
|
+
updateAccount: (accountId: string, maxAutomaticTokenAssociations: number) => Promise<TransactionReceipt>;
|
|
175
|
+
approveAllowance: (spenderAccountId: string, tokenId: string, amount: number, ownerAccountId: string) => Promise<TransactionReceipt>;
|
|
176
|
+
getAccountTokens: (accountId: string) => Promise<{
|
|
177
|
+
tokens: TokenBalance[];
|
|
178
|
+
}>;
|
|
179
|
+
HashgraphSDK: typeof hashgraph;
|
|
180
|
+
};
|