TRS
1.1
Get the abbreviation list of supported token
GET the list of token
Request URL
index.ts / getBoinNamesList
Parameters
Return example
Return parameter description
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
boinName
YES
string
Token abbreviation
Return example
Return parameter description
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
boinPublickey
Yes
string
Token price address
Return example
Return parameter explain
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
solanaProvider
YES
Object
solana wallet provider
connection
YES
Connection
solana connection
token_a_name
YES
string
a token name
token_b_name
YES
string
b token name
period
YES
number
Period (day)
raise_time
YES
number
Raise time( Accurate to seconds)
found_time
YES
number
Found time( Accurate to seconds)
price
YES
number
Unit price(u)
token_share
YES
number
Share
Return example
Return result description
### 1.5 ##### Buy products
User Buy Products
Request URL
index.ts / buyTrs
Parameters
solanaProvider
YES
Object
solana wallet provider
connection
YES
Connection
solana Connection
usdcPayPubKey
YES
PublicKey
usdc address
buyTokenName
YES
string
token name
buyShare
YES
number
share
productPubKey
YES
PublicKey
product address
Return example
Return result description
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
solanaProvider
yes
Object
solana wallet provider
connection
yes
Connection
solana connection
productPubKey
yes
PublicKey
product address of purchase
orderPubKey
yes
PublicKey
order address
Return example
Return result description
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
connection
yes
Connection
solana connection
status
No
number
Product Status
Return example
Return parameter description
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
connection
yes
Connection
solana connection
productPublickey
yes
string
products address pubkey into base58
userPublickey
yes
string
user address pubkey into base58
Return example
Return example description
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
connection
yes
Connection
solana connection
accountKey
yes
PublicKey
account address
type
是
number
Type: 1product 2order 3basic account information
Return example
Return parameter description
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
owner
string
owner address of product
token_a
string
tokan_a address
token_b
string
tokan_b address
period
number
product expiry
raise_time
number
raise time
found_time
number
establish time
due_time
number
expiry time
price
number
unit price (u )
fee
number
product total service fee (u/10^6)
token_a_share
number
share of a
token_b_share
number
share of b
buy_token_a_share
number
a raised shares
buy_token_b_share
number
b raised shares
clear_token_a_share
number
a settlement shares
clear_token_b_share
number
b settlement shares
found_token_a_price
number
a found unit price u
found_token_b_price
number
b found unit price u
due_token_a_price
number
a market price of expiry u
due_token_b_price
number
a market price of expiry u
exercise_a_price
number
a exercise price u
exercise_b_price
number
b exercise price u
status
number
status,0 initial state,waiting for investment or investing, 1 founded,2expired 3 settled 4 closed
product_pubkey
string
product address
Order
pro_pubkey
string
product address of purches
owner
string
owner address of order
pay_token_pubkey
string
users pay usdc address
buy_token
string
token address of product purchased
share
number
buy share
price
number
buy unit price u
token_price
number
payment amount u
token_fee
number
service fee of purchase u/10^6
buy_time
number
buy time
status
number
status 1 did not apply for settlement 2 has applied for settlement 3 settled
order_pubkey
string
order address
BaseData
owner
string
program owner address
raise_fund_pubkey
string
fund pubkey address
fee_account_pubkey
string
address of receive account of service fee
rate
number
fee rate rate/10000
basedata_pubkey
string
basic account address
Last updated