TRS

1.1

Get the abbreviation list of supported token

  • GET the list of token

Request URL

  • index.ts / getBoinNamesList

Parameters

Null

Return example

[
	'BTC','ETH','SOL','BNB',....
]
 

Return parameter description

string

Note

  • Returns a list of supported token abbreviations


1.2

Get the token price address

  • Get the price address by Token abbreviation

Requst URL

  • index.ts / getSelectBoinPubKeyByName

Parameters

Return example

 7VJsBtJzgTftYzEeooSDYyjKXvYRWJHdwvbwfBvTg9k

Return parameter description

Token address(string)

Note

  • The returned token address is string. It may need to be converted to PublicKey in future use. let publicKey = new PublicKey('7VJs....');


1.3

Get token abbreviation

  • Get token abbreviation from price address

Request URL

  • index.ts / getBoinNameByPublicKey

Parameters

Return example

SOL

Return parameter explain

Token name

Note

  • Token price address is string, PublickKey and string conversion, PublicKey uses toString()


### 1.4 ##### Add product

  • Launch token-pair products

Request URL

  • index.ts / addProduct

Parameters

Return example

	55p9eb2Rfs2SbQYGbz7hcrKZXsZshHP6trHtvDvRECrouYKaQfZHw7K7wFA5V9sGb1H7mi9JLvq6QMezLF96eMYW
 

Return result description

Return transaction sequence number of TransactionSignature successfully.

Failure will have an exception that can be caught by try catch

### 1.5 ##### Buy products

  • User Buy Products

Request URL

  • index.ts / buyTrs

Parameters

Return example

	55p9eb2Rfs2SbQYGbz7hcrKZXsZshHP6trHtvDvRECrouYKaQfZHw7K7wFA5V9sGb1H7mi9JLvq6QMezLF96eMYW
 

Return result description

Return transaction sequence number of TransactionSignature successfully.

Failure will have an exception that can be caught by try catch.

Note

  • usdcPayPubKey的owner should be wallet address, otherwise the signature will fail.


### 1.6 ##### Apply for settlement

  • After product clearing, users can apply for settlement

Request URL

  • index.ts / settleApply

Parameters

Return example

	55p9eb2Rfs2SbQYGbz7hcrKZXsZshHP6trHtvDvRECrouYKaQfZHw7K7wFA5V9sGb1H7mi9JLvq6QMezLF96eMYW
 

Return result description

Return transaction sequence number of TransactionSignature successfully.

Failure will have an exception that can be caught by try catch.

Note

  • productPubKey Product address must be the product purchased in orderPubKey order


### 1.7 ##### Get the product list

  • You can filter products by status. If the status is not transmitted, all products are queried by defaulte.

  • status 0:Raising and available for purchase 1:Established 2:Expired 3:Settled 4:Closed

Request URL

  • index.ts / getProductList

Parameters

Return example

[
	product1,product2,product3,....
]
 

Return parameter description

Product array of object 

Note

  • Product Object see the Product field table in appendix.


### 1.8 ##### Get order list - Orders can be screened according to product address and user address - If only all orders of users are checked, pass the product address as an empty string ''. - If only checking all orders of products, pass user address as empty string ''

Request URL

  • index.ts / getOrderList

Parameters

Return example

[
	order1,order2,order3,....
]
 

Return example description

Order object array

Note

-Order object see the Order field table in appendix


### 1.9 ##### Get account details

  • Returns account details based on the account address.

Request URL

  • index.ts / getAccountByKey

Parameters

Return example

[
	obj1,obj2,obj3,....
]
 

Return parameter description

Object array

Note

-Type1 Returns an array of product objects; 2 Returns an array of order objects. 3 Returns an array of basic account information

  • Type 1 returns array of Product objects. 2 Returns array of Order objects. 3 Returns array of BaseData


### Appendix ##### Account structure information

Product

Order

BaseData


Last updated