@hashgraphonline/hashinal-wc 1.0.117-canary.0 → 1.0.118-canary.1
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/cjs/hashinal-wc.cjs +1 -1
- package/dist/es/index.d.ts +86 -0
- package/dist/es/index.js +800 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/logger.d.ts +10 -0
- package/dist/es/logger.js +41 -0
- package/dist/es/logger.js.map +1 -0
- package/dist/{esm/sign/index.js → es/sign/index.d.ts} +0 -1
- package/dist/es/types.d.ts +254 -0
- package/dist/es/types.js +14 -0
- package/dist/es/types.js.map +1 -0
- package/dist/es/utils/retry.d.ts +1 -0
- package/dist/es/utils/retry.js +8 -0
- package/dist/es/utils/retry.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/umd/hashinal-wc.umd.js +10 -10
- package/dist/umd/hashinal-wc.umd.js.map +1 -1
- package/dist/umd/index.d.ts +1 -0
- package/package.json +4 -4
- package/dist/esm/index.js +0 -771
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/logger.js +0 -38
- package/dist/esm/logger.js.map +0 -1
- package/dist/esm/sign/index.js.map +0 -1
- package/dist/esm/types.js +0 -10
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/utils/retry.js +0 -5
- package/dist/esm/utils/retry.js.map +0 -1
package/dist/cjs/hashinal-wc.cjs
CHANGED
|
@@ -17,5 +17,5 @@ for (const key of ["HashinalsWalletConnectSDK","Name","Result","base64StringToSi
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
exportsObject.__esModule = true;
|
|
20
|
-
exportsObject.loadEsm = () => import('../es/
|
|
20
|
+
exportsObject.loadEsm = () => import('../es/index.js');
|
|
21
21
|
module.exports = exportsObject;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { SessionTypes, SignClientTypes } from '@walletconnect/types';
|
|
2
|
+
import { Transaction, AccountId, ContractId, LedgerId, TransactionReceipt, ContractFunctionParameters, PrivateKey } from '@hashgraph/sdk';
|
|
3
|
+
import { DAppConnector } from '@hashgraph/hedera-wallet-connect';
|
|
4
|
+
import { FetchMessagesResult, TokenBalance, HederaAccountResponse, HederaTXResponse, Nft } from './types';
|
|
5
|
+
import { Logger } from './logger';
|
|
6
|
+
import * as HashgraphSDK from '@hashgraph/sdk';
|
|
7
|
+
declare class HashinalsWalletConnectSDK {
|
|
8
|
+
private static instance;
|
|
9
|
+
private static dAppConnectorInstance;
|
|
10
|
+
private static proxyInstance;
|
|
11
|
+
private logger;
|
|
12
|
+
private network;
|
|
13
|
+
private extensionCheckInterval;
|
|
14
|
+
private hasCalledExtensionCallback;
|
|
15
|
+
get dAppConnector(): DAppConnector;
|
|
16
|
+
constructor(logger?: Logger, network?: LedgerId);
|
|
17
|
+
static getInstance(logger?: Logger, network?: LedgerId): HashinalsWalletConnectSDK;
|
|
18
|
+
setLogger(logger: Logger): void;
|
|
19
|
+
setNetwork(network: LedgerId): void;
|
|
20
|
+
getNetwork(): LedgerId;
|
|
21
|
+
setLogLevel(level: 'error' | 'warn' | 'info' | 'debug'): void;
|
|
22
|
+
init(projectId: string, metadata: SignClientTypes.Metadata, network?: LedgerId, onSessionIframeCreated?: (session: SessionTypes.Struct) => void): Promise<DAppConnector>;
|
|
23
|
+
connect(): Promise<SessionTypes.Struct>;
|
|
24
|
+
disconnect(): Promise<boolean>;
|
|
25
|
+
disconnectAll(): Promise<boolean>;
|
|
26
|
+
executeTransaction(tx: Transaction, disableSigner?: boolean): Promise<TransactionReceipt>;
|
|
27
|
+
executeTransactionWithErrorHandling(tx: Transaction, disableSigner: boolean): Promise<{
|
|
28
|
+
result?: TransactionReceipt;
|
|
29
|
+
error?: string;
|
|
30
|
+
}>;
|
|
31
|
+
submitMessageToTopic(topicId: string, message: string, submitKey?: PrivateKey): Promise<TransactionReceipt>;
|
|
32
|
+
transferHbar(fromAccountId: string, toAccountId: string, amount: number): Promise<TransactionReceipt>;
|
|
33
|
+
executeSmartContract(contractId: string, functionName: string, parameters: ContractFunctionParameters, gas?: number): Promise<TransactionReceipt>;
|
|
34
|
+
private handleNewSession;
|
|
35
|
+
private getNetworkPrefix;
|
|
36
|
+
requestAccount(account: string): Promise<HederaAccountResponse>;
|
|
37
|
+
getAccountBalance(): Promise<string>;
|
|
38
|
+
getAccountInfo(): {
|
|
39
|
+
accountId: string;
|
|
40
|
+
network: LedgerId;
|
|
41
|
+
};
|
|
42
|
+
createTopic(memo?: string, adminKey?: string, submitKey?: string): Promise<string>;
|
|
43
|
+
createToken(name: string, symbol: string, initialSupply: number, decimals: number, treasuryAccountId: string, adminKey: string, supplyKey: string): Promise<string>;
|
|
44
|
+
mintNFT(tokenId: string, metadata: string, supplyKey: PrivateKey): Promise<TransactionReceipt>;
|
|
45
|
+
getMessages(topicId: string, lastTimestamp?: number, disableTimestampFilter?: boolean, network?: string): Promise<FetchMessagesResult>;
|
|
46
|
+
signMessage(message: string): Promise<{
|
|
47
|
+
userSignature: any;
|
|
48
|
+
}>;
|
|
49
|
+
private saveConnectionInfo;
|
|
50
|
+
loadConnectionInfo(): {
|
|
51
|
+
accountId: string | null;
|
|
52
|
+
network: string | null;
|
|
53
|
+
};
|
|
54
|
+
connectWallet(PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata, network?: LedgerId): Promise<{
|
|
55
|
+
accountId: string;
|
|
56
|
+
balance: string;
|
|
57
|
+
session: SessionTypes.Struct;
|
|
58
|
+
}>;
|
|
59
|
+
disconnectWallet(clearStorage?: boolean): Promise<boolean>;
|
|
60
|
+
initAccount(PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata, networkOverride?: LedgerId, onSessionIframeCreated?: (session: SessionTypes.Struct) => void): Promise<{
|
|
61
|
+
accountId: string;
|
|
62
|
+
balance: string;
|
|
63
|
+
} | null>;
|
|
64
|
+
subscribeToExtensions(callback: (extension: any) => void): () => void;
|
|
65
|
+
connectViaDappBrowser(): Promise<void>;
|
|
66
|
+
private connectToExtension;
|
|
67
|
+
private ensureInitialized;
|
|
68
|
+
static run(): void;
|
|
69
|
+
transferToken(tokenId: string, fromAccountId: string, toAccountId: string, amount: number): Promise<TransactionReceipt>;
|
|
70
|
+
createAccount(initialBalance: number): Promise<TransactionReceipt>;
|
|
71
|
+
associateTokenToAccount(accountId: string, tokenId: string): Promise<TransactionReceipt>;
|
|
72
|
+
dissociateTokenFromAccount(accountId: string, tokenId: string): Promise<TransactionReceipt>;
|
|
73
|
+
updateAccount(accountId: string, maxAutomaticTokenAssociations: number): Promise<TransactionReceipt>;
|
|
74
|
+
approveAllowance(spenderAccountId: string, tokenId: string, amount: number, ownerAccountId: string): Promise<TransactionReceipt>;
|
|
75
|
+
getAccountTokens(accountId: string): Promise<{
|
|
76
|
+
tokens: TokenBalance[];
|
|
77
|
+
}>;
|
|
78
|
+
getTransaction(transactionId: string): Promise<HederaTXResponse | null>;
|
|
79
|
+
getTransactionByTimestamp(timestamp: string): Promise<HederaTXResponse | null>;
|
|
80
|
+
getAccountNFTs(accountId: string, tokenId?: string): Promise<Nft[]>;
|
|
81
|
+
validateNFTOwnership(serialNumber: string, accountId: string, tokenId: string): Promise<Nft | null>;
|
|
82
|
+
readSmartContract(data: string, fromAccount: AccountId, contractId: ContractId, estimate?: boolean, value?: number): Promise<any>;
|
|
83
|
+
}
|
|
84
|
+
export * from './types';
|
|
85
|
+
export * from './sign';
|
|
86
|
+
export { HashinalsWalletConnectSDK, HashgraphSDK };
|