Skip to main content

Playground

Want to give it a in-browser spin, now you can. Type in your code and press the Run button and you should be set to go.

Live Editor
Loading...
A note on the account paying for these transactions

Please be considerate with the transactions that you run as to also give others the opportunity to play and learn. By default, the session will be operated by unknown on the unknown network. We strive to keep a working balance on it, but if we can't keep up with the usage, you might experience failed transactions due to insufficient funds. If this happens you can also use your own hedera account to pay for them. Hedera's Portal is the best and easiest way to start out in this scenario.

Once available, you can create a session using your account like so:

const { session } = await ApiSession.default({
wallet: {
sdk: {
operatorId: <Your operator account id>
operatorKey: <Your operator private key>
}
},
network: {
name: "testnet" / "previewnet" / "customnet"
}
});

To find out more configuration options, head over to our configuration page.