@hinkal/common 0.0.127 → 0.0.129
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.
|
@@ -5,29 +5,28 @@ export interface ChainEventListener {
|
|
|
5
5
|
onAccountChanged(): void;
|
|
6
6
|
onChainChanged(chainId?: number): void;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export declare abstract class IProviderAdapter<ConnectorType = unknown> {
|
|
9
9
|
chainId: number | undefined;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
10
|
+
abstract init(chainId?: number): Promise<void>;
|
|
11
|
+
abstract connectToConnector(connector: ConnectorType): Promise<number>;
|
|
12
|
+
abstract disconnectFromConnector(): Promise<void>;
|
|
13
|
+
abstract connectAndPatchProvider(connector: ConnectorType): Promise<number>;
|
|
14
|
+
abstract waitForTransaction(transactionHash: string, confirmations: number): Promise<boolean>;
|
|
15
|
+
abstract signMessage(message: string | Uint8Array): Promise<string>;
|
|
16
|
+
abstract getAddress(): Promise<string>;
|
|
17
|
+
abstract getSelectedNetwork(): EthereumNetwork | undefined;
|
|
18
|
+
abstract setChainEventListener(chainEventListener: ChainEventListener): void;
|
|
19
|
+
abstract release(): void;
|
|
20
|
+
abstract getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
21
|
+
abstract getContract(contractType: ContractType, contractAddress?: string, chainId?: number): ethers.Contract;
|
|
22
|
+
abstract getContractWithSigner(contract: ContractType, contractAddress?: string): Contract;
|
|
23
|
+
abstract getContractWithFetcher(contract: ContractType, contractAddress?: string): Contract;
|
|
24
|
+
abstract getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: string): Contract;
|
|
25
|
+
abstract sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>;
|
|
26
|
+
abstract switchNetwork(network: EthereumNetwork): Promise<unknown>;
|
|
27
|
+
abstract onAccountChanged(): Promise<unknown>;
|
|
28
|
+
abstract onChainChanged(chainId?: number): Promise<unknown>;
|
|
29
|
+
abstract isPermitterAvailable(): boolean;
|
|
30
|
+
abstract getGasPrice(): Promise<bigint>;
|
|
31
|
+
abstract signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
33
32
|
}
|
package/index.mjs
CHANGED
|
@@ -309258,6 +309258,9 @@ class Hinkal {
|
|
|
309258
309258
|
}
|
|
309259
309259
|
const hinkalTransfer = async () => {
|
|
309260
309260
|
};
|
|
309261
|
+
class IProviderAdapter {
|
|
309262
|
+
chainId;
|
|
309263
|
+
}
|
|
309261
309264
|
async function checkErrorForSnapshotRestore(C, I) {
|
|
309262
309265
|
const l = I.getCurrentChainId(), Z = extractMessage(C);
|
|
309263
309266
|
return Z === transactionErrorCodes.INVALID_NULLIFIER || Z === transactionErrorCodes.MERKLE_TREE_INCOMPLETE || Z === transactionErrorCodes.ACCESS_TOKEN_INVALID_HASH || Z === transactionErrorCodes.INVALID_MERKLE_ROOT || Z === transactionErrorCodes.MERLE_TREE_SNARK || Z === transactionErrorCodes.STATE_TO_UPDATE ? (await restoreSnapshots(l), await resetMerkleTrees(I), new Error(transactionErrorCodes.INTERNAL_ERROR)) : C;
|
|
@@ -414020,6 +414023,7 @@ export {
|
|
|
414020
414023
|
HinkalStakeMode,
|
|
414021
414024
|
IMAGE_PATHS,
|
|
414022
414025
|
INTERACTION,
|
|
414026
|
+
IProviderAdapter,
|
|
414023
414027
|
abi$h as ISwapRouterABI,
|
|
414024
414028
|
IntegrationProvider,
|
|
414025
414029
|
KycVerificationResult,
|