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:
Only
registrarcan create short top-level accounts (e.g.near,aurora).Anyone can create long top-level accounts, e.g.
verylongaccountnamethatis32chars.nearcan createbob.near, andbob.nearcan createapp.bob.near.nearcannot createapp.bob.near, andtest.nearcannot createsub.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. Eithertestnetormainnet.
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"}"val accountId = "test.near"
val newAccountId = "test-sub.near"
val amount = "4"
val chain = "testnet"
val result = NearNftService.createSubAccount(accountId, newAccountId , amount , chain )
println("operation result: $result")Last updated
Was this helpful?
