@reyaxyz/common 0.341.0 → 0.343.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/trading-api-types.js.map +1 -1
- package/dist/transactions/abis/OFT.json +201 -0
- package/dist/transactions/abis/Periphery.json +233 -0
- package/dist/transactions/index.js +3 -1
- package/dist/transactions/index.js.map +1 -1
- package/dist/types/trading-api-types.d.ts +8 -0
- package/dist/types/trading-api-types.d.ts.map +1 -1
- package/dist/types/transactions/index.d.ts +1 -0
- package/dist/types/transactions/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/calculate.d.ts +32 -1
- package/dist/types/utils/calculate.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/layerzero/index.d.ts +3 -0
- package/dist/types/utils/layerzero/index.d.ts.map +1 -0
- package/dist/types/utils/layerzero/oft-config.d.ts +4 -0
- package/dist/types/utils/layerzero/oft-config.d.ts.map +1 -0
- package/dist/types/utils/layerzero/types.d.ts +23 -0
- package/dist/types/utils/layerzero/types.d.ts.map +1 -0
- package/dist/types/utils/token/token-info.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/calculate.js +69 -2
- package/dist/utils/calculate.js.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/layerzero/index.js +19 -0
- package/dist/utils/layerzero/index.js.map +1 -0
- package/dist/utils/layerzero/oft-config.js +29 -0
- package/dist/utils/layerzero/oft-config.js.map +1 -0
- package/dist/utils/layerzero/types.js +3 -0
- package/dist/utils/layerzero/types.js.map +1 -0
- package/dist/utils/token/token-info.js +64 -0
- package/dist/utils/token/token-info.js.map +1 -1
- package/package.json +2 -2
- package/src/trading-api-types.ts +11 -0
- package/src/transactions/abis/OFT.json +201 -0
- package/src/transactions/abis/Periphery.json +233 -0
- package/src/transactions/index.ts +1 -0
- package/src/types.ts +3 -0
- package/src/utils/calculate.ts +86 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/layerzero/index.ts +2 -0
- package/src/utils/layerzero/oft-config.ts +32 -0
- package/src/utils/layerzero/types.ts +25 -0
- package/src/utils/token/token-info.ts +64 -0
package/README.md
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
|
|
7
7
|
| Statements | Branches | Functions | Lines |
|
|
8
8
|
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
|
|
9
|
-
|  |  |  |  |
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trading-api-types.js","sourceRoot":"/","sources":["trading-api-types.ts"],"names":[],"mappings":";;;AAYa,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC","sourcesContent":["import { ParamsDictionary, Query } from 'express-serve-static-core';\nimport { AssetPair, CollateralPrice, MarketPrice } from './types';\nimport {\n AddressParam,\n ApiEndpoint,\n ApiInfiniteListEndpoint,\n ApiListEndpoint,\n Decimal,\n PaginatedQueryParams,\n Stringified,\n} from './api-types';\n\nexport const AccountStatusValues = {\n OPEN: 'OPEN',\n CLOSED: 'CLOSED',\n};\n\nexport type AccountStatus =\n (typeof AccountStatusValues)[keyof typeof AccountStatusValues];\n\ntype CandleResolution = '1' | '5' | '15' | '30' | '60' | '240' | '1D';\n\ntype Candle = {\n time: number;\n open: number;\n high: number;\n low: number;\n close: number;\n assetPairId: AssetPair;\n resolution: CandleResolution;\n};\n\ntype Order = {\n id: string;\n market_id: Decimal | null;\n account_id: Decimal | null;\n executed_base: Decimal | null;\n fee: Decimal | null;\n price: Decimal | null;\n is_match_order: boolean | null;\n liquidation_type: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n event_sequence_number: bigint | null;\n exchange_id: Decimal | null;\n created_at: Date;\n counterparty_account_id: Decimal | null;\n counterparty_adl_unwind_price: Decimal | null;\n counterparty_average_entry_funding_value: Decimal | null;\n counterparty_base: Decimal | null;\n counterparty_base_multiplier: Decimal | null;\n counterparty_funding_value: Decimal | null;\n counterparty_last_price: Decimal | null;\n counterparty_last_price_timestamp: Decimal | null;\n counterparty_realized_pnl: Decimal | null;\n counterparty_session: Decimal | null;\n position_adl_unwind_price: Decimal | null;\n position_average_entry_funding_value: Decimal | null;\n position_base: Decimal | null;\n position_base_multiplier: Decimal | null;\n position_funding_value: Decimal | null;\n position_last_price: Decimal | null;\n position_last_price_timestamp: Decimal | null;\n position_realized_pnl: Decimal | null;\n position_session: Decimal | null;\n referrer_account_id: Decimal | null;\n referrer_fee_credit: Decimal | null;\n};\n\ntype Position = {\n market_id: Decimal;\n account_id: Decimal;\n base: Decimal | null;\n realized_pnl: Decimal | null;\n last_price: Decimal | null;\n last_price_timestamp: Decimal | null;\n funding_value: Decimal | null;\n base_multiplier: Decimal | null;\n adl_unwind_price: Decimal | null;\n average_entry_funding_value: Decimal | null;\n session: Decimal | null;\n exchange_id: Decimal | null;\n event_sequence_number: bigint | null;\n referrer_account_id: Decimal | null;\n referrer_fee_credit: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n adjusted_base: Decimal | null;\n adl_realized_pnl: Decimal | null;\n};\n\ntype ConditionalOrder = {\n id: string;\n account_id: Decimal;\n market_id: Decimal;\n order_type: string;\n is_long: boolean;\n trigger_price: number;\n order_base: Decimal;\n status: string;\n creation_timestamp_ms: bigint;\n last_update_timestamp_ms: bigint;\n transaction_hash: string | null;\n};\n\ntype ConditionalOrderSensitive = ConditionalOrder & {\n exchange_id: bigint;\n inputs: string;\n counterparty_account_id: bigint;\n reya_chain_id: bigint;\n deadline: bigint;\n signer_address: string;\n nonce: Decimal;\n signature: string;\n};\n\ntype Market = {\n id: Decimal;\n assetPairId: AssetPair;\n ticker: string;\n isActive: boolean;\n maxLeverage: number;\n description: string;\n name: string;\n tickSizeDecimals: number;\n priority: number;\n underlyingAssetId: string;\n quoteTokenId: string;\n};\n\ntype Account = {\n account_id: Decimal;\n name: string;\n status: AccountStatus;\n updated_timestamp_ms: Decimal;\n source: string | null;\n};\n\ntype AccountBalance = {\n account_id: Decimal | null;\n collateral: string | null;\n balance?: Decimal | null;\n delta?: Decimal | null;\n};\n\ntype spot_execution = {\n account_id: Decimal;\n counterparty_account_id: Decimal;\n exchange_id: Decimal;\n executed_base: Decimal;\n price: Decimal;\n account_order_id: bigint;\n counterparty_order_id: bigint;\n spot_market_id: Decimal;\n is_auto_exchange: boolean;\n is_long: boolean;\n event_sequence_number: bigint;\n parent_event_sequence_number: bigint | null;\n block_timestamp: Decimal;\n block_number: Decimal;\n transaction_hash: string;\n created_at: string;\n};\n\ntype account_real_balance = {\n account_id: Decimal;\n collateral: string;\n balance: Decimal;\n rpnl: Decimal;\n event_sequence_number: bigint | null;\n transfer_event_sequence_number: bigint | null;\n parent_event_sequence_number: bigint | null;\n block_timestamp: Decimal;\n block_number: Decimal;\n transaction_hash: string;\n};\n\ntype AutoExchange = {\n id: string;\n liquidated_account_id: Decimal | null;\n liquidator_account_id: Decimal | null;\n requested_quote_amount: Decimal | null;\n collateral_out_address: string | null;\n collateral_in_address: string | null;\n collateral_amount_to_liquidator: Decimal | null;\n quote_amount_to_insurance_fund: Decimal | null;\n quote_amount_to_account: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n transaction_hash: string;\n unique_id: bigint | null;\n};\n\ntype Leverage = {\n accountId: Decimal;\n marketId: Decimal;\n leverage: number;\n createdAt: Date;\n updatedAt: Date;\n};\n\ntype WalletStats = {\n volume_14d: Decimal;\n};\n\ntype MarketData = {\n marketId: string;\n updatedAt: number;\n longOI: number;\n shortOI: number;\n longSkewPercentage: number;\n shortSkewPercentage: number;\n openInterest?: number;\n fundingRate?: number;\n fundingRateVelocity?: number;\n longFundingValue?: number;\n shortFundingValue?: number;\n last24hVolume: number;\n priceChange24H?: number;\n priceChange24HPercentage?: number;\n maxAmountBaseLong?: number;\n maxAmountSizeLong?: number;\n maxAmountBaseShort?: number;\n maxAmountSizeShort?: number;\n oraclePrice?: number;\n poolPrice?: number;\n pricesUpdatedAt?: number;\n longBaseMultiplier?: number;\n shortBaseMultiplier?: number;\n longAdlUnwindPrice?: number;\n shortAdlUnwindPrice?: number;\n depthFactor?: number;\n priceSpread?: number;\n logPriceMultiplier?: number;\n};\n\ntype SpotMarketData = {\n spotMarketId: string;\n symbol: string;\n updatedAt: number;\n volume24h: number;\n pxChange24h?: number;\n oraclePrice?: number;\n};\n\ntype MarketTrackers = {\n market_data_id: Decimal;\n passive_pool_id: Decimal | null;\n pool_account_id: Decimal | null;\n quote_token: string | null;\n quote_token_decimals: Decimal | null;\n last_funding_velocity: Decimal | null;\n last_funding_timestamp: Decimal | null;\n last_mtm_price: Decimal | null;\n last_mtm_timestamp: Decimal | null;\n long_trackers_funding_value: Decimal | null;\n last_funding_rate: Decimal | null;\n long_trackers_base_multiplier: Decimal | null;\n long_trackers_adl_unwind_price: Decimal | null;\n short_trackers_funding_value: Decimal | null;\n short_trackers_base_multiplier: Decimal | null;\n short_trackers_adl_unwind_price: Decimal | null;\n open_interest: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n price_spread: Decimal | null;\n depth_factor: Decimal | null;\n log_price_multiplier: Decimal | null;\n};\n\nexport type TradingApiReplication<\n ReplicationTable extends ReplicationModel = never,\n Replication = never,\n> = {\n replication: ReplicationTable extends never\n ? never\n : GenericReplicationMessage<Replication, ReplicationTable>;\n};\n\nexport type TradingApiEndpoint<\n Response,\n Params,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = never,\n> = ApiEndpoint<Response, Params, Query> &\n TradingApiReplication<ReplicationTable, Replication>;\n\nexport type TradingApiListEndpoint<\n Response,\n Params = never,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = never,\n> = ApiListEndpoint<Response, Params, Query> &\n TradingApiReplication<ReplicationTable, Replication>;\n\nexport type TradingApiInfiniteListEndpoint<\n Response,\n Params = never,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = PaginatedQueryParams,\n> = ApiInfiniteListEndpoint<Response, Params, Query> &\n TradingApiReplication<ReplicationTable, Replication>;\n\nexport type TradingApiSource = {\n 'poolBalance/:poolId': TradingApiEndpoint<\n {\n id: number;\n timestamp: bigint;\n pool_id: number;\n value: Decimal;\n apy: Decimal;\n share_price: Decimal;\n share_price_index: Decimal;\n } | null,\n {\n poolId?: string;\n }\n >;\n 'wallet/:address/leverages': TradingApiListEndpoint<\n Leverage,\n { address: string },\n 'accountLeveragePerMarket'\n >;\n markets: TradingApiListEndpoint<Market>;\n 'markets/data': TradingApiListEndpoint<MarketData, never, 'marketData'>;\n 'spotMarkets/data': TradingApiListEndpoint<\n SpotMarketData,\n never,\n 'spotMarketData'\n >;\n 'markets/configuration': TradingApiListEndpoint<{\n market_id: Decimal;\n risk_matrix_index: Decimal | null;\n max_open_base: Decimal | null;\n velocity_multiplier: Decimal | null;\n minimum_order_base: Decimal | null;\n base_spacing: Decimal | null;\n price_spacing: Decimal | null;\n oracle_node_id: string | null;\n mtm_window: Decimal | null;\n dutch_config_lambda: Decimal | null;\n dutch_config_min_base: Decimal | null;\n slippage_params_phi: Decimal | null;\n slippage_params_beta: Decimal | null;\n depth_factor: Decimal | null;\n max_exposure_factor: Decimal | null;\n max_p_slippage: Decimal | null;\n price_spread: Decimal | null;\n volatility_index_multiplier: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }>;\n 'markets/storage': TradingApiListEndpoint<{\n market_id: Decimal;\n quote_collateral: string | null;\n instrument_address: string | null;\n name: string | null;\n risk_block_id: Decimal | null;\n collateral_pool_id: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }>;\n 'markets/trackers': TradingApiListEndpoint<\n MarketTrackers,\n never,\n 'marketTrackers'\n >;\n 'market/:marketId/trackers': TradingApiEndpoint<\n MarketTrackers,\n {\n marketId: string;\n },\n 'marketTrackers'\n >;\n 'market/:marketId': TradingApiEndpoint<\n Market,\n {\n marketId: string;\n }\n >;\n 'market/:marketId/data': TradingApiEndpoint<\n MarketData,\n {\n marketId: string;\n },\n 'marketData'\n >;\n 'market/:marketId/trades': TradingApiInfiniteListEndpoint<\n Order,\n {\n marketId: string;\n },\n 'orders'\n >;\n 'wallet/:address/positions': TradingApiListEndpoint<\n Position,\n AddressParam,\n 'position',\n Omit<Position, 'adjusted_base' | 'adl_realized_pnl'>\n >;\n 'wallet/:address/openOrders': TradingApiListEndpoint<\n ConditionalOrder,\n AddressParam,\n 'ConditionalOrders'\n >;\n assets: TradingApiListEndpoint<{\n address: string;\n name: string;\n short: string;\n createdAt: Date;\n updatedAt: Date;\n asset_price_contract_id: string | null;\n asset_price_usdc_contract_id: string | null;\n decimals: number;\n }>;\n prices: TradingApiEndpoint<\n Partial<Record<AssetPair, MarketPrice | CollateralPrice>>,\n never\n >;\n 'prices/:assetPairId': TradingApiEndpoint<\n MarketPrice | CollateralPrice | undefined,\n {\n assetPairId: string;\n },\n 'price'\n >;\n 'wallet/:address/accounts': TradingApiListEndpoint<\n Account,\n AddressParam,\n 'AccountProfile'\n >;\n 'wallet/:address/accounts/tiers': TradingApiListEndpoint<\n {\n market_id: Decimal;\n account_id: Decimal;\n tier_id: Decimal | null;\n },\n AddressParam\n >;\n 'wallet/:address/accounts/balances': TradingApiListEndpoint<\n AccountBalance,\n AddressParam,\n 'account_balances'\n >;\n 'wallet/:address/autoExchange': TradingApiInfiniteListEndpoint<\n AutoExchange,\n AddressParam,\n 'auto_exchange'\n >;\n 'wallet/:address/balanceHistory/:timestamp': TradingApiListEndpoint<\n {\n timestamp: number;\n balance: number;\n },\n {\n address: string;\n timestamp: string;\n }\n >;\n 'wallet/:address/trades': TradingApiInfiniteListEndpoint<\n Order,\n {\n address: string;\n },\n 'order_history'\n >;\n 'wallet/:address/trades/:type': TradingApiInfiniteListEndpoint<\n Order,\n {\n address: string;\n type?: 'matchOrder' | 'liquidation';\n },\n 'order_history'\n >;\n riskMatrices: TradingApiListEndpoint<\n {\n blockId: Decimal;\n matrix: string[][];\n },\n {\n poolId: string;\n }\n >;\n tierFees: TradingApiListEndpoint<{\n market_id: Decimal;\n tier_id: Decimal;\n fee_parameter: Decimal | null;\n }>;\n collateralConfiguration: TradingApiListEndpoint<{\n assetPairId?: AssetPair;\n name?: string;\n collateral_pool_id: Decimal;\n collateral_address: string;\n price_haircut: Decimal | null;\n auto_exchange_discount: Decimal | null;\n oracle_node_id: string | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }>;\n 'candle/:assetPairId/:resolution': TradingApiEndpoint<\n Candle | null,\n {\n resolution: CandleResolution;\n assetPairId: AssetPair;\n },\n 'storkPriceCandle',\n Candle\n >;\n 'candles/:assetPairId/:resolution': TradingApiEndpoint<\n {\n t: number[];\n o: number[];\n h: number[];\n l: number[];\n c: number[];\n },\n {\n resolution: CandleResolution;\n assetPairId: AssetPair;\n },\n never,\n never,\n {\n to: string;\n from: string;\n countBack?: string;\n }\n >;\n feeTierParameters: TradingApiListEndpoint<{\n tier_id: Decimal;\n taker_fee: Decimal;\n maker_fee: Decimal;\n volume: Decimal;\n }>;\n globalFeeParameters: TradingApiEndpoint<\n {\n og_discount: Decimal;\n vltz_discount: Decimal;\n referee_discount: Decimal;\n referrer_rebate: Decimal;\n affiliate_referrer_rebate: Decimal;\n },\n never\n >;\n 'wallet/:address/configuration': TradingApiEndpoint<\n {\n tier_id: Decimal;\n og_status: boolean;\n vltz_status: boolean;\n affiliate_status: boolean;\n referee_status: boolean;\n spread_discount_status: boolean;\n main_account_id: Decimal;\n },\n {\n address: string;\n }\n >;\n 'wallet/:address/stats': TradingApiEndpoint<\n WalletStats,\n {\n address: string;\n }\n >;\n 'wallet/:address/apiWalletStatus': TradingApiEndpoint<\n {\n enabledApiWallets: string[];\n },\n {\n address: string;\n }\n >;\n rlp: TradingApiEndpoint<\n {\n tvlInUsdc: number;\n tvlInRlp: number;\n rlpUsdcPrice: number;\n apy: {\n '1d': number;\n '7d': number;\n '30d': number;\n '365d': number;\n };\n numberOfDepositors: number;\n ageSeconds: number;\n },\n never\n >;\n 'wallet/:address/rlp': TradingApiEndpoint<\n {\n balanceInUsdc: number;\n balanceInRlp: number;\n },\n {\n address: string;\n }\n >;\n};\n\nexport type Req<P = ParamsDictionary, ReqQuery = Query> = {\n params: P;\n query: ReqQuery;\n};\n\nexport type TradingApi = {\n [K in keyof TradingApiSource as K]: {\n params: TradingApiSource[K]['params'];\n query: TradingApiSource[K]['query'];\n response: Stringified<TradingApiSource[K]['response']>;\n replication: Stringified<TradingApiSource[K]['replication']>;\n };\n};\n\ntype ReplicationModel = string | never;\n\nexport type GenericReplicationMessage<T, model extends ReplicationModel> =\n | {\n model: model;\n result: T;\n operation: 'create' | 'update' | 'upsert' | 'delete';\n }\n | {\n model: model;\n result: T[];\n operation: 'updateMany';\n }\n | {\n model: model;\n result: T[];\n operation: 'createMany';\n };\n\ntype account_collateral_balance_entries = {\n id: string;\n account_id: Decimal | null;\n collateral: string | null;\n amount: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n};\n\ntype account_owner_updated_snapshot = {\n account_id: Decimal;\n transaction_hash: string;\n new_owner: string | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n};\n\ntype positions_migration = {\n market_id: Decimal;\n account_id: Decimal;\n base: Decimal | null;\n realized_pnl: Decimal | null;\n last_price: Decimal | null;\n last_price_timestamp: Decimal | null;\n funding_value: Decimal | null;\n base_multiplier: Decimal | null;\n adl_unwind_price: Decimal | null;\n average_entry_funding_value: Decimal | null;\n session: Decimal | null;\n exchange_id: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n event_sequence_number: bigint | null;\n referrer_account_id: Decimal | null;\n referrer_fee_credit: Decimal | null;\n};\n\ntype spot_execution_bust = {\n event_sequence_number: bigint;\n spot_market_id: Decimal;\n account_id: Decimal;\n counterparty_account_id: Decimal;\n account_order_id: bigint;\n counterparty_order_id: bigint;\n exchange_id: Decimal;\n failed_base: Decimal;\n price: Decimal;\n is_long: boolean;\n reason: string;\n block_timestamp: Decimal;\n block_number: Decimal;\n transaction_hash: string;\n created_at: string;\n};\n\ntype ReplicationMessage =\n // Extract the union of all `replication` values from TradingApiSource\n | Exclude<TradingApiSource[keyof TradingApiSource]['replication'], never>\n // add messages that do not exists in TradingApiSource\n | GenericReplicationMessage<\n account_owner_updated_snapshot,\n 'account_owner_updated_snapshot'\n >\n | GenericReplicationMessage<\n account_collateral_balance_entries,\n 'account_collateral_balance_entries'\n >\n | GenericReplicationMessage<account_real_balance, 'account_real_balances'>\n | GenericReplicationMessage<\n ConditionalOrderSensitive,\n 'ConditionalOrdersSensitive'\n >\n | GenericReplicationMessage<\n // Todo: remove after migration\n positions_migration,\n 'positions_migration'\n >\n | GenericReplicationMessage<spot_execution, 'spot_executions'>\n | GenericReplicationMessage<spot_execution_bust, 'spot_execution_busts'>;\n\nexport type Replication = {\n [K in ReplicationMessage as `replication:${K['model']}`]: Extract<\n ReplicationMessage,\n { model: K['model'] }\n >;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"trading-api-types.js","sourceRoot":"/","sources":["trading-api-types.ts"],"names":[],"mappings":";;;AAYa,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC","sourcesContent":["import { ParamsDictionary, Query } from 'express-serve-static-core';\nimport { AssetPair, CollateralPrice, MarketPrice } from './types';\nimport {\n AddressParam,\n ApiEndpoint,\n ApiInfiniteListEndpoint,\n ApiListEndpoint,\n Decimal,\n PaginatedQueryParams,\n Stringified,\n} from './api-types';\n\nexport const AccountStatusValues = {\n OPEN: 'OPEN',\n CLOSED: 'CLOSED',\n};\n\nexport type AccountStatus =\n (typeof AccountStatusValues)[keyof typeof AccountStatusValues];\n\ntype CandleResolution = '1' | '5' | '15' | '30' | '60' | '240' | '1D';\n\ntype Candle = {\n time: number;\n open: number;\n high: number;\n low: number;\n close: number;\n assetPairId: AssetPair;\n resolution: CandleResolution;\n};\n\ntype Order = {\n id: string;\n market_id: Decimal | null;\n account_id: Decimal | null;\n executed_base: Decimal | null;\n fee: Decimal | null;\n price: Decimal | null;\n is_match_order: boolean | null;\n liquidation_type: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n event_sequence_number: bigint | null;\n exchange_id: Decimal | null;\n created_at: Date;\n counterparty_account_id: Decimal | null;\n counterparty_adl_unwind_price: Decimal | null;\n counterparty_average_entry_funding_value: Decimal | null;\n counterparty_base: Decimal | null;\n counterparty_base_multiplier: Decimal | null;\n counterparty_funding_value: Decimal | null;\n counterparty_last_price: Decimal | null;\n counterparty_last_price_timestamp: Decimal | null;\n counterparty_realized_pnl: Decimal | null;\n counterparty_session: Decimal | null;\n position_adl_unwind_price: Decimal | null;\n position_average_entry_funding_value: Decimal | null;\n position_base: Decimal | null;\n position_base_multiplier: Decimal | null;\n position_funding_value: Decimal | null;\n position_last_price: Decimal | null;\n position_last_price_timestamp: Decimal | null;\n position_realized_pnl: Decimal | null;\n position_session: Decimal | null;\n referrer_account_id: Decimal | null;\n referrer_fee_credit: Decimal | null;\n};\n\ntype Position = {\n market_id: Decimal;\n account_id: Decimal;\n base: Decimal | null;\n realized_pnl: Decimal | null;\n last_price: Decimal | null;\n last_price_timestamp: Decimal | null;\n funding_value: Decimal | null;\n base_multiplier: Decimal | null;\n adl_unwind_price: Decimal | null;\n average_entry_funding_value: Decimal | null;\n session: Decimal | null;\n exchange_id: Decimal | null;\n event_sequence_number: bigint | null;\n referrer_account_id: Decimal | null;\n referrer_fee_credit: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n adjusted_base: Decimal | null;\n adl_realized_pnl: Decimal | null;\n};\n\ntype ConditionalOrder = {\n id: string;\n account_id: Decimal;\n market_id: Decimal;\n order_type: string;\n is_long: boolean;\n trigger_price: number;\n order_base: Decimal;\n status: string;\n creation_timestamp_ms: bigint;\n last_update_timestamp_ms: bigint;\n transaction_hash: string | null;\n};\n\ntype ConditionalOrderSensitive = ConditionalOrder & {\n exchange_id: bigint;\n inputs: string;\n counterparty_account_id: bigint;\n reya_chain_id: bigint;\n deadline: bigint;\n signer_address: string;\n nonce: Decimal;\n signature: string;\n};\n\ntype Market = {\n id: Decimal;\n assetPairId: AssetPair;\n ticker: string;\n isActive: boolean;\n maxLeverage: number;\n description: string;\n name: string;\n tickSizeDecimals: number;\n priority: number;\n underlyingAssetId: string;\n quoteTokenId: string;\n};\n\ntype Account = {\n account_id: Decimal;\n name: string;\n status: AccountStatus;\n updated_timestamp_ms: Decimal;\n source: string | null;\n};\n\ntype AccountBalance = {\n account_id: Decimal | null;\n collateral: string | null;\n balance?: Decimal | null;\n delta?: Decimal | null;\n};\n\ntype spot_execution = {\n account_id: Decimal;\n counterparty_account_id: Decimal;\n exchange_id: Decimal;\n executed_base: Decimal;\n price: Decimal;\n account_order_id: bigint;\n counterparty_order_id: bigint;\n spot_market_id: Decimal;\n is_auto_exchange: boolean;\n is_long: boolean;\n event_sequence_number: bigint;\n parent_event_sequence_number: bigint | null;\n block_timestamp: Decimal;\n block_number: Decimal;\n transaction_hash: string;\n created_at: string;\n};\n\ntype account_real_balance = {\n account_id: Decimal;\n collateral: string;\n balance: Decimal;\n rpnl: Decimal;\n event_sequence_number: bigint | null;\n transfer_event_sequence_number: bigint | null;\n parent_event_sequence_number: bigint | null;\n block_timestamp: Decimal;\n block_number: Decimal;\n transaction_hash: string;\n};\n\ntype AutoExchange = {\n id: string;\n liquidated_account_id: Decimal | null;\n liquidator_account_id: Decimal | null;\n requested_quote_amount: Decimal | null;\n collateral_out_address: string | null;\n collateral_in_address: string | null;\n collateral_amount_to_liquidator: Decimal | null;\n quote_amount_to_insurance_fund: Decimal | null;\n quote_amount_to_account: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n transaction_hash: string;\n unique_id: bigint | null;\n};\n\ntype Leverage = {\n accountId: Decimal;\n marketId: Decimal;\n leverage: number;\n createdAt: Date;\n updatedAt: Date;\n};\n\ntype WalletStats = {\n volume_14d: Decimal;\n};\n\ntype MarketData = {\n marketId: string;\n updatedAt: number;\n longOI: number;\n shortOI: number;\n longSkewPercentage: number;\n shortSkewPercentage: number;\n openInterest?: number;\n fundingRate?: number;\n fundingRateVelocity?: number;\n longFundingValue?: number;\n shortFundingValue?: number;\n last24hVolume: number;\n priceChange24H?: number;\n priceChange24HPercentage?: number;\n maxAmountBaseLong?: number;\n maxAmountSizeLong?: number;\n maxAmountBaseShort?: number;\n maxAmountSizeShort?: number;\n oraclePrice?: number;\n poolPrice?: number;\n pricesUpdatedAt?: number;\n longBaseMultiplier?: number;\n shortBaseMultiplier?: number;\n longAdlUnwindPrice?: number;\n shortAdlUnwindPrice?: number;\n depthFactor?: number;\n priceSpread?: number;\n logPriceMultiplier?: number;\n};\n\ntype SpotMarketData = {\n spotMarketId: string;\n symbol: string;\n updatedAt: number;\n volume24h: number;\n pxChange24h?: number;\n oraclePrice?: number;\n};\n\ntype MarketTrackers = {\n market_data_id: Decimal;\n passive_pool_id: Decimal | null;\n pool_account_id: Decimal | null;\n quote_token: string | null;\n quote_token_decimals: Decimal | null;\n last_funding_velocity: Decimal | null;\n last_funding_timestamp: Decimal | null;\n last_mtm_price: Decimal | null;\n last_mtm_timestamp: Decimal | null;\n long_trackers_funding_value: Decimal | null;\n last_funding_rate: Decimal | null;\n long_trackers_base_multiplier: Decimal | null;\n long_trackers_adl_unwind_price: Decimal | null;\n short_trackers_funding_value: Decimal | null;\n short_trackers_base_multiplier: Decimal | null;\n short_trackers_adl_unwind_price: Decimal | null;\n open_interest: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n price_spread: Decimal | null;\n depth_factor: Decimal | null;\n log_price_multiplier: Decimal | null;\n};\n\nexport type TradingApiReplication<\n ReplicationTable extends ReplicationModel = never,\n Replication = never,\n> = {\n replication: ReplicationTable extends never\n ? never\n : GenericReplicationMessage<Replication, ReplicationTable>;\n};\n\nexport type TradingApiEndpoint<\n Response,\n Params,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = never,\n> = ApiEndpoint<Response, Params, Query> &\n TradingApiReplication<ReplicationTable, Replication>;\n\nexport type TradingApiListEndpoint<\n Response,\n Params = never,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = never,\n> = ApiListEndpoint<Response, Params, Query> &\n TradingApiReplication<ReplicationTable, Replication>;\n\nexport type TradingApiInfiniteListEndpoint<\n Response,\n Params = never,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = PaginatedQueryParams,\n> = ApiInfiniteListEndpoint<Response, Params, Query> &\n TradingApiReplication<ReplicationTable, Replication>;\n\nexport type TradingApiSource = {\n 'poolBalance/:poolId': TradingApiEndpoint<\n {\n id: number;\n timestamp: bigint;\n pool_id: number;\n value: Decimal;\n apy: Decimal;\n share_price: Decimal;\n share_price_index: Decimal;\n } | null,\n {\n poolId?: string;\n }\n >;\n 'wallet/:address/leverages': TradingApiListEndpoint<\n Leverage,\n { address: string },\n 'accountLeveragePerMarket'\n >;\n markets: TradingApiListEndpoint<Market>;\n 'markets/data': TradingApiListEndpoint<MarketData, never, 'marketData'>;\n 'spotMarkets/data': TradingApiListEndpoint<\n SpotMarketData,\n never,\n 'spotMarketData'\n >;\n 'markets/configuration': TradingApiListEndpoint<{\n market_id: Decimal;\n risk_matrix_index: Decimal | null;\n max_open_base: Decimal | null;\n velocity_multiplier: Decimal | null;\n minimum_order_base: Decimal | null;\n base_spacing: Decimal | null;\n price_spacing: Decimal | null;\n oracle_node_id: string | null;\n mtm_window: Decimal | null;\n dutch_config_lambda: Decimal | null;\n dutch_config_min_base: Decimal | null;\n slippage_params_phi: Decimal | null;\n slippage_params_beta: Decimal | null;\n depth_factor: Decimal | null;\n max_exposure_factor: Decimal | null;\n max_p_slippage: Decimal | null;\n price_spread: Decimal | null;\n volatility_index_multiplier: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }>;\n 'markets/storage': TradingApiListEndpoint<{\n market_id: Decimal;\n quote_collateral: string | null;\n instrument_address: string | null;\n name: string | null;\n risk_block_id: Decimal | null;\n collateral_pool_id: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }>;\n 'markets/trackers': TradingApiListEndpoint<\n MarketTrackers,\n never,\n 'marketTrackers'\n >;\n 'market/:marketId/trackers': TradingApiEndpoint<\n MarketTrackers,\n {\n marketId: string;\n },\n 'marketTrackers'\n >;\n 'market/:marketId': TradingApiEndpoint<\n Market,\n {\n marketId: string;\n }\n >;\n 'market/:marketId/data': TradingApiEndpoint<\n MarketData,\n {\n marketId: string;\n },\n 'marketData'\n >;\n 'market/:marketId/trades': TradingApiInfiniteListEndpoint<\n Order,\n {\n marketId: string;\n },\n 'orders'\n >;\n 'wallet/:address/positions': TradingApiListEndpoint<\n Position,\n AddressParam,\n 'position',\n Omit<Position, 'adjusted_base' | 'adl_realized_pnl'>\n >;\n 'wallet/:address/openOrders': TradingApiListEndpoint<\n ConditionalOrder,\n AddressParam,\n 'ConditionalOrders'\n >;\n assets: TradingApiListEndpoint<{\n address: string;\n name: string;\n short: string;\n createdAt: Date;\n updatedAt: Date;\n asset_price_contract_id: string | null;\n asset_price_usdc_contract_id: string | null;\n decimals: number;\n }>;\n prices: TradingApiEndpoint<\n Partial<Record<AssetPair, MarketPrice | CollateralPrice>>,\n never\n >;\n 'prices/:assetPairId': TradingApiEndpoint<\n MarketPrice | CollateralPrice | undefined,\n {\n assetPairId: string;\n },\n 'price'\n >;\n 'wallet/:address/accounts': TradingApiListEndpoint<\n Account,\n AddressParam,\n 'AccountProfile'\n >;\n 'wallet/:address/accounts/tiers': TradingApiListEndpoint<\n {\n market_id: Decimal;\n account_id: Decimal;\n tier_id: Decimal | null;\n },\n AddressParam\n >;\n 'wallet/:address/accounts/balances': TradingApiListEndpoint<\n AccountBalance,\n AddressParam,\n 'account_balances'\n >;\n 'wallet/:address/autoExchange': TradingApiInfiniteListEndpoint<\n AutoExchange,\n AddressParam,\n 'auto_exchange'\n >;\n 'wallet/:address/balanceHistory/:timestamp': TradingApiListEndpoint<\n {\n timestamp: number;\n balance: number;\n },\n {\n address: string;\n timestamp: string;\n }\n >;\n 'wallet/:address/trades': TradingApiInfiniteListEndpoint<\n Order,\n {\n address: string;\n },\n 'order_history'\n >;\n 'wallet/:address/trades/:type': TradingApiInfiniteListEndpoint<\n Order,\n {\n address: string;\n type?: 'matchOrder' | 'liquidation';\n },\n 'order_history'\n >;\n riskMatrices: TradingApiListEndpoint<\n {\n blockId: Decimal;\n matrix: string[][];\n },\n {\n poolId: string;\n }\n >;\n tierFees: TradingApiListEndpoint<{\n market_id: Decimal;\n tier_id: Decimal;\n fee_parameter: Decimal | null;\n }>;\n collateralConfiguration: TradingApiListEndpoint<{\n assetPairId?: AssetPair;\n name?: string;\n collateral_pool_id: Decimal;\n collateral_address: string;\n price_haircut: Decimal | null;\n auto_exchange_discount: Decimal | null;\n oracle_node_id: string | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }>;\n 'candle/:assetPairId/:resolution': TradingApiEndpoint<\n Candle | null,\n {\n resolution: CandleResolution;\n assetPairId: AssetPair;\n },\n 'storkPriceCandle',\n Candle\n >;\n 'candles/:assetPairId/:resolution': TradingApiEndpoint<\n {\n t: number[];\n o: number[];\n h: number[];\n l: number[];\n c: number[];\n },\n {\n resolution: CandleResolution;\n assetPairId: AssetPair;\n },\n never,\n never,\n {\n to: string;\n from: string;\n countBack?: string;\n }\n >;\n feeTierParameters: TradingApiListEndpoint<{\n tier_id: Decimal;\n taker_fee: Decimal;\n maker_fee: Decimal;\n volume: Decimal;\n }>;\n globalFeeParameters: TradingApiEndpoint<\n {\n og_discount: Decimal;\n vltz_discount: Decimal;\n referee_discount: Decimal;\n referrer_rebate: Decimal;\n affiliate_referrer_rebate: Decimal;\n },\n never\n >;\n dynamicDepthConfig: TradingApiEndpoint<\n {\n markets: {\n marketId: number;\n baseDepth: number;\n thresholds: number[];\n ratios: number[];\n }[];\n },\n never\n >;\n 'wallet/:address/configuration': TradingApiEndpoint<\n {\n tier_id: Decimal;\n og_status: boolean;\n vltz_status: boolean;\n affiliate_status: boolean;\n referee_status: boolean;\n spread_discount_status: boolean;\n main_account_id: Decimal;\n },\n {\n address: string;\n }\n >;\n 'wallet/:address/stats': TradingApiEndpoint<\n WalletStats,\n {\n address: string;\n }\n >;\n 'wallet/:address/apiWalletStatus': TradingApiEndpoint<\n {\n enabledApiWallets: string[];\n },\n {\n address: string;\n }\n >;\n rlp: TradingApiEndpoint<\n {\n tvlInUsdc: number;\n tvlInRlp: number;\n rlpUsdcPrice: number;\n apy: {\n '1d': number;\n '7d': number;\n '30d': number;\n '365d': number;\n };\n numberOfDepositors: number;\n ageSeconds: number;\n },\n never\n >;\n 'wallet/:address/rlp': TradingApiEndpoint<\n {\n balanceInUsdc: number;\n balanceInRlp: number;\n },\n {\n address: string;\n }\n >;\n};\n\nexport type Req<P = ParamsDictionary, ReqQuery = Query> = {\n params: P;\n query: ReqQuery;\n};\n\nexport type TradingApi = {\n [K in keyof TradingApiSource as K]: {\n params: TradingApiSource[K]['params'];\n query: TradingApiSource[K]['query'];\n response: Stringified<TradingApiSource[K]['response']>;\n replication: Stringified<TradingApiSource[K]['replication']>;\n };\n};\n\ntype ReplicationModel = string | never;\n\nexport type GenericReplicationMessage<T, model extends ReplicationModel> =\n | {\n model: model;\n result: T;\n operation: 'create' | 'update' | 'upsert' | 'delete';\n }\n | {\n model: model;\n result: T[];\n operation: 'updateMany';\n }\n | {\n model: model;\n result: T[];\n operation: 'createMany';\n };\n\ntype account_collateral_balance_entries = {\n id: string;\n account_id: Decimal | null;\n collateral: string | null;\n amount: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n};\n\ntype account_owner_updated_snapshot = {\n account_id: Decimal;\n transaction_hash: string;\n new_owner: string | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n};\n\ntype positions_migration = {\n market_id: Decimal;\n account_id: Decimal;\n base: Decimal | null;\n realized_pnl: Decimal | null;\n last_price: Decimal | null;\n last_price_timestamp: Decimal | null;\n funding_value: Decimal | null;\n base_multiplier: Decimal | null;\n adl_unwind_price: Decimal | null;\n average_entry_funding_value: Decimal | null;\n session: Decimal | null;\n exchange_id: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n event_sequence_number: bigint | null;\n referrer_account_id: Decimal | null;\n referrer_fee_credit: Decimal | null;\n};\n\ntype spot_execution_bust = {\n event_sequence_number: bigint;\n spot_market_id: Decimal;\n account_id: Decimal;\n counterparty_account_id: Decimal;\n account_order_id: bigint;\n counterparty_order_id: bigint;\n exchange_id: Decimal;\n failed_base: Decimal;\n price: Decimal;\n is_long: boolean;\n reason: string;\n block_timestamp: Decimal;\n block_number: Decimal;\n transaction_hash: string;\n created_at: string;\n};\n\ntype ReplicationMessage =\n // Extract the union of all `replication` values from TradingApiSource\n | Exclude<TradingApiSource[keyof TradingApiSource]['replication'], never>\n // add messages that do not exists in TradingApiSource\n | GenericReplicationMessage<\n account_owner_updated_snapshot,\n 'account_owner_updated_snapshot'\n >\n | GenericReplicationMessage<\n account_collateral_balance_entries,\n 'account_collateral_balance_entries'\n >\n | GenericReplicationMessage<account_real_balance, 'account_real_balances'>\n | GenericReplicationMessage<\n ConditionalOrderSensitive,\n 'ConditionalOrdersSensitive'\n >\n | GenericReplicationMessage<\n // Todo: remove after migration\n positions_migration,\n 'positions_migration'\n >\n | GenericReplicationMessage<spot_execution, 'spot_executions'>\n | GenericReplicationMessage<spot_execution_bust, 'spot_execution_busts'>;\n\nexport type Replication = {\n [K in ReplicationMessage as `replication:${K['model']}`]: Extract<\n ReplicationMessage,\n { model: K['model'] }\n >;\n};\n"]}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
{
|
|
2
|
+
"abi": [
|
|
3
|
+
{
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"components": [
|
|
7
|
+
{
|
|
8
|
+
"internalType": "uint32",
|
|
9
|
+
"name": "dstEid",
|
|
10
|
+
"type": "uint32"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"internalType": "bytes32",
|
|
14
|
+
"name": "to",
|
|
15
|
+
"type": "bytes32"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"internalType": "uint256",
|
|
19
|
+
"name": "amountLD",
|
|
20
|
+
"type": "uint256"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"internalType": "uint256",
|
|
24
|
+
"name": "minAmountLD",
|
|
25
|
+
"type": "uint256"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"internalType": "bytes",
|
|
29
|
+
"name": "extraOptions",
|
|
30
|
+
"type": "bytes"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"internalType": "bytes",
|
|
34
|
+
"name": "composeMsg",
|
|
35
|
+
"type": "bytes"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"internalType": "bytes",
|
|
39
|
+
"name": "oftCmd",
|
|
40
|
+
"type": "bytes"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"internalType": "struct SendParam",
|
|
44
|
+
"name": "_sendParam",
|
|
45
|
+
"type": "tuple"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"internalType": "bool",
|
|
49
|
+
"name": "_payInLzToken",
|
|
50
|
+
"type": "bool"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"name": "quoteSend",
|
|
54
|
+
"outputs": [
|
|
55
|
+
{
|
|
56
|
+
"components": [
|
|
57
|
+
{
|
|
58
|
+
"internalType": "uint256",
|
|
59
|
+
"name": "nativeFee",
|
|
60
|
+
"type": "uint256"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"internalType": "uint256",
|
|
64
|
+
"name": "lzTokenFee",
|
|
65
|
+
"type": "uint256"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"internalType": "struct MessagingFee",
|
|
69
|
+
"name": "msgFee",
|
|
70
|
+
"type": "tuple"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"stateMutability": "view",
|
|
74
|
+
"type": "function"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"inputs": [
|
|
78
|
+
{
|
|
79
|
+
"components": [
|
|
80
|
+
{
|
|
81
|
+
"internalType": "uint32",
|
|
82
|
+
"name": "dstEid",
|
|
83
|
+
"type": "uint32"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"internalType": "bytes32",
|
|
87
|
+
"name": "to",
|
|
88
|
+
"type": "bytes32"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"internalType": "uint256",
|
|
92
|
+
"name": "amountLD",
|
|
93
|
+
"type": "uint256"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"internalType": "uint256",
|
|
97
|
+
"name": "minAmountLD",
|
|
98
|
+
"type": "uint256"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"internalType": "bytes",
|
|
102
|
+
"name": "extraOptions",
|
|
103
|
+
"type": "bytes"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"internalType": "bytes",
|
|
107
|
+
"name": "composeMsg",
|
|
108
|
+
"type": "bytes"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"internalType": "bytes",
|
|
112
|
+
"name": "oftCmd",
|
|
113
|
+
"type": "bytes"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"internalType": "struct SendParam",
|
|
117
|
+
"name": "_sendParam",
|
|
118
|
+
"type": "tuple"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"components": [
|
|
122
|
+
{
|
|
123
|
+
"internalType": "uint256",
|
|
124
|
+
"name": "nativeFee",
|
|
125
|
+
"type": "uint256"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"internalType": "uint256",
|
|
129
|
+
"name": "lzTokenFee",
|
|
130
|
+
"type": "uint256"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"internalType": "struct MessagingFee",
|
|
134
|
+
"name": "_fee",
|
|
135
|
+
"type": "tuple"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"internalType": "address",
|
|
139
|
+
"name": "_refundAddress",
|
|
140
|
+
"type": "address"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"name": "send",
|
|
144
|
+
"outputs": [
|
|
145
|
+
{
|
|
146
|
+
"components": [
|
|
147
|
+
{
|
|
148
|
+
"internalType": "bytes32",
|
|
149
|
+
"name": "guid",
|
|
150
|
+
"type": "bytes32"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"internalType": "uint64",
|
|
154
|
+
"name": "nonce",
|
|
155
|
+
"type": "uint64"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"components": [
|
|
159
|
+
{
|
|
160
|
+
"internalType": "uint256",
|
|
161
|
+
"name": "nativeFee",
|
|
162
|
+
"type": "uint256"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"internalType": "uint256",
|
|
166
|
+
"name": "lzTokenFee",
|
|
167
|
+
"type": "uint256"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"internalType": "struct MessagingFee",
|
|
171
|
+
"name": "fee",
|
|
172
|
+
"type": "tuple"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"internalType": "struct MessagingReceipt",
|
|
176
|
+
"name": "msgReceipt",
|
|
177
|
+
"type": "tuple"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"components": [
|
|
181
|
+
{
|
|
182
|
+
"internalType": "uint256",
|
|
183
|
+
"name": "amountSentLD",
|
|
184
|
+
"type": "uint256"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"internalType": "uint256",
|
|
188
|
+
"name": "amountReceivedLD",
|
|
189
|
+
"type": "uint256"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"internalType": "struct OFTReceipt",
|
|
193
|
+
"name": "oftReceipt",
|
|
194
|
+
"type": "tuple"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"stateMutability": "payable",
|
|
198
|
+
"type": "function"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
@@ -1457,6 +1457,125 @@
|
|
|
1457
1457
|
"outputs": [],
|
|
1458
1458
|
"stateMutability": "nonpayable"
|
|
1459
1459
|
},
|
|
1460
|
+
{
|
|
1461
|
+
"type": "function",
|
|
1462
|
+
"name": "withdrawMALZ",
|
|
1463
|
+
"inputs": [
|
|
1464
|
+
{
|
|
1465
|
+
"name": "inputs",
|
|
1466
|
+
"type": "tuple",
|
|
1467
|
+
"internalType": "struct WithdrawMALZInputs",
|
|
1468
|
+
"components": [
|
|
1469
|
+
{
|
|
1470
|
+
"name": "accountId",
|
|
1471
|
+
"type": "uint128",
|
|
1472
|
+
"internalType": "uint128"
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
"name": "token",
|
|
1476
|
+
"type": "address",
|
|
1477
|
+
"internalType": "address"
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
"name": "tokenAmount",
|
|
1481
|
+
"type": "uint256",
|
|
1482
|
+
"internalType": "uint256"
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
"name": "sig",
|
|
1486
|
+
"type": "tuple",
|
|
1487
|
+
"internalType": "struct EIP712Signature",
|
|
1488
|
+
"components": [
|
|
1489
|
+
{
|
|
1490
|
+
"name": "v",
|
|
1491
|
+
"type": "uint8",
|
|
1492
|
+
"internalType": "uint8"
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
"name": "r",
|
|
1496
|
+
"type": "bytes32",
|
|
1497
|
+
"internalType": "bytes32"
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
"name": "s",
|
|
1501
|
+
"type": "bytes32",
|
|
1502
|
+
"internalType": "bytes32"
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
"name": "deadline",
|
|
1506
|
+
"type": "uint256",
|
|
1507
|
+
"internalType": "uint256"
|
|
1508
|
+
}
|
|
1509
|
+
]
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
"name": "dstEid",
|
|
1513
|
+
"type": "uint32",
|
|
1514
|
+
"internalType": "uint32"
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
"name": "receiver",
|
|
1518
|
+
"type": "address",
|
|
1519
|
+
"internalType": "address"
|
|
1520
|
+
}
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
],
|
|
1524
|
+
"outputs": [
|
|
1525
|
+
{
|
|
1526
|
+
"name": "",
|
|
1527
|
+
"type": "tuple",
|
|
1528
|
+
"internalType": "struct MessagingReceipt",
|
|
1529
|
+
"components": [
|
|
1530
|
+
{
|
|
1531
|
+
"name": "guid",
|
|
1532
|
+
"type": "bytes32",
|
|
1533
|
+
"internalType": "bytes32"
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
"name": "nonce",
|
|
1537
|
+
"type": "uint64",
|
|
1538
|
+
"internalType": "uint64"
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
"name": "fee",
|
|
1542
|
+
"type": "tuple",
|
|
1543
|
+
"internalType": "struct MessagingFee",
|
|
1544
|
+
"components": [
|
|
1545
|
+
{
|
|
1546
|
+
"name": "nativeFee",
|
|
1547
|
+
"type": "uint256",
|
|
1548
|
+
"internalType": "uint256"
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
"name": "lzTokenFee",
|
|
1552
|
+
"type": "uint256",
|
|
1553
|
+
"internalType": "uint256"
|
|
1554
|
+
}
|
|
1555
|
+
]
|
|
1556
|
+
}
|
|
1557
|
+
]
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
"name": "",
|
|
1561
|
+
"type": "tuple",
|
|
1562
|
+
"internalType": "struct OFTReceipt",
|
|
1563
|
+
"components": [
|
|
1564
|
+
{
|
|
1565
|
+
"name": "amountSentLD",
|
|
1566
|
+
"type": "uint256",
|
|
1567
|
+
"internalType": "uint256"
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
"name": "amountReceivedLD",
|
|
1571
|
+
"type": "uint256",
|
|
1572
|
+
"internalType": "uint256"
|
|
1573
|
+
}
|
|
1574
|
+
]
|
|
1575
|
+
}
|
|
1576
|
+
],
|
|
1577
|
+
"stateMutability": "nonpayable"
|
|
1578
|
+
},
|
|
1460
1579
|
{
|
|
1461
1580
|
"type": "function",
|
|
1462
1581
|
"name": "withdrawPassivePool",
|
|
@@ -1869,6 +1988,120 @@
|
|
|
1869
1988
|
],
|
|
1870
1989
|
"anonymous": false
|
|
1871
1990
|
},
|
|
1991
|
+
{
|
|
1992
|
+
"type": "function",
|
|
1993
|
+
"name": "stakeReya",
|
|
1994
|
+
"inputs": [
|
|
1995
|
+
{
|
|
1996
|
+
"name": "inputs",
|
|
1997
|
+
"type": "tuple",
|
|
1998
|
+
"internalType": "struct StakeReyaInputs",
|
|
1999
|
+
"components": [
|
|
2000
|
+
{
|
|
2001
|
+
"name": "accountId",
|
|
2002
|
+
"type": "uint128",
|
|
2003
|
+
"internalType": "uint128"
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
"name": "assetAmount",
|
|
2007
|
+
"type": "uint256",
|
|
2008
|
+
"internalType": "uint256"
|
|
2009
|
+
},
|
|
2010
|
+
{
|
|
2011
|
+
"name": "minShareAmount",
|
|
2012
|
+
"type": "uint256",
|
|
2013
|
+
"internalType": "uint256"
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
"name": "withdrawSig",
|
|
2017
|
+
"type": "tuple",
|
|
2018
|
+
"internalType": "struct EIP712Signature",
|
|
2019
|
+
"components": [
|
|
2020
|
+
{
|
|
2021
|
+
"name": "v",
|
|
2022
|
+
"type": "uint8",
|
|
2023
|
+
"internalType": "uint8"
|
|
2024
|
+
},
|
|
2025
|
+
{
|
|
2026
|
+
"name": "r",
|
|
2027
|
+
"type": "bytes32",
|
|
2028
|
+
"internalType": "bytes32"
|
|
2029
|
+
},
|
|
2030
|
+
{
|
|
2031
|
+
"name": "s",
|
|
2032
|
+
"type": "bytes32",
|
|
2033
|
+
"internalType": "bytes32"
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
"name": "deadline",
|
|
2037
|
+
"type": "uint256",
|
|
2038
|
+
"internalType": "uint256"
|
|
2039
|
+
}
|
|
2040
|
+
]
|
|
2041
|
+
}
|
|
2042
|
+
]
|
|
2043
|
+
}
|
|
2044
|
+
],
|
|
2045
|
+
"outputs": [],
|
|
2046
|
+
"stateMutability": "nonpayable"
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
"type": "function",
|
|
2050
|
+
"name": "unstakeStakedReya",
|
|
2051
|
+
"inputs": [
|
|
2052
|
+
{
|
|
2053
|
+
"name": "inputs",
|
|
2054
|
+
"type": "tuple",
|
|
2055
|
+
"internalType": "struct UnstakeStakedReyaInputs",
|
|
2056
|
+
"components": [
|
|
2057
|
+
{
|
|
2058
|
+
"name": "accountId",
|
|
2059
|
+
"type": "uint128",
|
|
2060
|
+
"internalType": "uint128"
|
|
2061
|
+
},
|
|
2062
|
+
{
|
|
2063
|
+
"name": "shareAmount",
|
|
2064
|
+
"type": "uint256",
|
|
2065
|
+
"internalType": "uint256"
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
"name": "minAssetAmount",
|
|
2069
|
+
"type": "uint256",
|
|
2070
|
+
"internalType": "uint256"
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
"name": "withdrawSig",
|
|
2074
|
+
"type": "tuple",
|
|
2075
|
+
"internalType": "struct EIP712Signature",
|
|
2076
|
+
"components": [
|
|
2077
|
+
{
|
|
2078
|
+
"name": "v",
|
|
2079
|
+
"type": "uint8",
|
|
2080
|
+
"internalType": "uint8"
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"name": "r",
|
|
2084
|
+
"type": "bytes32",
|
|
2085
|
+
"internalType": "bytes32"
|
|
2086
|
+
},
|
|
2087
|
+
{
|
|
2088
|
+
"name": "s",
|
|
2089
|
+
"type": "bytes32",
|
|
2090
|
+
"internalType": "bytes32"
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
"name": "deadline",
|
|
2094
|
+
"type": "uint256",
|
|
2095
|
+
"internalType": "uint256"
|
|
2096
|
+
}
|
|
2097
|
+
]
|
|
2098
|
+
}
|
|
2099
|
+
]
|
|
2100
|
+
}
|
|
2101
|
+
],
|
|
2102
|
+
"outputs": [],
|
|
2103
|
+
"stateMutability": "nonpayable"
|
|
2104
|
+
},
|
|
1872
2105
|
{
|
|
1873
2106
|
"type": "error",
|
|
1874
2107
|
"name": "ValueAlreadyInSet",
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PassivePerpAbi = exports.OrdersGatewayAbi = exports.Socket_VaultWithPayloadAbi = exports.PeripheryAbi = exports.OracleAdaptersAbi = exports.MulticallAbi = exports.ErrorsAbi = exports.CoreAbi = void 0;
|
|
17
|
+
exports.OFTAbi = exports.PassivePerpAbi = exports.OrdersGatewayAbi = exports.Socket_VaultWithPayloadAbi = exports.PeripheryAbi = exports.OracleAdaptersAbi = exports.MulticallAbi = exports.ErrorsAbi = exports.CoreAbi = void 0;
|
|
18
18
|
__exportStar(require("./action"), exports);
|
|
19
19
|
var CoreProxy_json_1 = require("./abis/CoreProxy.json");
|
|
20
20
|
Object.defineProperty(exports, "CoreAbi", { enumerable: true, get: function () { return CoreProxy_json_1.abi; } });
|
|
@@ -32,6 +32,8 @@ var OrdersGateway_json_1 = require("./abis/OrdersGateway.json");
|
|
|
32
32
|
Object.defineProperty(exports, "OrdersGatewayAbi", { enumerable: true, get: function () { return OrdersGateway_json_1.abi; } });
|
|
33
33
|
var PassivePerpProxy_json_1 = require("./abis/PassivePerpProxy.json");
|
|
34
34
|
Object.defineProperty(exports, "PassivePerpAbi", { enumerable: true, get: function () { return PassivePerpProxy_json_1.abi; } });
|
|
35
|
+
var OFT_json_1 = require("./abis/OFT.json");
|
|
36
|
+
Object.defineProperty(exports, "OFTAbi", { enumerable: true, get: function () { return OFT_json_1.abi; } });
|
|
35
37
|
__exportStar(require("./contractAddresses"), exports);
|
|
36
38
|
__exportStar(require("./routerCommands"), exports);
|
|
37
39
|
__exportStar(require("./sign"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["transactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wDAAuD;AAA9C,yGAAA,GAAG,OAAW;AACvB,kDAAsD;AAA7C,wGAAA,GAAG,OAAa;AACzB,sEAAmE;AAA1D,qHAAA,GAAG,OAAgB;AAC5B,4EAA2E;AAAlE,6HAAA,GAAG,OAAqB;AACjC,wDAA4D;AAAnD,8GAAA,GAAG,OAAgB;AAC5B,6EAAwF;AAA/E,mIAAA,GAAG,OAA8B;AAC1C,gEAAoE;AAA3D,sHAAA,GAAG,OAAoB;AAChC,sEAAqE;AAA5D,uHAAA,GAAG,OAAkB;AAC9B,sDAAoC;AACpC,mDAAiC;AACjC,yCAAuB;AACvB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,uDAAqC;AACrC,gDAA8B;AAC9B,qDAAmC;AACnC,wDAAsC","sourcesContent":["export * from './action';\nexport { abi as CoreAbi } from './abis/CoreProxy.json';\nexport { abi as ErrorsAbi } from './abis/Errors.json';\nexport { abi as MulticallAbi } from './abis/CustomMulticall3.json';\nexport { abi as OracleAdaptersAbi } from './abis/OracleAdaptersProxy.json';\nexport { abi as PeripheryAbi } from './abis/Periphery.json';\nexport { abi as Socket_VaultWithPayloadAbi } from './abis/socket/VaultWithPayload.json';\nexport { abi as OrdersGatewayAbi } from './abis/OrdersGateway.json';\nexport { abi as PassivePerpAbi } from './abis/PassivePerpProxy.json';\nexport * from './contractAddresses';\nexport * from './routerCommands';\nexport * from './sign';\nexport * from './trade';\nexport * from './txHelpers';\nexport * from './consts';\nexport * from './executeTransaction';\nexport * from './permissions';\nexport * from './buildMulticallTx';\nexport * from './encodeStorkUpdateTx';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["transactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wDAAuD;AAA9C,yGAAA,GAAG,OAAW;AACvB,kDAAsD;AAA7C,wGAAA,GAAG,OAAa;AACzB,sEAAmE;AAA1D,qHAAA,GAAG,OAAgB;AAC5B,4EAA2E;AAAlE,6HAAA,GAAG,OAAqB;AACjC,wDAA4D;AAAnD,8GAAA,GAAG,OAAgB;AAC5B,6EAAwF;AAA/E,mIAAA,GAAG,OAA8B;AAC1C,gEAAoE;AAA3D,sHAAA,GAAG,OAAoB;AAChC,sEAAqE;AAA5D,uHAAA,GAAG,OAAkB;AAC9B,4CAAgD;AAAvC,kGAAA,GAAG,OAAU;AACtB,sDAAoC;AACpC,mDAAiC;AACjC,yCAAuB;AACvB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,uDAAqC;AACrC,gDAA8B;AAC9B,qDAAmC;AACnC,wDAAsC","sourcesContent":["export * from './action';\nexport { abi as CoreAbi } from './abis/CoreProxy.json';\nexport { abi as ErrorsAbi } from './abis/Errors.json';\nexport { abi as MulticallAbi } from './abis/CustomMulticall3.json';\nexport { abi as OracleAdaptersAbi } from './abis/OracleAdaptersProxy.json';\nexport { abi as PeripheryAbi } from './abis/Periphery.json';\nexport { abi as Socket_VaultWithPayloadAbi } from './abis/socket/VaultWithPayload.json';\nexport { abi as OrdersGatewayAbi } from './abis/OrdersGateway.json';\nexport { abi as PassivePerpAbi } from './abis/PassivePerpProxy.json';\nexport { abi as OFTAbi } from './abis/OFT.json';\nexport * from './contractAddresses';\nexport * from './routerCommands';\nexport * from './sign';\nexport * from './trade';\nexport * from './txHelpers';\nexport * from './consts';\nexport * from './executeTransaction';\nexport * from './permissions';\nexport * from './buildMulticallTx';\nexport * from './encodeStorkUpdateTx';\n"]}
|
|
@@ -407,6 +407,14 @@ export type TradingApiSource = {
|
|
|
407
407
|
referrer_rebate: Decimal;
|
|
408
408
|
affiliate_referrer_rebate: Decimal;
|
|
409
409
|
}, never>;
|
|
410
|
+
dynamicDepthConfig: TradingApiEndpoint<{
|
|
411
|
+
markets: {
|
|
412
|
+
marketId: number;
|
|
413
|
+
baseDepth: number;
|
|
414
|
+
thresholds: number[];
|
|
415
|
+
ratios: number[];
|
|
416
|
+
}[];
|
|
417
|
+
}, never>;
|
|
410
418
|
'wallet/:address/configuration': TradingApiEndpoint<{
|
|
411
419
|
tier_id: Decimal;
|
|
412
420
|
og_status: boolean;
|