Manage your developer wallet
Your game's own programmatic wallet
In addition to managing user wallets to trigger payments, you can use your developer account to manage your own wallet.
Before this tutorial
Make sure you've already read 👉 getting-started
Steps
Get your organization's token authToken
authToken
First log into your developer dashboard: https://dashboard.handcash.io
Then navigate to 'Wallet'. Select the menu on the right hand side, and click "Developer Access"
Your authToken
will be there. Grab it for the next step.
Trigger payments from your wallet
Paste the authToken
in your code and you are ready to trigger payments from your wallet:
const {HandCashConnect} = require('@handcash/handcash-connect');
const handCashConnect = new HandCashConnect({
appId: '<app-id>',
appSecret: '<secret>',
});
const authToken = '<auth-token>';
const account = handCashConnect.getAccountFromAuthToken(authToken);
const paymentParameters = {
description: "Paying to myself!",
payments: [
{ destination: 'satoshi', currencyCode: 'USD', sendAmount: 0.10 },
]
};
const paymentResult = await account.wallet.pay(paymentParameters);
console.log(paymentResult);
Updated 7 months ago