Retrieves a wallet for the user. If the wallet does not exist, it will be created.
Notes:
Sample code if using the default Fireblocks NCW signer:
const wallet = await crossmint.getOrCreateWallet({
email: " ",
}, {
chain: "ethereum",
signer: {
type: "FIREBLOCKS_NCW",
passphrase: "xxxx",
},
}).catch((e) => {
if (e instanceof PassphraseRequiredError) {
// Ask user for passphrase and call again
return;
}
console.error("Failed to get or create wallet", e);
});
@param user Identifier for the user whose wallet to retrieve
@param chain The blockchain for which to retrieve the wallet. A wallet instance can on one chain only, but you can retrieve multiple wallet instances for different chains.
@param walletConfig Configuration related to wallet initialization.
@returns A Wallet instance corresponding to the given user and chain.
@throws PassphraseRequiredError if a passphrase is needed to create a wallet, or to recover it
Static
initInitializes the SDK with the project ID and API key obtained from the Crossmint console.
error if the project ID or API key are not properly formatted
Generated using TypeDoc
Base SDK class
This function is meant to be intiialized with the
init()
method. Then the instance can be used to create wallets, send transactions, etc.