@hinkal/common 0.0.128 → 0.0.130
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,30 +5,30 @@ 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
|
-
init(chainId?: number): Promise<void>;
|
|
13
|
-
connectToConnector(connector: ConnectorType): Promise<number>;
|
|
14
|
-
disconnectFromConnector(): Promise<void>;
|
|
15
|
-
connectAndPatchProvider(connector: ConnectorType): Promise<number>;
|
|
16
|
-
waitForTransaction(transactionHash: string, confirmations: number): Promise<boolean>;
|
|
17
|
-
signMessage(message: string | Uint8Array): Promise<string>;
|
|
18
|
-
getAddress(): Promise<string>;
|
|
19
|
-
getSelectedNetwork(): EthereumNetwork | undefined;
|
|
20
|
-
setChainEventListener(chainEventListener: ChainEventListener): void;
|
|
21
|
-
release(): void;
|
|
22
|
-
getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
23
|
-
getContract(contractType: ContractType, contractAddress?: string, chainId?: number): ethers.Contract;
|
|
24
|
-
getContractWithSigner(contract: ContractType, contractAddress?: string): Contract;
|
|
25
|
-
getContractWithFetcher(contract: ContractType, contractAddress?: string): Contract;
|
|
26
|
-
getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: string): Contract;
|
|
27
|
-
sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>;
|
|
28
|
-
switchNetwork(network: EthereumNetwork): Promise<unknown>;
|
|
29
|
-
onAccountChanged(): Promise<unknown>;
|
|
30
|
-
onChainChanged(chainId?: number): Promise<unknown>;
|
|
31
|
-
isPermitterAvailable(): boolean;
|
|
32
|
-
getGasPrice(): Promise<bigint>;
|
|
33
|
-
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
10
|
+
connector: ConnectorType;
|
|
11
|
+
constructor(connector: ConnectorType);
|
|
12
|
+
abstract init(chainId?: number): Promise<void>;
|
|
13
|
+
abstract connectToConnector(connector: ConnectorType): Promise<number>;
|
|
14
|
+
abstract disconnectFromConnector(): Promise<void>;
|
|
15
|
+
abstract connectAndPatchProvider(connector: ConnectorType): Promise<number>;
|
|
16
|
+
abstract waitForTransaction(transactionHash: string, confirmations: number): Promise<boolean>;
|
|
17
|
+
abstract signMessage(message: string | Uint8Array): Promise<string>;
|
|
18
|
+
abstract getAddress(): Promise<string>;
|
|
19
|
+
abstract getSelectedNetwork(): EthereumNetwork | undefined;
|
|
20
|
+
abstract setChainEventListener(chainEventListener: ChainEventListener): void;
|
|
21
|
+
abstract release(): void;
|
|
22
|
+
abstract getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
23
|
+
abstract getContract(contractType: ContractType, contractAddress?: string, chainId?: number): ethers.Contract;
|
|
24
|
+
abstract getContractWithSigner(contract: ContractType, contractAddress?: string): Contract;
|
|
25
|
+
abstract getContractWithFetcher(contract: ContractType, contractAddress?: string): Contract;
|
|
26
|
+
abstract getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: string): Contract;
|
|
27
|
+
abstract sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>;
|
|
28
|
+
abstract switchNetwork(network: EthereumNetwork): Promise<unknown>;
|
|
29
|
+
abstract onAccountChanged(): Promise<unknown>;
|
|
30
|
+
abstract onChainChanged(chainId?: number): Promise<unknown>;
|
|
31
|
+
abstract isPermitterAvailable(): boolean;
|
|
32
|
+
abstract getGasPrice(): Promise<bigint>;
|
|
33
|
+
abstract signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
34
34
|
}
|
package/index.mjs
CHANGED
|
@@ -309264,6 +309264,13 @@ class Hinkal {
|
|
|
309264
309264
|
}
|
|
309265
309265
|
const hinkalTransfer = async () => {
|
|
309266
309266
|
};
|
|
309267
|
+
class IProviderAdapter {
|
|
309268
|
+
chainId;
|
|
309269
|
+
connector;
|
|
309270
|
+
constructor(I) {
|
|
309271
|
+
this.connector = I;
|
|
309272
|
+
}
|
|
309273
|
+
}
|
|
309267
309274
|
async function checkErrorForSnapshotRestore(C, I) {
|
|
309268
309275
|
const l = I.getCurrentChainId(), Z = extractMessage(C);
|
|
309269
309276
|
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;
|
|
@@ -414026,6 +414033,7 @@ export {
|
|
|
414026
414033
|
HinkalStakeMode,
|
|
414027
414034
|
IMAGE_PATHS,
|
|
414028
414035
|
INTERACTION,
|
|
414036
|
+
IProviderAdapter,
|
|
414029
414037
|
abi$h as ISwapRouterABI,
|
|
414030
414038
|
IntegrationProvider,
|
|
414031
414039
|
KycVerificationResult,
|