(string) - most protocols (BITCOIN, ETHEREUM, BSC, CELO, STELLAR, RIPPLE, HATHOR, AVAXCCHAIN,SOLANA) require a private key string.
(object) - the CARDANO protocol requires an object containing two different private keys
opts.privateKey.spendingPrivateKey (string) - private key used for spending operations
opts.privateKey.stakingPrivateKey (string) - private key used for staking operations
Example:
// using an existing private keyconstwallet=awaitsdk.wallet.generateWalletFromPrivateKey({ privateKey:'0x...', protocol:'BSC',})// for the cardano networkconstcardanoWallet=awaitsdk.wallet.generateWalletFromPrivateKey({ privateKey: { spendingPrivateKey:'0x...', stakingPrivateKey:'0x...', }, protocol:'CARDANO',})
sdk.wallet.generateWalletAddressFromXpub(opts)
Generate a wallet address from xpub for a blockchain protocol:
In a "for dummies" explanation, wallets are a prerequisite for interacting with the blockchain - whether sending values, creating NFTs, currencies or even interacting with blockchain "programs". Making a comparison with Web 2.0, it's like your login/password to perform actions.
Do not to confuse the creation of Cryptum wallets with existing wallets on the market, such as MetaMask, Phantom, TrustWallet and others. Cryptum allows the creation of the address and the private key without the need to create one of these wallets - however, you can use that same wallet created by importing the information into your preferred wallet.
And how do you apply wallets to your business?
You probably have a userbase and/or companies that will need to interact with the blockchain features, like described above.
Let's use a common example where "new users of an app need to have a wallet to receive and transfer tokens". When an approval or registration event happens in the back-end of your application, Cryptum must be called to create a wallet for this new user - 1 or N wallets. The wallet will be created, the private key will be sent to your application and the management will be done by you or your end user.
Business definitions must be created by you - Cryptum is fully prepared to generate the wallets and private keys.
As previously informed, Cryptum doesn't keep and doesn't have access to any generated Private Key. Cryptum also does not advise clients to keep end users' keys.
โIntegrating Wallets creation with Cryptum SDK
Step 1
The first prerequisite you will need is the creation of an account and a Project (API Key) on Cryptum Dashboard.
To do so, access our Dashboardand create a DEV-type Project.
Step 2
With a valid Cryptum API Key, you can then instantiate the SDK as follows: