galacticcouncil / sdk

Galactic SDK
Apache License 2.0
9 stars 15 forks source link

Respect tradeable flag in Omnipool #7

Open mrq1911 opened 1 year ago

mrq1911 commented 1 year ago

functions that are enabled to do with asset is stored in tradable bit flags https://apidocs.bsx.fi/HydraDX/pallets/Omnipool/storage/Assets

hub asset (LRNA) has these flags stored in: https://apidocs.bsx.fi/HydraDX/pallets/Omnipool/storage/HubAssetTradability

these bitflags can be transformed using the WASM to the following permissions:

export function is_sell_allowed(a: number): number;
export function is_buy_allowed(a: number): number;
export function is_add_liquidity_allowed(a: number): number;
export function is_remove_liquidity_allowed(a: number): number;

buy / sell should be disabled accorg to these permissions