@reyaxyz/common 0.327.0 → 0.327.2

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 CHANGED
@@ -6,5 +6,5 @@
6
6
 
7
7
  | Statements | Branches | Functions | Lines |
8
8
  | --------------------------- | ----------------------- | ------------------------- | ----------------- |
9
- | ![Statements](https://img.shields.io/badge/statements-22.32%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-18.5%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-12.33%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-23.91%25-red.svg?style=flat) |
9
+ | ![Statements](https://img.shields.io/badge/statements-22.32%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-18.38%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-12.33%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-23.91%25-red.svg?style=flat) |
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: number | null;\n collateral: string | null;\n balance?: Decimal | null;\n delta?: Decimal | null;\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};\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};\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 '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 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};\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 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<\n ConditionalOrderSensitive,\n 'ConditionalOrdersSensitive'\n >\n | GenericReplicationMessage<\n // Todo: remove after migration\n positions_migration,\n 'positions_migration'\n >;\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: number | 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};\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};\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 '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 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};\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 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<\n ConditionalOrderSensitive,\n 'ConditionalOrdersSensitive'\n >\n | GenericReplicationMessage<\n // Todo: remove after migration\n positions_migration,\n 'positions_migration'\n >\n | GenericReplicationMessage<account_real_balance, 'account_real_balances'>\n | GenericReplicationMessage<spot_execution, 'spot_executions'>;\n\nexport type Replication = {\n [K in ReplicationMessage as `replication:${K['model']}`]: Extract<\n ReplicationMessage,\n { model: K['model'] }\n >;\n};\n"]}
@@ -189,14 +189,14 @@ function createOrdersGatewayOrderNonce(accountId, marketId, timestampMs) {
189
189
  return hashUint256;
190
190
  }
191
191
  exports.createOrdersGatewayOrderNonce = createOrdersGatewayOrderNonce;
192
- function signOrdersGatewayOrder(signer, reyaChainId, accountId, marketId, exchangeId, counterpartyAccountIds, orderType, inputs, deadline, creationTimestampMs) {
192
+ function signOrdersGatewayOrder(signer, reyaChainId, accountId, marketId, exchangeId, counterpartyAccountIds, orderType, inputs, deadline, creationTimestampMs, customNonce) {
193
193
  return __awaiter(this, void 0, void 0, function () {
194
194
  var nonce, signature, _a, _b;
195
195
  var _c, _d;
196
196
  return __generator(this, function (_e) {
197
197
  switch (_e.label) {
198
198
  case 0:
199
- nonce = createOrdersGatewayOrderNonce(accountId, marketId, creationTimestampMs);
199
+ nonce = customNonce !== null && customNonce !== void 0 ? customNonce : createOrdersGatewayOrderNonce(accountId, marketId, creationTimestampMs);
200
200
  _a = signReyaTypedData;
201
201
  _b = [signer,
202
202
  (0, contractAddresses_1.getAddress)(reyaChainId, contractAddresses_1.ContractType.ORDERS_GATEWAY_PROXY),
@@ -1 +1 @@
1
- {"version":3,"file":"sign.js","sourceRoot":"/","sources":["transactions/sign.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAMgB;AAChB,yDAA+D;AAE/D,kCAMkB;AA0BlB,SAAgB,uCAAuC,CACrD,SAAoB,EACpB,QAAgB;IAEhB,OAAO;QACL,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,QAAQ,UAAA;KACT,CAAC;AACJ,CAAC;AAVD,0FAUC;AAED,SAAsB,gBAAgB,CACpC,MAA8B,EAC9B,WAAwB,EACxB,MAAe,EACf,SAAiB,EACjB,QAAmB,EACnB,KAAa,EACb,QAAgB,EAChB,kBAA0B;;;;;;oBAEpB,KAAK,GAAG;wBACZ,YAAY,EAAE;4BACZ,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;4BAC7C,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;4BACnC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;4BACtC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE;4BACvC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;4BAClC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;4BACrC,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,EAAE;yBAC9C;wBACD,OAAO,EAAE;4BACP,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE;4BACtC,E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U;wBACtB,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,KAAK;wBACZ,QAAQ,EAAE,QAAQ;qBACnB,CACF,EAAA;;oBArBK,SAAS,GAAG,SAqBjB;oBAED,sBAAO,uCAAuC,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAC;;;;CACrE;AAjCD,oDAiCC;AAEM,IAAM,yBAAyB,GAAG,UACvC,MAA8B,EAC9B,aAAqB,EACrB,WAAwB,EACxB,aAAqB,EACrB,eAAwB,EACxB,QAAgB;;;;oBAEE,qBAAM,iBAAiB,CACvC,MAAM,EACN,IAAA,8BAAU,EAAC,WAAW,EAAE,gCAAY,CAAC,oBAAoB,CAAC,EAC1D;oBACE,qBAAqB,EAAE;wBACrB,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;wBAC7C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;wBAClC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;wBACnC,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE;wBACzC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;qBACtC;iBACF,EACD;oBACE,gBAAgB,EAAE,WAAW;oBAC7B,KAAK,EAAE,aAAa;oBACpB,MAAM,EAAE,aAAa;oBACrB,eAAe,EAAE,eAAe;oBAChC,QAAQ,EAAE,QAAQ;iBACnB,CACF,EAAA;;gBAnBK,SAAS,GAAG,SAmBjB;gBAED,sBAAO,uCAAuC,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAC;;;KACrE,CAAC;AA9BW,QAAA,yBAAyB,6BA8BpC","sourcesContent":["import {\n JsonRpcSigner,\n Signature,\n Signer,\n TypedDataField,\n verifyTypedData,\n} from 'ethers';\nimport { ContractType, getAddress } from './contractAddresses';\nimport { Command } from './action';\nimport {\n Address,\n ConditionalOrderStatus,\n ConditionalOrderType,\n OrdersGatewayOrderType,\n ReyaChainId,\n} from '../types';\n\nexport type EIP712Signature = {\n v: number;\n r: string;\n s: string;\n deadline: number;\n};\n\nexport type CoreCommandsEIP712SignatureAndPayload = {\n signature: EIP712Signature;\n payload: {\n verifyingContract: string;\n types: Record<string, Array<TypedDataField>>;\n value: {\n verifyingChainId: number;\n caller: Address;\n accountId: number;\n commands: Command[];\n nonce: number;\n deadline: number;\n extraSignatureData: string;\n };\n };\n};\n\nexport function convertEthersSignatureToEIP712Signature(\n signature: Signature,\n deadline: number,\n): EIP712Signature {\n return {\n v: signature.v,\n r: signature.r,\n s: signature.s,\n deadline,\n };\n}\n\nexport async function signCoreCommands(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n caller: Address,\n accountId: number,\n commands: Command[],\n nonce: number,\n deadline: number,\n extraSignatureData: string,\n): Promise<CoreCommandsEIP712SignatureAndPayload> {\n const types = {\n ExecuteBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'caller', type: 'address' },\n { name: 'accountId', type: 'uint128' },\n { name: 'commands', type: 'Command[]' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n { name: 'extraSignatureData', type: 'bytes' },\n ],\n Command: [\n { name: 'commandType', type: 'uint8' },\n { name: 'inputs', type: 'bytes' },\n { name: 'marketId', type: 'uint128' },\n { name: 'exchangeId', type: 'uint128' },\n ],\n };\n\n const value = {\n verifyingChainId: reyaChainId,\n caller: caller,\n accountId: accountId,\n commands: commands,\n nonce: nonce,\n deadline: deadline,\n extraSignatureData: extraSignatureData,\n };\n\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.CORE_PROXY),\n types,\n value,\n );\n\n const eip712Signature = convertEthersSignatureToEIP712Signature(\n signature,\n deadline,\n );\n\n return {\n signature: eip712Signature,\n payload: {\n verifyingContract: getAddress(reyaChainId, ContractType.CORE_PROXY),\n types: types,\n value: value,\n },\n };\n}\n\nexport async function signPoolRemoveLiquidity(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n caller: Address,\n owner: Address,\n poolId: number,\n sharesAmount: bigint,\n minOut: bigint,\n nonce: number,\n deadline: number,\n extraSignatureData: string,\n): Promise<EIP712Signature> {\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.PASSIVE_POOL_PROXY),\n {\n RemoveLiquidityBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'caller', type: 'address' },\n { name: 'owner', type: 'address' },\n { name: 'poolId', type: 'uint128' },\n { name: 'sharesAmount', type: 'uint256' },\n { name: 'minOut', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n { name: 'extraSignatureData', type: 'bytes' },\n ],\n },\n {\n verifyingChainId: reyaChainId,\n caller: caller,\n owner: owner,\n poolId: poolId,\n sharesAmount: sharesAmount,\n minOut: minOut,\n nonce: nonce,\n deadline: deadline,\n extraSignatureData: extraSignatureData,\n },\n );\n\n return convertEthersSignatureToEIP712Signature(signature, deadline);\n}\n\nasync function signReyaTypedData(\n signer: Signer | JsonRpcSigner,\n verifyingContract: string,\n types: Record<string, Array<TypedDataField>>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: Record<string, any>,\n): Promise<Signature> {\n const domain = getReyaDomain(verifyingContract);\n\n const signatureString = await signer.signTypedData(domain, types, value);\n\n return Signature.from(signatureString);\n}\n\nfunction getReyaDomain(verifyingContract: string) {\n return {\n name: 'Reya',\n version: '1',\n verifyingContract: verifyingContract,\n };\n}\n\nconst conditionalOrderTypes = {\n ConditionalOrder: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n { name: 'order', type: 'ConditionalOrderDetails' },\n ],\n ConditionalOrderDetails: [\n { name: 'accountId', type: 'uint128' },\n { name: 'marketId', type: 'uint128' },\n { name: 'exchangeId', type: 'uint128' },\n { name: 'counterpartyAccountIds', type: 'uint128[]' },\n { name: 'orderType', type: 'uint8' },\n { name: 'inputs', type: 'bytes' },\n { name: 'signer', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n ],\n};\n\nexport function createOrdersGatewayOrderNonce(\n accountId: number,\n marketId: number,\n timestampMs: number,\n): bigint {\n // Validate the input ranges\n if (marketId < 0 || marketId >= 2 ** 32)\n throw new Error('marketId is out of range');\n if (accountId < 0 || accountId >= 2 ** 128)\n throw new Error('accountId is out of range');\n if (timestampMs < 0 || timestampMs >= 2 ** 64)\n throw new Error('timestamp is out of range');\n\n const hashUint256 =\n (BigInt(accountId) << BigInt(98)) |\n (BigInt(timestampMs) << BigInt(32)) |\n BigInt(marketId);\n\n return hashUint256;\n}\n\ntype SignOrdersGatewayOrderOutput = {\n serializedSignature: string;\n nonce: bigint;\n signature: EIP712Signature;\n};\n\nexport async function signOrdersGatewayOrder(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n accountId: number,\n marketId: number,\n exchangeId: number,\n counterpartyAccountIds: number[],\n orderType: ConditionalOrderType | OrdersGatewayOrderType,\n inputs: string,\n deadline: number,\n creationTimestampMs: number,\n): Promise<SignOrdersGatewayOrderOutput> {\n const nonce = createOrdersGatewayOrderNonce(\n accountId,\n marketId,\n creationTimestampMs,\n );\n\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.ORDERS_GATEWAY_PROXY),\n conditionalOrderTypes,\n {\n verifyingChainId: reyaChainId,\n deadline: BigInt(deadline),\n order: {\n accountId: accountId,\n marketId: marketId,\n exchangeId: exchangeId,\n counterpartyAccountIds: counterpartyAccountIds,\n orderType: orderType,\n inputs: inputs,\n signer: await signer.getAddress(),\n nonce: nonce,\n },\n },\n );\n\n return {\n serializedSignature: signature.serialized,\n nonce,\n signature: convertEthersSignatureToEIP712Signature(signature, deadline),\n };\n}\n\nexport function isConditionalOrderSignatureValid(\n signerAddress: string,\n signature: string,\n reyaChainId: ReyaChainId,\n accountId: number,\n marketId: number,\n exchangeId: number,\n counterpartyAccountIds: number[],\n orderType: number,\n inputs: string,\n nonce: bigint,\n deadline: number,\n): boolean {\n // Encode the data for recovering the address\n const domain = getReyaDomain(\n getAddress(reyaChainId, ContractType.CONDITIONAL_ORDERS_PROXY),\n );\n\n const value = {\n verifyingChainId: reyaChainId,\n deadline: BigInt(deadline),\n order: {\n accountId: accountId,\n marketId: marketId,\n exchangeId: exchangeId,\n counterpartyAccountIds: counterpartyAccountIds,\n orderType: orderType,\n inputs: inputs,\n signer: signerAddress,\n nonce: nonce,\n },\n };\n\n // Recover the address\n const recoveredAddress = verifyTypedData(\n domain,\n conditionalOrderTypes,\n value,\n signature,\n );\n\n return recoveredAddress.toLowerCase() === signerAddress.toLowerCase();\n}\n\nexport async function signCancelConditionalOrder(\n signer: Signer | JsonRpcSigner,\n orderId: string,\n): Promise<string> {\n const message = {\n orderId: orderId,\n status: ConditionalOrderStatus.CANCELLED,\n actionType: 'changeStatus',\n };\n return await signer.signMessage(JSON.stringify(message));\n}\n\nexport async function signGrantPermission(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n accountId: number,\n permission: string,\n user: string,\n nonce: number,\n deadline: number,\n): Promise<EIP712Signature> {\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.CORE_PROXY),\n {\n GrantAccountPermissionBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'accountId', type: 'uint128' },\n { name: 'permission', type: 'bytes32' },\n { name: 'user', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n {\n verifyingChainId: reyaChainId,\n accountId: accountId,\n permission: permission,\n user: user,\n nonce: nonce,\n deadline: deadline,\n },\n );\n\n return convertEthersSignatureToEIP712Signature(signature, deadline);\n}\n\nexport async function signVote(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n contractAddress: string,\n voter: string,\n isYesVote: boolean,\n deadline: number,\n): Promise<string> {\n const types = {\n CastVoteBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'voter', type: 'address' },\n { name: 'yesVote', type: 'bool' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n };\n const values = {\n verifyingChainId: reyaChainId,\n voter: voter,\n yesVote: isYesVote,\n nonce: 1, // hardcoded because a user cannot vote more than once\n deadline: deadline,\n };\n\n const domain = getReyaDomain(contractAddress);\n\n const signatureString = await signer.signTypedData(domain, types, values);\n\n return signatureString;\n}\n\nexport async function signRevokePermission(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n accountId: number,\n permission: string,\n user: string,\n nonce: number,\n deadline: number,\n): Promise<EIP712Signature> {\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.CORE_PROXY),\n {\n RevokeAccountPermissionBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'accountId', type: 'uint128' },\n { name: 'permission', type: 'bytes32' },\n { name: 'user', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n {\n verifyingChainId: reyaChainId,\n accountId: accountId,\n permission: permission,\n user: user,\n nonce: nonce,\n deadline: deadline,\n },\n );\n\n return convertEthersSignatureToEIP712Signature(signature, deadline);\n}\n\nexport const signManagePermissionBySig = async (\n signer: Signer | JsonRpcSigner,\n signerAddress: string,\n reyaChainId: ReyaChainId,\n targetAddress: string,\n permissionState: boolean,\n deadline: number,\n): Promise<EIP712Signature> => {\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.ORDERS_GATEWAY_PROXY),\n {\n ManagePermissionBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'owner', type: 'address' },\n { name: 'target', type: 'address' },\n { name: 'permissionState', type: 'bool' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n {\n verifyingChainId: reyaChainId,\n owner: signerAddress,\n target: targetAddress,\n permissionState: permissionState,\n deadline: deadline,\n },\n );\n\n return convertEthersSignatureToEI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Q;qBACnB,CACF,EAAA;;oBArBK,SAAS,GAAG,SAqBjB;oBAED,sBAAO,uCAAuC,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAC;;;;CACrE;AAjCD,oDAiCC;AAEM,IAAM,yBAAyB,GAAG,UACvC,MAA8B,EAC9B,aAAqB,EACrB,WAAwB,EACxB,aAAqB,EACrB,eAAwB,EACxB,QAAgB;;;;oBAEE,qBAAM,iBAAiB,CACvC,MAAM,EACN,IAAA,8BAAU,EAAC,WAAW,EAAE,gCAAY,CAAC,oBAAoB,CAAC,EAC1D;oBACE,qBAAqB,EAAE;wBACrB,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;wBAC7C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;wBAClC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;wBACnC,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE;wBACzC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;qBACtC;iBACF,EACD;oBACE,gBAAgB,EAAE,WAAW;oBAC7B,KAAK,EAAE,aAAa;oBACpB,MAAM,EAAE,aAAa;oBACrB,eAAe,EAAE,eAAe;oBAChC,QAAQ,EAAE,QAAQ;iBACnB,CACF,EAAA;;gBAnBK,SAAS,GAAG,SAmBjB;gBAED,sBAAO,uCAAuC,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAC;;;KACrE,CAAC;AA9BW,QAAA,yBAAyB,6BA8BpC","sourcesContent":["import {\n JsonRpcSigner,\n Signature,\n Signer,\n TypedDataField,\n verifyTypedData,\n} from 'ethers';\nimport { ContractType, getAddress } from './contractAddresses';\nimport { Command } from './action';\nimport {\n Address,\n ConditionalOrderStatus,\n ConditionalOrderType,\n OrdersGatewayOrderType,\n ReyaChainId,\n} from '../types';\n\nexport type EIP712Signature = {\n v: number;\n r: string;\n s: string;\n deadline: number;\n};\n\nexport type CoreCommandsEIP712SignatureAndPayload = {\n signature: EIP712Signature;\n payload: {\n verifyingContract: string;\n types: Record<string, Array<TypedDataField>>;\n value: {\n verifyingChainId: number;\n caller: Address;\n accountId: number;\n commands: Command[];\n nonce: number;\n deadline: number;\n extraSignatureData: string;\n };\n };\n};\n\nexport function convertEthersSignatureToEIP712Signature(\n signature: Signature,\n deadline: number,\n): EIP712Signature {\n return {\n v: signature.v,\n r: signature.r,\n s: signature.s,\n deadline,\n };\n}\n\nexport async function signCoreCommands(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n caller: Address,\n accountId: number,\n commands: Command[],\n nonce: number,\n deadline: number,\n extraSignatureData: string,\n): Promise<CoreCommandsEIP712SignatureAndPayload> {\n const types = {\n ExecuteBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'caller', type: 'address' },\n { name: 'accountId', type: 'uint128' },\n { name: 'commands', type: 'Command[]' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n { name: 'extraSignatureData', type: 'bytes' },\n ],\n Command: [\n { name: 'commandType', type: 'uint8' },\n { name: 'inputs', type: 'bytes' },\n { name: 'marketId', type: 'uint128' },\n { name: 'exchangeId', type: 'uint128' },\n ],\n };\n\n const value = {\n verifyingChainId: reyaChainId,\n caller: caller,\n accountId: accountId,\n commands: commands,\n nonce: nonce,\n deadline: deadline,\n extraSignatureData: extraSignatureData,\n };\n\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.CORE_PROXY),\n types,\n value,\n );\n\n const eip712Signature = convertEthersSignatureToEIP712Signature(\n signature,\n deadline,\n );\n\n return {\n signature: eip712Signature,\n payload: {\n verifyingContract: getAddress(reyaChainId, ContractType.CORE_PROXY),\n types: types,\n value: value,\n },\n };\n}\n\nexport async function signPoolRemoveLiquidity(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n caller: Address,\n owner: Address,\n poolId: number,\n sharesAmount: bigint,\n minOut: bigint,\n nonce: number,\n deadline: number,\n extraSignatureData: string,\n): Promise<EIP712Signature> {\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.PASSIVE_POOL_PROXY),\n {\n RemoveLiquidityBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'caller', type: 'address' },\n { name: 'owner', type: 'address' },\n { name: 'poolId', type: 'uint128' },\n { name: 'sharesAmount', type: 'uint256' },\n { name: 'minOut', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n { name: 'extraSignatureData', type: 'bytes' },\n ],\n },\n {\n verifyingChainId: reyaChainId,\n caller: caller,\n owner: owner,\n poolId: poolId,\n sharesAmount: sharesAmount,\n minOut: minOut,\n nonce: nonce,\n deadline: deadline,\n extraSignatureData: extraSignatureData,\n },\n );\n\n return convertEthersSignatureToEIP712Signature(signature, deadline);\n}\n\nasync function signReyaTypedData(\n signer: Signer | JsonRpcSigner,\n verifyingContract: string,\n types: Record<string, Array<TypedDataField>>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: Record<string, any>,\n): Promise<Signature> {\n const domain = getReyaDomain(verifyingContract);\n\n const signatureString = await signer.signTypedData(domain, types, value);\n\n return Signature.from(signatureString);\n}\n\nfunction getReyaDomain(verifyingContract: string) {\n return {\n name: 'Reya',\n version: '1',\n verifyingContract: verifyingContract,\n };\n}\n\nconst conditionalOrderTypes = {\n ConditionalOrder: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n { name: 'order', type: 'ConditionalOrderDetails' },\n ],\n ConditionalOrderDetails: [\n { name: 'accountId', type: 'uint128' },\n { name: 'marketId', type: 'uint128' },\n { name: 'exchangeId', type: 'uint128' },\n { name: 'counterpartyAccountIds', type: 'uint128[]' },\n { name: 'orderType', type: 'uint8' },\n { name: 'inputs', type: 'bytes' },\n { name: 'signer', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n ],\n};\n\nexport function createOrdersGatewayOrderNonce(\n accountId: number,\n marketId: number,\n timestampMs: number,\n): bigint {\n // Validate the input ranges\n if (marketId < 0 || marketId >= 2 ** 32)\n throw new Error('marketId is out of range');\n if (accountId < 0 || accountId >= 2 ** 128)\n throw new Error('accountId is out of range');\n if (timestampMs < 0 || timestampMs >= 2 ** 64)\n throw new Error('timestamp is out of range');\n\n const hashUint256 =\n (BigInt(accountId) << BigInt(98)) |\n (BigInt(timestampMs) << BigInt(32)) |\n BigInt(marketId);\n\n return hashUint256;\n}\n\ntype SignOrdersGatewayOrderOutput = {\n serializedSignature: string;\n nonce: bigint;\n signature: EIP712Signature;\n};\n\nexport async function signOrdersGatewayOrder(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n accountId: number,\n marketId: number,\n exchangeId: number,\n counterpartyAccountIds: number[],\n orderType: ConditionalOrderType | OrdersGatewayOrderType,\n inputs: string,\n deadline: number,\n creationTimestampMs: number,\n customNonce?: bigint,\n): Promise<SignOrdersGatewayOrderOutput> {\n const nonce =\n customNonce ??\n createOrdersGatewayOrderNonce(accountId, marketId, creationTimestampMs);\n\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.ORDERS_GATEWAY_PROXY),\n conditionalOrderTypes,\n {\n verifyingChainId: reyaChainId,\n deadline: BigInt(deadline),\n order: {\n accountId: accountId,\n marketId: marketId,\n exchangeId: exchangeId,\n counterpartyAccountIds: counterpartyAccountIds,\n orderType: orderType,\n inputs: inputs,\n signer: await signer.getAddress(),\n nonce: nonce,\n },\n },\n );\n\n return {\n serializedSignature: signature.serialized,\n nonce,\n signature: convertEthersSignatureToEIP712Signature(signature, deadline),\n };\n}\n\nexport function isConditionalOrderSignatureValid(\n signerAddress: string,\n signature: string,\n reyaChainId: ReyaChainId,\n accountId: number,\n marketId: number,\n exchangeId: number,\n counterpartyAccountIds: number[],\n orderType: number,\n inputs: string,\n nonce: bigint,\n deadline: number,\n): boolean {\n // Encode the data for recovering the address\n const domain = getReyaDomain(\n getAddress(reyaChainId, ContractType.CONDITIONAL_ORDERS_PROXY),\n );\n\n const value = {\n verifyingChainId: reyaChainId,\n deadline: BigInt(deadline),\n order: {\n accountId: accountId,\n marketId: marketId,\n exchangeId: exchangeId,\n counterpartyAccountIds: counterpartyAccountIds,\n orderType: orderType,\n inputs: inputs,\n signer: signerAddress,\n nonce: nonce,\n },\n };\n\n // Recover the address\n const recoveredAddress = verifyTypedData(\n domain,\n conditionalOrderTypes,\n value,\n signature,\n );\n\n return recoveredAddress.toLowerCase() === signerAddress.toLowerCase();\n}\n\nexport async function signCancelConditionalOrder(\n signer: Signer | JsonRpcSigner,\n orderId: string,\n): Promise<string> {\n const message = {\n orderId: orderId,\n status: ConditionalOrderStatus.CANCELLED,\n actionType: 'changeStatus',\n };\n return await signer.signMessage(JSON.stringify(message));\n}\n\nexport async function signGrantPermission(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n accountId: number,\n permission: string,\n user: string,\n nonce: number,\n deadline: number,\n): Promise<EIP712Signature> {\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.CORE_PROXY),\n {\n GrantAccountPermissionBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'accountId', type: 'uint128' },\n { name: 'permission', type: 'bytes32' },\n { name: 'user', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n {\n verifyingChainId: reyaChainId,\n accountId: accountId,\n permission: permission,\n user: user,\n nonce: nonce,\n deadline: deadline,\n },\n );\n\n return convertEthersSignatureToEIP712Signature(signature, deadline);\n}\n\nexport async function signVote(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n contractAddress: string,\n voter: string,\n isYesVote: boolean,\n deadline: number,\n): Promise<string> {\n const types = {\n CastVoteBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'voter', type: 'address' },\n { name: 'yesVote', type: 'bool' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n };\n const values = {\n verifyingChainId: reyaChainId,\n voter: voter,\n yesVote: isYesVote,\n nonce: 1, // hardcoded because a user cannot vote more than once\n deadline: deadline,\n };\n\n const domain = getReyaDomain(contractAddress);\n\n const signatureString = await signer.signTypedData(domain, types, values);\n\n return signatureString;\n}\n\nexport async function signRevokePermission(\n signer: Signer | JsonRpcSigner,\n reyaChainId: ReyaChainId,\n accountId: number,\n permission: string,\n user: string,\n nonce: number,\n deadline: number,\n): Promise<EIP712Signature> {\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.CORE_PROXY),\n {\n RevokeAccountPermissionBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'accountId', type: 'uint128' },\n { name: 'permission', type: 'bytes32' },\n { name: 'user', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n {\n verifyingChainId: reyaChainId,\n accountId: accountId,\n permission: permission,\n user: user,\n nonce: nonce,\n deadline: deadline,\n },\n );\n\n return convertEthersSignatureToEIP712Signature(signature, deadline);\n}\n\nexport const signManagePermissionBySig = async (\n signer: Signer | JsonRpcSigner,\n signerAddress: string,\n reyaChainId: ReyaChainId,\n targetAddress: string,\n permissionState: boolean,\n deadline: number,\n): Promise<EIP712Signature> => {\n const signature = await signReyaTypedData(\n signer,\n getAddress(reyaChainId, ContractType.ORDERS_GATEWAY_PROXY),\n {\n ManagePermissionBySig: [\n { name: 'verifyingChainId', type: 'uint256' },\n { name: 'owner', type: 'address' },\n { name: 'target', type: 'address' },\n { name: 'permissionState', type: 'bool' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n {\n verifyingChainId: reyaChainId,\n owner: signerAddress,\n target: targetAddress,\n permissionState: permissionState,\n deadline: deadline,\n },\n );\n\n return convertEthersSignatureToEIP712Signature(signature, deadline);\n};\n"]}
@@ -126,6 +126,36 @@ type AccountBalance = {
126
126
  balance?: Decimal | null;
127
127
  delta?: Decimal | null;
128
128
  };
129
+ type spot_execution = {
130
+ account_id: Decimal;
131
+ counterparty_account_id: Decimal;
132
+ exchange_id: Decimal;
133
+ executed_base: Decimal;
134
+ price: Decimal;
135
+ account_order_id: bigint;
136
+ counterparty_order_id: bigint;
137
+ spot_market_id: Decimal;
138
+ is_auto_exchange: boolean;
139
+ is_long: boolean;
140
+ event_sequence_number: bigint;
141
+ parent_event_sequence_number: bigint | null;
142
+ block_timestamp: Decimal;
143
+ block_number: Decimal;
144
+ transaction_hash: string;
145
+ created_at: string;
146
+ };
147
+ type account_real_balance = {
148
+ account_id: Decimal;
149
+ collateral: string;
150
+ balance: Decimal;
151
+ rpnl: Decimal;
152
+ event_sequence_number: bigint | null;
153
+ transfer_event_sequence_number: bigint | null;
154
+ parent_event_sequence_number: bigint | null;
155
+ block_timestamp: Decimal;
156
+ block_number: Decimal;
157
+ transaction_hash: string;
158
+ };
129
159
  type AutoExchange = {
130
160
  id: string;
131
161
  liquidated_account_id: Decimal | null;
@@ -446,7 +476,7 @@ type positions_migration = {
446
476
  referrer_account_id: Decimal | null;
447
477
  referrer_fee_credit: Decimal | null;
448
478
  };
449
- type ReplicationMessage = Exclude<TradingApiSource[keyof TradingApiSource]['replication'], never> | GenericReplicationMessage<account_owner_updated_snapshot, 'account_owner_updated_snapshot'> | GenericReplicationMessage<account_collateral_balance_entries, 'account_collateral_balance_entries'> | GenericReplicationMessage<ConditionalOrderSensitive, 'ConditionalOrdersSensitive'> | GenericReplicationMessage<positions_migration, 'positions_migration'>;
479
+ type ReplicationMessage = Exclude<TradingApiSource[keyof TradingApiSource]['replication'], never> | GenericReplicationMessage<account_owner_updated_snapshot, 'account_owner_updated_snapshot'> | GenericReplicationMessage<account_collateral_balance_entries, 'account_collateral_balance_entries'> | GenericReplicationMessage<ConditionalOrderSensitive, 'ConditionalOrdersSensitive'> | GenericReplicationMessage<positions_migration, 'positions_migration'> | GenericReplicationMessage<account_real_balance, 'account_real_balances'> | GenericReplicationMessage<spot_execution, 'spot_executions'>;
450
480
  export type Replication = {
451
481
  [K in ReplicationMessage as `replication:${K['model']}`]: Extract<ReplicationMessage, {
452
482
  model: K['model'];
@@ -1 +1 @@
1
- {"version":3,"file":"trading-api-types.d.ts","sourceRoot":"/","sources":["trading-api-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EACL,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,eAAe,EACf,OAAO,EACP,oBAAoB,EACpB,WAAW,EACZ,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,MAAM,MAAM,aAAa,GACvB,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,KAAK,gBAAgB,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC;AAEtE,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,OAAO,GAAG,IAAI,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MAAM,GAAG,IAAI,CAAC;IACzB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,KAAK,kBAAkB,GAEnB,OAAO,CAAC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,GAEvE,yBAAyB,CACvB,8BAA8B,EAC9B,gCAAgC,CACjC,GACD,yBAAyB,CACvB,kCAAkC,EAClC,oCAAoC,CACrC,GACD,yBAAyB,CACvB,yBAAyB,EACzB,4BAA4B,CAC7B,GACD,yBAAyB,CAEvB,mBAAmB,EACnB,qBAAqB,CACtB,GACD,yBAAyB,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GACxE,yBAAyB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG;KACvB,CAAC,IAAI,kBAAkB,IAAI,eAAe,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,CAC/D,kBAAkB,EAClB;QAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;KAAE,CACtB;CACF,CAAC"}
@@ -32,7 +32,7 @@ type SignOrdersGatewayOrderOutput = {
32
32
  nonce: bigint;
33
33
  signature: EIP712Signature;
34
34
  };
35
- export declare function signOrdersGatewayOrder(signer: Signer | JsonRpcSigner, reyaChainId: ReyaChainId, accountId: number, marketId: number, exchangeId: number, counterpartyAccountIds: number[], orderType: ConditionalOrderType | OrdersGatewayOrderType, inputs: string, deadline: number, creationTimestampMs: number): Promise<SignOrdersGatewayOrderOutput>;
35
+ export declare function signOrdersGatewayOrder(signer: Signer | JsonRpcSigner, reyaChainId: ReyaChainId, accountId: number, marketId: number, exchangeId: number, counterpartyAccountIds: number[], orderType: ConditionalOrderType | OrdersGatewayOrderType, inputs: string, deadline: number, creationTimestampMs: number, customNonce?: bigint): Promise<SignOrdersGatewayOrderOutput>;
36
36
  export declare function isConditionalOrderSignatureValid(signerAddress: string, signature: string, reyaChainId: ReyaChainId, accountId: number, marketId: number, exchangeId: number, counterpartyAccountIds: number[], orderType: number, inputs: string, nonce: bigint, deadline: number): boolean;
37
37
  export declare function signCancelConditionalOrder(signer: Signer | JsonRpcSigner, orderId: string): Promise<string>;
38
38
  export declare function signGrantPermission(signer: Signer | JsonRpcSigner, reyaChainId: ReyaChainId, accountId: number, permission: string, user: string, nonce: number, deadline: number): Promise<EIP712Signature>;
@@ -1 +1 @@
1
- {"version":3,"file":"sign.d.ts","sourceRoot":"/","sources":["transactions/sign.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,MAAM,EACN,cAAc,EAEf,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EACL,OAAO,EAEP,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACZ,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IAClD,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE;QACP,iBAAiB,EAAE,MAAM,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;QAC7C,KAAK,EAAE;YACL,gBAAgB,EAAE,MAAM,CAAC;YACzB,MAAM,EAAE,OAAO,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;YAClB,QAAQ,EAAE,OAAO,EAAE,CAAC;YACpB,KAAK,EAAE,MAAM,CAAC;YACd,QAAQ,EAAE,MAAM,CAAC;YACjB,kBAAkB,EAA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yz/common",
3
- "version": "0.327.0",
3
+ "version": "0.327.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -44,5 +44,5 @@
44
44
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
45
45
  },
46
46
  "packageManager": "pnpm@8.3.1",
47
- "gitHead": "7a37da52b9b99615ae31b1ec1338171f8c7280fc"
47
+ "gitHead": "a976a91d06fb802141215ad1e28dd68e9c6919cf"
48
48
  }
@@ -147,6 +147,38 @@ type AccountBalance = {
147
147
  delta?: Decimal | null;
148
148
  };
149
149
 
150
+ type spot_execution = {
151
+ account_id: Decimal;
152
+ counterparty_account_id: Decimal;
153
+ exchange_id: Decimal;
154
+ executed_base: Decimal;
155
+ price: Decimal;
156
+ account_order_id: bigint;
157
+ counterparty_order_id: bigint;
158
+ spot_market_id: Decimal;
159
+ is_auto_exchange: boolean;
160
+ is_long: boolean;
161
+ event_sequence_number: bigint;
162
+ parent_event_sequence_number: bigint | null;
163
+ block_timestamp: Decimal;
164
+ block_number: Decimal;
165
+ transaction_hash: string;
166
+ created_at: string;
167
+ };
168
+
169
+ type account_real_balance = {
170
+ account_id: Decimal;
171
+ collateral: string;
172
+ balance: Decimal;
173
+ rpnl: Decimal;
174
+ event_sequence_number: bigint | null;
175
+ transfer_event_sequence_number: bigint | null;
176
+ parent_event_sequence_number: bigint | null;
177
+ block_timestamp: Decimal;
178
+ block_number: Decimal;
179
+ transaction_hash: string;
180
+ };
181
+
150
182
  type AutoExchange = {
151
183
  id: string;
152
184
  liquidated_account_id: Decimal | null;
@@ -625,7 +657,9 @@ type ReplicationMessage =
625
657
  // Todo: remove after migration
626
658
  positions_migration,
627
659
  'positions_migration'
628
- >;
660
+ >
661
+ | GenericReplicationMessage<account_real_balance, 'account_real_balances'>
662
+ | GenericReplicationMessage<spot_execution, 'spot_executions'>;
629
663
 
630
664
  export type Replication = {
631
665
  [K in ReplicationMessage as `replication:${K['model']}`]: Extract<
@@ -233,12 +233,11 @@ export async function signOrdersGatewayOrder(
233
233
  inputs: string,
234
234
  deadline: number,
235
235
  creationTimestampMs: number,
236
+ customNonce?: bigint,
236
237
  ): Promise<SignOrdersGatewayOrderOutput> {
237
- const nonce = createOrdersGatewayOrderNonce(
238
- accountId,
239
- marketId,
240
- creationTimestampMs,
241
- );
238
+ const nonce =
239
+ customNonce ??
240
+ createOrdersGatewayOrderNonce(accountId, marketId, creationTimestampMs);
242
241
 
243
242
  const signature = await signReyaTypedData(
244
243
  signer,