Skip to main content
This tutorial walks you through creating a developer-controlled wallet to sign transactions on NEAR.

Prerequisites

Before you begin:

Step 1. Create NEAR wallets

When creating a developer-controlled wallet, pass NEAR-TESTNET or NEAR in the blockchains field. This wallet can be used to sign transactions on NEAR. The following example code shows how to create a wallet using the Circle Developer SDK.
You must send NEAR tokens to activate the wallet. Without NEAR tokens in the wallet, you will receive an error stating that the account does not exist when broadcasting a transaction.
Use count to specify the number of wallets to create, up to a maximum of 200 per API request.

Step 2. Build and sign a raw transaction

To build a raw transaction for signing in JavaScript:
  1. Prepare the transaction object - To build a NEAR transaction, you must define several parameters, including the sender, receiver, amount, actions, nonce, and any additional metadata required.
  2. Serialize the transaction object with Borsh and encode it with Base64 - NEAR uses Borsh serialization for transaction objects, so you need to serialize the constructed transaction and then encode it to Base64 before signing.
The following example code shows how to build a raw transaction for signing.