Skip to content

Latest commit

 

History

History
268 lines (218 loc) · 5.92 KB

wallets.md

File metadata and controls

268 lines (218 loc) · 5.92 KB
  • title: Wallets API
  • date: 02-17-2024
  • single: true

Encrypted programmatic wallets for the Nano blockchain.

Free API Key required. Fair use and unlimited usage available.

Quick Links

Simple Usage

curl -d '{
  "action": "cloud_wallet",
  "refund_address": "YOUR_ADDRESS",
  "expire": "10 minutes",
  "key": "WALLET-API-KEY",
}' \
-H "Content-Type: application/json" \
"https://rpc.nano.to"

Response:

{
  "balance": 0,
  "address": "nano_1temp9dzx8kmkbcpedwi...4bzoh3pafk9grxndk88inkbe",
  "refund_address": "YOUR_ADDRESS",
  "expiration": "in 10 minutes",
  "expiration_unix": 1710873173,
  "qrcode": "data:image/png;base64.."
}

Available Options

Create Wallet:

  • refund_address (string or array) new wallets require refund_address.
  • seed: (string or bool) Return privateKey. Only provided once.
  • vanity: (string or bool) Generate vanity address. Up to 5 characters.
  • metadata (object or string) Attach metadata to wallet.
  • expire (number or string) Configure address expiration delay.

List All Wallets:

  • list: (string or bool) get all accounts.
  • limit: (integer) limit size of response array.
  • start: (integer) paginate response array.
  • search: (string) filter response array for specific wallet.
  • metadata: (object or string) filter response array by metadata.

Single Account Actions:

  • account: (string) get information about specific wallet.
  • balance: (bool) get wallet balance and pending.
  • receive: (bool) receive pending blocks for wallet.
  • send: (@username or address) send funds from wallet.
  • expire: (bool) manually expire wallet.

Create Wallet

curl -d '{
  "action": "cloud_wallet",
  "vanity": "1temp",
  "refund_address": "YOUR_ADDRESS",
  "expire": "10 minutes",
  "key": "WALLET-API-KEY",
  "metadata": { "userId": 1  }
}' \
-H "Content-Type: application/json" \
"https://rpc.nano.to"

Response:

{
  "balance": 0,
  "address": "nano_1temp9dzx8kmkbcpedwi...4bzoh3pafk9grxndk88inkbe",
  "refund_address": "YOUR_ADDRESS",
  "expiration": "in 10 minutes",
  "expiration_unix": 1710873173,
  "metadata": { "userId": 1 },
  "qrcode": "data:image/png;base64.."
}

List Wallets

curl -d '{
  "action": "cloud_wallet",
  "list": true,
  "metadata": { "userId": 1 }
  "key": "WALLET-API-KEY",
}' \
-H "Content-Type: application/json" \
"https://rpc.nano.to"

Response:

[
  {
    "balance": 0,
    "address": "nano_1temp9dzx8kmkbcpedwi...4bzoh3pafk9grxndk88inkbe",
    "refund_address": "YOUR_ADDRESS",
    "expiration": "in 10 minutes",
    "expiration_unix": 1710873173,
    "metadata": { "userId": 1 }
  }
]

Receive Funds

curl -d '{
  "action": "cloud_wallet",
  "receive": true,
  "account": "nano_1temp9dzx8kmkbcpedwi...4bzoh3pafk9grxndk88inkbe",
  "key": "WALLET-API-KEY",
}' \
-H "Content-Type: application/json" \
"https://rpc.nano.to"

Response:

[
  {
    "hash": "533A1D3F0DD7B4138493...7085DDE0DE175ACCCA6412",
    "amount": "1000000000000000000000000000000",
    "amount_nano": "1",
    "source": "nano_1bank1q3q7x8ri....8kggtfaosg8kyr51qsdkm8g45",
    "username": "@bank"
  }
]

Get Balance

curl -d '{
  "action": "cloud_wallet",
  "balance": "true",
  "account": "nano_1temp9dzx8kmkbcpedwi...4bzoh3pafk9grxndk88inkbe",
  "key": "WALLET-API-KEY",
}' \
-H "Content-Type: application/json" \
"https://rpc.nano.to"

Response:

{
  "balance": "90000000000000000000000000",
  "pending": "0",
  "receivable": "0",
  "balance_nano": "0.00009",
  "pending_nano": "0",
  "receivable_nano": "0",
  "address": "nano_1cxmn9dzx8kmkbcpedwi...4bzoh3pafk9grxndk88inkbe",
  "expiration": "in 3 months",
  "expiration_unix": 1710873173
}

Send Funds

curl -d '{
  "action": "cloud_wallet",
  "send": "@bank",
  "amount": "0.00001",
  "account": "nano_1temp9dzx8kmkbcpedwi...4bzoh3pafk9grxndk88inkbe",
  "key": "WALLET-API-KEY",
}' \
-H "Content-Type: application/json" \
"https://rpc.nano.to"

Response:

{ 
  "hash": "652B9EFBE95C8E5495...ECEE337CE27514B2226"
}

Expire Wallet

curl -d '{
  "action": "cloud_wallet",
  "delete": "true",
  "account": "nano_1temp9dzx8kmkbcpedwi...4bzoh3pafk9grxndk88inkbe",
  "key": "WALLET-API-KEY",
}' \
-H "Content-Type: application/json" \
"https://rpc.nano.to"

Response:

{ 
  "deleted": true
}

Profit Sharing

Refund_address accepts an array. When wallet expires, funds are sent equally between configured accounts.

curl -d '{
  "action": "cloud_wallet",
  "refund_address": ["@faucet", "@bank"],
  "expire": "5 minutes",
  "key": "WALLET-API-KEY",
}' \
-H "Content-Type: application/json" \
"https://rpc.nano.to"

Rate Limit

Staying true to Nano's feeless architecture, this API does not charge a 'service fee' per transaction.

Instead we use prepaid RPC Credits when your usage exceeds free plan.

Free Forever Plan:

  • 30 API calls / Minute
  • Up to 100 Wallets
  • Expiration Required

Prepaid Plan (RPC Credits):

  • Unlimited API calls / Minute
  • Unlimited Wallets
  • Expiration Optional

Purchase RPC Credits any time with your API key or email.

Nano.to Support