Using multiple accounts
Summary
const maker = await Maker.create({
url: 'http://localhost:2000',
accounts: {
other: {type: privateKey, key: someOtherKey},
default: {type: privateKey, key: myKey}
}
});
await maker.addAccount('yetAnother', {type: privateKey, key: thirdKey});
const cdp1 = await maker.openCdp(); // owned by "default"
maker.useAccount('other');
const cdp2 = await maker.openCdp(); // owned by "other"
maker.useAccount('yetAnother');
const cdp3 = await maker.openCdp(); // owned by "yetAnother"
await maker.addAccount({type: privateKey, key: fourthAccount.key}); // the name argument is optional
maker.useAccountWithAddress(fourthAccount.address);
const cdp4 = await maker.openCdp(); //owned by the fourth accountAccount types
Hardware wallets
Demo
Last updated