NEAR Sub-Account

In NEAR, users can register named accounts (e.g. bob.near) which are simpler to use and remember.

Named accounts can create sub-accounts of themselves, helping to better organize related-accounts. In this way, named accounts work as domains, particularly:

  1. Only registrar can create short top-level accounts (e.g. near, aurora).

  2. Anyone can create long top-level accounts, e.g. verylongaccountnamethatis32chars.

  3. near can create bob.near, and bob.near can create app.bob.near.

  4. near cannot create app.bob.near, and test.near cannot create sub.example.near.

Create a Near Sub-Account for NFT smart contract

API Doc

Swagger Doc | ReDoc

Curl call example

curl -X POST "http://0.0.0.0:7000/v2/nftkit/nft/near/chain/{chain}/account/create"
-H  "Content-Type: application/json"
-d "{"account_id": "string","newAccountId": "string","amount": "string"}"

Path parameters:

  • chain : [string] chain to work with. Either testnet or mainnet .

Body Details:

{
  "account_id": "string",
  "newAccountId": "string",
  "amount": "string"
}

Body parameters:

  • account_id : Top-level account.

  • newAccountId : New Sub-account.

  • amount : Number of Near tokens to transfer to the sub-account.

Example:

curl -X POST "http://0.0.0.0:7000/v2/nftkit/nft/near/chain/testnet/account/create"
-H  "Content-Type: application/json"
-d "{"account_id": "waltid.testnet","newAccountId": "nft.waltid.testnet","amount": "4"}"

Last updated