testnet
:v0.naps.testnet
https://explorer.testnet.near.org/accounts/naps.testnetmainnet
:naps.near
https://explorer.mainnet.near.org/accounts/naps.near
methods:
new
execute
add_owner
remove_owner
is_owner
get_owners
verify_msg
verify_hashed_msg
method: new
owner_id
: string - the account_id of who will own the contract
Has no returns.
{
}
method: execute
context
: the call context.contract_call
: the contract call context.contract_id
: string - the contract's AccountId that is being called.method_name
: string - the name of the method being called.args
: string - the arguments for the method that is being called.
tag_info
: the tags information.app_id
: string - app tag.action_id
: string - action number.user_id
: string - user account_id tag.
result
- the same return thatcontract_id
's methodmethod_name
withargs
would return.
{
"context": {
"contract_call": {
"contract_id": "nft.naps.testnet",
"method_name": "nft_transfer_from",
"args": "\"token_id\": \"1\", \"sender_id\": \"my-account.testnet\", \"receiver_id\": \"my-friend.testnet\", \"approval_id\": \"4711\""
}
}
}
methods:
add_owner
remove_owner
is_owner
get_owners
method: add_owner
owner_id
: string - the account_id of who will also own the contract
added
: boolean - whether the account was newly added as an owner.
{
}
method: remove_owner
owner_id
: string - the account_id of who will stop owning the contract
removed
: boolean - whether the account was just removed as an owner.
{
}
method: is_owner
owner_id
: string - the account_id which the owning status is being checked
is_owner
: boolean - whether the account is an owner.
{
}
method: get_owner
No parameters required.
owners
: string[] - list of account_ids of the owners.
{
}
method: verify_msg
sign
: string - the signature, in base58. Can be aEd25519
or aSecp256k1
signature.pubkey
: string - the public key, in base58 with an optional{header}:
as prefix. Can be aEd25519
or aSecp256k1
public key. On a missing prefix,ed25519:
is assumed.msg
: string - the message. It will be hashed internally by the contract.
is_match
: boolean - whether the sha256 hash of themsg
matched thepubkey
on thesign
.
{
"sign": "26gFr4xth7W9K7HPWAxq3BLsua8oTy378mC1MYFiEXHBBpeBjP8WmJEJo8XTBowetvqbRshcQEtBUdwQcAqDyP8T",
"pubkey": "ed25519:AYWv9RAN1hpSQA4p1DLhCNnpnNXwxhfH9qeHN8B4nJ59",
"msg": "message"
}
method: verify_hashed_msg
sign
: string - the signature, in base58. Can be aEd25519
or aSecp256k1
signature.pubkey
: string - the public key, in base58 with an optional{header}:
as prefix. Can be aEd25519
or aSecp256k1
public key. On a missing prefix,ed25519:
is assumed.msg_hash
: number[] - the message hash, in a 32-sized array of bytes, resulted from a sha256 hash of them message.
is_match
: boolean - whether themsg_hash
matched thepubkey
on thesign
.
{
"sign": "26gFr4xth7W9K7HPWAxq3BLsua8oTy378mC1MYFiEXHBBpeBjP8WmJEJo8XTBowetvqbRshcQEtBUdwQcAqDyP8T",
"pubkey": "ed25519:AYWv9RAN1hpSQA4p1DLhCNnpnNXwxhfH9qeHN8B4nJ59",
"msg_hash": [171, 83, 10, 19, 228, 89, 20, 152, 43, 121, 249, 183, 227, 251, 169, 148, 207, 209, 243, 251, 34, 247, 28, 234, 26, 251, 240, 43, 70, 12, 109, 29]
}
testnet
: ``mainnet
: ``
methods:
new
create_account
method: new
owner_id
: string - owner account id that will be allowed to make other calls into this contract
Has no returns.
{
}
note: not tested.
method: create_account
new_account_id
: string - the account_id that is being creatednew_public_key
: optional string - the new account owner public key, in base58 with an optional{header}:
as prefix. Can be aEd25519
or aSecp256k1
public key. On a missing prefix,ed25519:
is assumed. This value may be generated by the user. If missing, defaults to the transaction signer's public key.
account_created
: boolean - whether the account was successfully created.
{
}
Contract Address:
testnet
:nft.naps.testnet
https://explorer.testnet.near.org/accounts/nft.naps.testnetmainnet
:nft.naps.near
not yet deployed
methods:
new
new_default_meta
nft_mint
nft_transfer
nft_transfer_call
nft_token
nft_approve
nft_revoke
nft_revoke_all
nft_is_approved
nft_total_supply
nft_tokens
nft_supply_for_owner
nft_tokens_for_owner
nft_metadata
nft_series_create
nft_series_mint
nft_series_get
nft_series_get_minted_tokens_vec
nft_series_set_mintable
nft_series_set_capacity
method: new
owner_id
: string - the account_id of who will own the contractmetadata
: object - the standard nft metadataspec
: stirng - eg. "nft-1.0.0"name
: string - eg. "Mosaics"symbol
: string - eg. "MOSIAC"icon
: optional string - data URLbase_uri
: optional string - centralized gateway known to have reliable access to decentralized storage assets referenced byreference
ormedia
URLsreference
: optional string - URL to a JSON file with more inforeference_hash
: optional string - base64-encoded sha256 hash of JSON from reference field. Required ifreference
is included.
Has no returns.
{
}
{
}
method: new_default_meta
owner_id
: string - the account_id of who will own the contract
Has no returns.
{
}
{
}
method: nft_mint
token_id
: string - the name of the token. Cannot contain the series delimiter (:
).token_owner_id
: string - the account_id of who will receive the token.token_metadata
: object - the standard nft token metadata.title
: optional string - the title of the token, eg. "Arch Nemesis: Mail Carrier" or "Parcel #5055".description
: optional string - free-form description.media
: optional string - URL to associated media, preferably to decentralized, content-addressed storage.media_hash
: optional stirng - Base64-encoded sha256 hash of content referenced by themedia
field. Required ifmedia
is included.copies
: optional string - number of copies of this set of metadata in existence when token was minted.issued_at
: optional string - ISO 8601 datetime when token was issued or minted.expires_at
: optional string - ISO 8601 datetime when token expires.starts_at
: optional string - ISO 8601 datetime when token starts being valid. -updated_at
: optional string - ISO 8601 datetime when token was last updated.extra
: optional string - anything extra the NFT wants to store on-chain. Can be stringified JSON.reference
: optional string - URL to an off-chain JSON file with more info.reference_hash
: optional string - Base64-encoded sha256 hash of JSON from reference field. Required ifreference
is included.
token
: object - the standard nft token information.
{
}
{
}
methods:
nft_transfer
nft_transfer_call
nft_token
nft_resolve_transfer
nft_approve
nft_revoke
nft_revoke_all
nft_is_approved
nft_total_supply
nft_tokens
nft_supply_for_owner
nft_tokens_for_owner
nft_metadata
method: nft_transfer
token_id
: string - the token id to give allowance on.receiver_id
: string - the account to allow token transfer.approval_id
: optional number - the approval id fromnft_approve_from
.memo
: optional string.
{
"token_id": "1",
"receiver_id": "my-friend.testnet"
}
success
: bool - was the transfer successful or not
curl --location --request POST 'https://api.nearapps.net/testnet/v1/execute' \
--header 'x-api-key: <api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "{\"contract_id\":\"nft.naps.testnet\",\"method_name\":\"nft_transfer_from\",\"args\": \"{\"token_id\":\"1\",\"sender_id\":\"my-account.testnet\", \"receiver_id\":\"my-friend.testnet\"}\",
"signed": {
"signature": "4FJecZiY22ReWiJHxCSjDw71Jyd8WVgkkeNfH1Zj21uhQEV1c7QQ4bQYc7QMgH3Tcz5LxYJMxPYuHoETN8i4sQNq",
"publicKey": "ed25519:D5d84XpgHtTUHwg1hbvT3Ljy6LpeLnJhU34scBC1TNKp"
}
}'
method: nft_transfer_call
token_id
: string - the token id to give allowance onreceiver_id
: string - the account to allow token transfer
{
"token_id": "1",
"receiver_id": "my-friend.testnet"
}
success
: bool - was the transfer successful or not
curl --location --request POST 'https://api.nearapps.net/testnet/v1/execute' \
--header 'x-api-key: <api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "{\"contract_id\":\"nft.naps.testnet\",\"method_name\":\"nft_transfer_from\",\"args\": \"{\"token_id\":\"1\",\"sender_id\":\"my-account.testnet\", \"receiver_id\":\"my-friend.testnet\"}\",
"signed": {
"signature": "4FJecZiY22ReWiJHxCSjDw71Jyd8WVgkkeNfH1Zj21uhQEV1c7QQ4bQYc7QMgH3Tcz5LxYJMxPYuHoETN8i4sQNq",
"publicKey": "ed25519:D5d84XpgHtTUHwg1hbvT3Ljy6LpeLnJhU34scBC1TNKp"
}
}'
method: nft_approve
token_id
: string - the token id to give allowance onaccount_id
: string - the account to allow token transfermsg
: optional string.
{
"token_id": "1",
"account_id": "my-friend.testnet"
}
approval_id
: the id of the approval
curl --location --request POST 'https://api.nearapps.net/testnet/v1/execute' \
--header 'x-api-key: <api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "{\"contract_id\":\"nft.naps.testnet\",\"method_name\":\"nft_approve_from\",\"args\": \"{\"token_id\":\"1\",\"account_id\":\"my-friend.testnet\"}\"}",
"sender": "my-account.testnet",
"signed": {
"signature": "4FJecZiY22ReWiJHxCSjDw71Jyd8WVgkkeNfH1Zj21uhQEV1c7QQ4bQYc7QMgH3Tcz5LxYJMxPYuHoETN8i4sQNq",
"publicKey": "ed25519:D5d84XpgHtTUHwg1hbvT3Ljy6LpeLnJhU34scBC1TNKp"
}
}'
method: nft_is_approved
token_id
: string - the token id to check allowance onapproved_account_id
: string.approval_id
: optional number.
{
}
is_approved
: boolean - whether it is approved.
method: nft_revoke
token_id
: string - the token id to revoke allowance onaccount_id
: string - the account to disallow token transfer
{
"token_id": "1",
"account_id": "my-friend.testnet"
}
Has no returns.
curl --location --request POST 'https://api.nearapps.net/testnet/v1/execute' \
--header 'x-api-key: <api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "{\"contract_id\":\"nft.naps.testnet\",\"method_name\":\"nft_revoke_from\",\"args\": \"{\"token_id\":\"1\",\"account_id\":\"my-friend.testnet\"}\"}",
"sender": "my-account.testnet",
"signed": {
"signature": "4FJecZiY22ReWiJHxCSjDw71Jyd8WVgkkeNfH1Zj21uhQEV1c7QQ4bQYc7QMgH3Tcz5LxYJMxPYuHoETN8i4sQNq",
"publicKey": "ed25519:D5d84XpgHtTUHwg1hbvT3Ljy6LpeLnJhU34scBC1TNKp"
}
}'
method: nft_revoke
token_id
: string - the token id to revoke allowance on
{
"token_id": "1"
}
Has no return.
methods:
nft_series_create
nft_series_mint
nft_series_get
nft_series_get_minted_tokens_vec
nft_series_set_mintable
nft_series_set_capacity
method: nft_series_create
name
: string - the name of the token seriescapacity
: string - the maximum number of the of tokens that can be mintedcreator
: string - the account_id of the creator, used for informing
series_id
: string - a number representing the id of the created series.
{
}
{
}
method: nft_series_mint
series_id
: string - the series id numbertoken_owner_id
: string - the account_id of who will receive the token.token_metadata
: optional object - the standard nft token metadata.
token
: object - the standard nft token information.
{
}
{
}
method: nft_series_get
series_id
: string - the series id number
series
: object - nft series information.id
: string - the series id number,name
: stringcreator
: string - the account_id of the creatorlen
: string - the number of minted tokenscapacity
: string - the number of how many tokens can be mintedis_mintable
: boolean - whether the series can be minted
{
}
{
}
method: nft_series_get_minted_tokens_vec
series_id
: string - the series id number
token_ids
: string[] - a list containing the token_id number that were minted under the series.
{
}
{
}
method: nft_series_set_mintable
series_id
: string - the series id number.is_mintable
: boolean - choose whether it will be mintable or not.
Has no returns.
{
}
{
}
method: nft_series_set_capacity
series_id
: string - the series id number.capacity
: string - choose the number of what the capacity will be.
Has no returns.
{
}
{
}