Skip to main content
1

Add WalletKit to your app

Get your SDK setup as usual using Get Started.
2

Authenticate to WalletKit

Get your SDK authenticated or get the API key if server-side app follwoing Authentication guide.
3

Obtain user pincode

In your app, ask the user for a 6-digit pincode. This pincode will be used to encrypt the user’s share of the signing key.
You must never store the user pin on your servers.
4

Create gasless smart contract wallet

Create a wallet with the userPin and controlMode set to user.
const createWalletResp = await wk.wallets.create({
    network: Network.Base,
    name: "<walelt name>",
    ownerId: userId, // optional
    controlMode: WalletControlMode.User,
    type: WalletType.Contract,
    userPin: "<user pin>",
});

if (!createWalletResp.ok) {
// handle error
}

const smartContractWalletAddress = createWalletResp.body.address;
curl --request POST \
  --url https://testnet.walletkit.com/wallets \
  --header 'X-WalletKit-Project-ID: <Project ID>' \
  --header 'Authorization: Bearer <User Access Token or Your API Key>' \
  --data 
  '{
    "network": "Base",
    "name": "<wallet name>",
    "owner_id": "<user id>",
    "control_mode": "user",
    "type": "contract",
    "user_pin": "<user pin>"
  }'
ownerId is automatically set to the user id when authenticated with email login, you can safely ignore it in this case. If you are making server-side requests using your API Key, you can optionally set the owner id to a user id corresponding to your authentication system.