NFT Staking

Create approve NFT collection tx

POST https://api.hotcross.com/nft-staking/collections/{collectionAddress}/tx/approve

Path Parameters

NameTypeDescription

collectionAddress*

String

The smart contract of the collection to approve on

Request Body

NameTypeDescription

user*

String

The user account

targetAddress*

String

The address of the user is adding approval for

chainId*

Number

The chain id of the blockchain you want to read the pools from

Ethereum: 1

BNB Smart Chain: 56

Avalanche C-Chain: 43114

{
  "data": "string",
  "gas": 0
}

Responses:

  • data - string: The call data of the transaction can be empty for simple value transfers

  • gas - number: The gas provided by the transaction

Postman example

Create a deposit NFT tx

POST https://api.hotcross.com/nft-staking/{poolAddress}/{pid}/tx/deposit

Path Parameters

NameTypeDescription

poolAddress*

String

The smart contract address of the staking pool

pid*

Number

The pid of the staking pool

Request Body

NameTypeDescription

user*

String

The user account

tokenIds*

[string]

An array of the tokenIds the user wants to deposit

amounts*

[string]

An array of the amounts the user wants to deposit. Must be 1-1 with tokenIds

chainId*

Numer

The chain id of the blockchain you want to read the pools from

Ethereum: 1

BNB Smart Chain: 56

Avalanche C-Chain: 43114

{
  "data": "string",
  "gas": 0
}

Responses:

  • data - string: The call data of the transaction can be empty for simple value transfers

  • gas - number: The gas provided by the transaction

Create a withdraw NFT tx

POST https://api.hotcross.com/nft-staking/{poolAddress}/{pid}/tx/withdraw

Path Parameters

NameTypeDescription

poolAddress*

String

The smart contract address of the staking pool

pid*

Number

The pid of the staking pool

Request Body

NameTypeDescription

user*

String

The user account

tokenIds*

[String]

An array of the tokenIds the user wants to withdraw

amounts*

[String]

An array of the amounts the user wants to withdraw. Must be 1-1 with tokenIds

chainId*

Number

The chain id of the blockchain you want to read the pools from

Ethereum: 1

BNB Smart Chain: 56

Avalanche C-Chain: 43114d

{
  "data": "string",
  "gas": 0
}

Responses:

  • data - string: The call data of the transaction can be empty for simple value transfers

  • gas - number: The gas provided by the transaction

Create a claim reward tx

POST https://api.hotcross.com/nft-staking/{poolAddress}/{pid}/tx/claim-rewards

Path Parameters

NameTypeDescription

poolAddress*

String

The smart contract address of the staking pool

pid*

Number

The pid of the staking pool

Request Body

NameTypeDescription

user*

String

The user account

chainId*

Number

The chain id of the blockchain you want to read the pools from

Ethereum: 1

BNB Smart Chain: 56

Avalanche C-Chain: 43114

{
  "data": "string",
  "gas": 0
}

Responses:

  • data - string: The call data of the transaction can be empty for simple value transfers

  • gas - number: The gas provided by the transaction

Postman example

Read user data for an NFT pool from the blockchain

POST https://api.hotcross.com/nft-staking/{poolAddress}/{pid}/call/user-data

Path Parameters

NameTypeDescription

poolAddress*

String

The smart contract address of the reward pool

pid*

Number

The pid of the staking pool

Request Body

NameTypeDescription

user*

String

The user account

chainId*

Number

The chain id of the blockchain you want to read the pools from

Ethereum: 1

BNB Smart Chain: 56

Avalanche C-Chain: 43114

{
  "amount": "string",
  "lastDepositBlock": "string"
}

Responses:

  • amount - string: The staked NFTs amount

  • lastDepositBlock - string: The last block the user made a deposit. Used for the unstake delay time calculation

Postman example

Read user's pending rewards from the blockchain

POST https://api.hotcross.com/nft-staking/{poolAddress}/{pid}/call/pending-rewards

Path Parameters

NameTypeDescription

poolAddress*

String

The smart contract address of the reward pool

pid*

Number

The pid of the staking pool

Headers

NameTypeDescription

Accept*

String

application/json

Content-Type*

String

application/json

Request Body

NameTypeDescription

user*

String

The user account

chainId*

Number

The chain id of the blockchain you want to read the pools from

Ethereum: 1

BNB Smart Chain: 56

Avalanche C-Chain: 43114

"string"

Responses:

  • "string": the pending rewards

Postman example

Last updated