@river-build/web3
Version:
Dapps for our Space and Registry contracts
50 lines • 2.32 kB
TypeScript
import { ContractTransaction, ethers } from 'ethers';
import { Address } from '../ContractTypes';
import { BaseChainConfig } from '../IStaticContractsInfo';
export declare const INVALID_ADDRESS = "0x0000000000000000000000000000000000000000";
export declare class WalletLink {
private readonly LINKED_WALLET_MESSAGE;
private readonly walletLinkShim;
private readonly eip712Domain;
address: Address;
constructor(config: BaseChainConfig, provider: ethers.providers.Provider | undefined);
isLinked(walletAddress: string): Promise<boolean>;
private assertNotLinked;
private assertLinked;
private generateRootKeySignatureForWallet;
private generateWalletSignatureForRootKey;
private generateRootKeySignatureForCallerData;
private generateLinkCallerData;
private generateLinkWalletData;
/**
* Link a wallet to the root key with the wallet as the caller
* @param rootKey
* @param wallet
*/
linkCallerToRootKey(rootKey: ethers.Signer, wallet: ethers.Signer): Promise<ContractTransaction>;
/**
* Link a wallet to the root key with the root key as the caller
*
* @param wallet
* @param rootKey
* @returns
*/
linkWalletToRootKey(rootKey: ethers.Signer, wallet: ethers.Signer): Promise<ContractTransaction>;
encodeLinkCallerToRootKey(rootKey: ethers.Signer, wallet: Address): Promise<string>;
encodeLinkWalletToRootKey(rootKey: ethers.Signer, wallet: ethers.Signer): Promise<string>;
parseError(error: any): Error;
getLinkedWallets(rootKey: string): Promise<string[]>;
getLinkedWalletsWithDelegations(rootKey: string): Promise<string[]>;
getRootKeyForWallet(wallet: string): Promise<string>;
checkIfLinked(rootKey: ethers.Signer, wallet: string): Promise<boolean>;
private generateRemoveLinkData;
removeLink(rootKey: ethers.Signer, walletAddress: string): Promise<ContractTransaction>;
/**
* Remove link from this caller to a root key
*/
removeCallerLink(caller: ethers.Signer): Promise<ContractTransaction>;
encodeRemoveLink(rootKey: ethers.Signer, walletAddress: string): Promise<string>;
private signTypedData;
getInterface(): import("@river-build/generated/dev/typings/IWalletLink").IWalletLinkInterface;
}
//# sourceMappingURL=WalletLink.d.ts.map