importWallet
Imports a wallet from one chain into another
This function imports a wallet from one chain (e.g. BSC, MATIC or ETHEREUM) into another
1
signer.importWallet({
2
walletId: '71dec640-4eb8-4321-adb8-b79461573fc4',
3
to: 'MATIC',
4
})
Copied!
​

Signature

1
signer.importWallet(request: ImportWalletRequest): Promise<SignerResult>
Copied!

Returns

1
Promise<SignerResult>
Copied!

Parameters

importWalletRequest
True
The import request you want to execute. For more info on how this request should look like, see importWalletRequest.

Example

1
const signer = venlyConnect.createSigner();
2
​
3
signer.importWallet({
4
walletId: '71dec640-4eb8-4321-adb8-b79461573fc4',
5
to: 'MATIC',
6
}).then((signerResult) => {
7
if (signerResult.success) {
8
console.log(`Wallet 71dec640-4eb8-4321-adb8-b79461573fc4 has successfully been imported into ${signerResult.result.chain} and has id ${signerResult.result.id}`);
9
} else {
10
console.warn(`Something went wrong while importing the wallet`);
11
}
12
}).catch((reason) => {
13
console.log(error);
14
});
Copied!
​