@reyaxyz/common 0.273.0 → 0.274.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/rest/helpers/constants.js +2 -2
- package/dist/rest/helpers/constants.js.map +1 -1
- package/dist/trading-api-types.js.map +1 -1
- package/dist/transactions/contractAddresses.js +0 -3
- package/dist/transactions/contractAddresses.js.map +1 -1
- package/dist/transactions/executeTransaction.js +4 -3
- package/dist/transactions/executeTransaction.js.map +1 -1
- package/dist/transactions/routerCommands.js +1 -5
- package/dist/transactions/routerCommands.js.map +1 -1
- package/dist/types/trading-api-types.d.ts +36 -43
- package/dist/types/trading-api-types.d.ts.map +1 -1
- package/dist/types/transactions/contractAddresses.d.ts +0 -1
- package/dist/types/transactions/contractAddresses.d.ts.map +1 -1
- package/dist/types/transactions/executeTransaction.d.ts +0 -3
- package/dist/types/transactions/executeTransaction.d.ts.map +1 -1
- package/dist/types/transactions/routerCommands.d.ts +1 -2
- package/dist/types/transactions/routerCommands.d.ts.map +1 -1
- package/dist/types/types.d.ts +15 -30
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/network.d.ts +0 -1
- package/dist/types/utils/network.d.ts.map +1 -1
- package/dist/types.js +5 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/network.js +3 -4
- package/dist/utils/network.js.map +1 -1
- package/package.json +2 -2
- package/src/rest/helpers/constants.ts +2 -2
- package/src/trading-api-types.ts +55 -53
- package/src/transactions/contractAddresses.ts +0 -5
- package/src/transactions/executeTransaction.ts +2 -1
- package/src/transactions/routerCommands.ts +0 -4
- package/src/types.ts +21 -34
- package/src/utils/network.ts +1 -2
package/README.md
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
|
|
7
7
|
| Statements | Branches | Functions | Lines |
|
|
8
8
|
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
|
|
9
|
-
|  |  |  |  |
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ var getEnvVar = function (name, fallback) {
|
|
|
12
12
|
var API_CLIENT_CONFIGS = {
|
|
13
13
|
localtestnet: {
|
|
14
14
|
chain: types_1.ReyaChainId.reyaCronos,
|
|
15
|
-
apiEndpoint: 'http://localhost:
|
|
15
|
+
apiEndpoint: 'http://localhost:8000',
|
|
16
16
|
webSocketEndpoint: 'ws://localhost:8080',
|
|
17
17
|
environment: 'localtestnet',
|
|
18
18
|
timeout: utils_1.API_TIMEOUT,
|
|
@@ -20,7 +20,7 @@ var API_CLIENT_CONFIGS = {
|
|
|
20
20
|
},
|
|
21
21
|
localmainnet: {
|
|
22
22
|
chain: types_1.ReyaChainId.reyaNetwork,
|
|
23
|
-
apiEndpoint: 'http://localhost:
|
|
23
|
+
apiEndpoint: 'http://localhost:8000',
|
|
24
24
|
webSocketEndpoint: 'ws://localhost:8080',
|
|
25
25
|
environment: 'localmainnet',
|
|
26
26
|
timeout: utils_1.API_TIMEOUT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"/","sources":["rest/helpers/constants.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,qCAA0C;AAkB1C,IAAM,SAAS,GAAG,UAAC,IAAY,EAAE,QAAgB;IAC/C,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACvE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAW,CAAC;IACrC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,IAAM,kBAAkB,GAA8C;IACpE,YAAY,EAAE;QACZ,KAAK,EAAE,mBAAW,CAAC,UAAU;QAC7B,WAAW,EAAE,uBAAuB;QACpC,iBAAiB,EAAE,qBAAqB;QACxC,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,mBAAW;QACpB,OAAO,EAAE,IAAI;KACd;IACD,YAAY,E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IMEOUT } from '../../utils';\nimport { ReyaChainId } from '../../types';\n\nexport type ServiceEnvironment =\n | 'production'\n | 'staging'\n | 'test'\n | 'localmainnet'\n | 'localtestnet';\n\nexport interface ServiceConfig {\n chain: ReyaChainId;\n apiEndpoint: string;\n webSocketEndpoint: string;\n environment: ServiceEnvironment; // Configuration for SDK, such as base URL for the REST API\n timeout: number; // Optional timeout for API requests\n logging: boolean;\n}\n\nconst getEnvVar = (name: string, fallback: string): string => {\n if (typeof process !== 'undefined' && process.env && process.env[name]) {\n return process.env[name] as string;\n }\n return fallback;\n};\n\nconst API_CLIENT_CONFIGS: Record<ServiceEnvironment, ServiceConfig> = {\n localtestnet: {\n chain: ReyaChainId.reyaCronos,\n apiEndpoint: 'http://localhost:
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"/","sources":["rest/helpers/constants.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,qCAA0C;AAkB1C,IAAM,SAAS,GAAG,UAAC,IAAY,EAAE,QAAgB;IAC/C,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACvE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAW,CAAC;IACrC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,IAAM,kBAAkB,GAA8C;IACpE,YAAY,EAAE;QACZ,KAAK,EAAE,mBAAW,CAAC,UAAU;QAC7B,WAAW,EAAE,uBAAuB;QACpC,iBAAiB,EAAE,qBAAqB;QACxC,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,mBAAW;QACpB,OAAO,EAAE,IAAI;KACd;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,mBAAW,CAAC,WAAW;QAC9B,WAAW,EAAE,uBAAuB;QACpC,iBAAiB,EAAE,qBAAqB;QACxC,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,mBAAW;QACpB,OAAO,EAAE,IAAI;KACd;IACD,UAAU,EAAE;QACV,KAAK,EAAE,mBAAW,CAAC,WAAW;QAC9B,WAAW,EAAE,SAAS,CAAC,mBAAmB,EAAE,sBAAsB,CAAC;QACnE,iBAAiB,EAAE,SAAS,CAC1B,yBAAyB,EACzB,0BAA0B,CAC3B;QACD,WAAW,EAAE,SAAS,CACpB,kBAAkB,EAClB,YAAY,CACS;QACvB,OAAO,EAAE,mBAAW;QACpB,OAAO,EAAE,KAAK;KACf;IACD,OAAO,EAAE;QACP,KAAK,EAAE,mBAAW,CAAC,WAAW;QAC9B,WAAW,EAAE,SAAS,CAAC,mBAAmB,EAAE,8BAA8B,CAAC;QAC3E,iBAAiB,EAAE,SAAS,CAC1B,yBAAyB,EACzB,kCAAkC,CACnC;QACD,WAAW,EAAE,SAAS,CAAC,kBAAkB,EAAE,SAAS,CAAuB;QAC3E,OAAO,EAAE,mBAAW;QACpB,OAAO,EAAE,KAAK;KACf;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,mBAAW,CAAC,UAAU;QAC7B,WAAW,EAAE,SAAS,CAAC,mBAAmB,EAAE,6BAA6B,CAAC;QAC1E,iBAAiB,EAAE,SAAS,CAC1B,yBAAyB,EACzB,kCAAkC,CACnC;QACD,WAAW,EAAE,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAuB;QACxE,OAAO,EAAE,mBAAW;QACpB,OAAO,EAAE,IAAI;KACd;CACF,CAAC;AAEK,IAAM,kBAAkB,GAAG,UAAC,GAAuB;IACxD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAC/D,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B","sourcesContent":["import { API_TIMEOUT } from '../../utils';\nimport { ReyaChainId } from '../../types';\n\nexport type ServiceEnvironment =\n | 'production'\n | 'staging'\n | 'test'\n | 'localmainnet'\n | 'localtestnet';\n\nexport interface ServiceConfig {\n chain: ReyaChainId;\n apiEndpoint: string;\n webSocketEndpoint: string;\n environment: ServiceEnvironment; // Configuration for SDK, such as base URL for the REST API\n timeout: number; // Optional timeout for API requests\n logging: boolean;\n}\n\nconst getEnvVar = (name: string, fallback: string): string => {\n if (typeof process !== 'undefined' && process.env && process.env[name]) {\n return process.env[name] as string;\n }\n return fallback;\n};\n\nconst API_CLIENT_CONFIGS: Record<ServiceEnvironment, ServiceConfig> = {\n localtestnet: {\n chain: ReyaChainId.reyaCronos,\n apiEndpoint: 'http://localhost:8000',\n webSocketEndpoint: 'ws://localhost:8080',\n environment: 'localtestnet',\n timeout: API_TIMEOUT,\n logging: true,\n },\n localmainnet: {\n chain: ReyaChainId.reyaNetwork,\n apiEndpoint: 'http://localhost:8000',\n webSocketEndpoint: 'ws://localhost:8080',\n environment: 'localmainnet',\n timeout: API_TIMEOUT,\n logging: true,\n },\n production: {\n chain: ReyaChainId.reyaNetwork,\n apiEndpoint: getEnvVar('REYA_API_ENDPOINT', 'https://api.reya.xyz'),\n webSocketEndpoint: getEnvVar(\n 'REYA_WEBSOCKET_ENDPOINT',\n 'wss://websocket.reya.xyz',\n ),\n environment: getEnvVar(\n 'REYA_ENVIRONMENT',\n 'production',\n ) as ServiceEnvironment,\n timeout: API_TIMEOUT,\n logging: false,\n },\n staging: {\n chain: ReyaChainId.reyaNetwork,\n apiEndpoint: getEnvVar('REYA_API_ENDPOINT', 'https://api-staging.reya.xyz'),\n webSocketEndpoint: getEnvVar(\n 'REYA_WEBSOCKET_ENDPOINT',\n 'wss://websocket-staging.reya.xyz',\n ),\n environment: getEnvVar('REYA_ENVIRONMENT', 'staging') as ServiceEnvironment,\n timeout: API_TIMEOUT,\n logging: false,\n },\n test: {\n chain: ReyaChainId.reyaCronos,\n apiEndpoint: getEnvVar('REYA_API_ENDPOINT', 'https://api-cronos.reya.xyz'),\n webSocketEndpoint: getEnvVar(\n 'REYA_WEBSOCKET_ENDPOINT',\n 'wss://websocket-testnet.reya.xyz',\n ),\n environment: getEnvVar('REYA_ENVIRONMENT', 'test') as ServiceEnvironment,\n timeout: API_TIMEOUT,\n logging: true,\n },\n};\n\nexport const getApiClientConfig = (env: ServiceEnvironment): ServiceConfig => {\n return API_CLIENT_CONFIGS[env] || API_CLIENT_CONFIGS['test'];\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trading-api-types.js","sourceRoot":"/","sources":["trading-api-types.ts"],"names":[],"mappings":";;;AAmBa,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC","sourcesContent":["import { ParamsDictionary, Query } from 'express-serve-static-core';\nimport { AssetPair } from './types';\n\nexport type PaginatedQueryParams = {\n before: string;\n after: string;\n limit: string;\n direction: 'asc' | 'desc';\n};\n\nexport type PaginatedQueryMeta = {\n limit: number;\n count: number;\n before: bigint | null | undefined;\n after: bigint | null | undefined;\n};\n\nexport type Decimal = 'fake-decimal';\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 order_base: Decimal | null;\n fee: Decimal | null;\n price: Decimal | null;\n type: string;\n processed: boolean;\n transaction_hash: string;\n r_pnl: Decimal | null;\n price_variation_pnl: Decimal | null;\n funding_pnl: Decimal | null;\n average_entry_price: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n source: string | null;\n unique_id: bigint | null;\n created_at: Date;\n};\n\ntype Position = {\n market_id: Decimal;\n account_id: Decimal;\n base: Decimal | null;\n realized_pnl: Decimal | null;\n realized_pnl_latest_snapshot: Decimal | null;\n average_entry_price_off_chain_tracker: Decimal | null;\n funding_value_off_chain_tracker: Decimal | null;\n last_price: Decimal | null;\n position_data_last_price_data_timestamp: Decimal | null;\n funding_value: Decimal | null;\n base_multiplier: Decimal | null;\n adl_unwind_price: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | 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 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 status: string;\n creation_timestamp_ms: bigint;\n last_update_timestamp_ms: bigint;\n transaction_hash: string | null;\n};\n\ntype Swap = {\n id: string;\n account_id: Decimal;\n token_in: string;\n token_out: string;\n amount_in: Decimal;\n amount_out: Decimal;\n executed_amount_out: Decimal;\n transaction_hash: string;\n block_timestamp: Decimal;\n block_number: Decimal;\n unique_id: bigint | null;\n};\n\ntype Market = {\n id: Decimal;\n ticker: string;\n markPrice: number;\n isActive: boolean;\n maxLeverage: number;\n volume24H: number;\n priceChange24H: number;\n longOI: number;\n shortOI: number;\n availableLong: number;\n availableShort: number;\n marketPriceDeviation: number;\n riskBlockId: number;\n rootCollateralPoolId: number;\n description: string;\n name: string;\n quoteTokenId: string;\n tickSizeDecimals: number;\n underlyingAssetId: string;\n priceChange24HPercentage: number;\n openInterest: number;\n fundingRate: number;\n priority: number;\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 Price = {\n block_number: Decimal;\n unique_id: bigint | null;\n contract_id: string;\n price: Decimal | null;\n round_id: Decimal | null;\n timestamp: Decimal;\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\nexport type TradingApiEndpoint<\n Response,\n Params,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = never,\n> = {\n params: Params;\n query: Query;\n response: Response;\n replication: ReplicationTable extends never\n ? never\n : GenericReplicationMessage<Replication, ReplicationTable>;\n};\n\nexport type TradingApiListEndpoint<\n Response,\n Params = never,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = never,\n> = {\n params: Params;\n query: Query;\n response: Response[];\n replication: ReplicationTable extends never\n ? never\n : GenericReplicationMessage<Replication, ReplicationTable>;\n};\n\nexport type TradingApiInfiniteListEndpointResponse<Response> = {\n data: Response[];\n meta: PaginatedQueryMeta;\n};\n\nexport type TradingApiInfiniteListEndpoint<\n Response,\n Params = never,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = PaginatedQueryParams,\n> = {\n params: Params;\n query: Query;\n response: TradingApiInfiniteListEndpointResponse<Response>;\n replication: ReplicationTable extends never\n ? never\n : GenericReplicationMessage<Replication, ReplicationTable>;\n};\n\ntype AddressParam = {\n address: string;\n};\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/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 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 'wallet/:address/positions': TradingApiListEndpoint<\n Position,\n AddressParam,\n 'position_raw'\n >;\n 'wallet/:address/conditionalOrders': 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: TradingApiListEndpoint<Price>;\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/swaps': TradingApiInfiniteListEndpoint<\n Swap,\n AddressParam,\n 'swaps'\n >;\n 'market/:marketId/orders': TradingApiInfiniteListEndpoint<\n Order,\n {\n marketId: string;\n },\n 'order_history'\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/orders': TradingApiInfiniteListEndpoint<\n Order,\n {\n address: string;\n },\n 'order_history'\n >;\n 'wallet/:address/orders/:type': TradingApiInfiniteListEndpoint<\n Order,\n {\n address: string;\n type?: string;\n },\n 'order_history'\n >;\n riskMatrices: TradingApiListEndpoint<\n {\n blockId: Decimal;\n matrix: string[][];\n },\n {\n poolId: string;\n }\n >;\n markets: TradingApiListEndpoint<Market>;\n tierFees: TradingApiListEndpoint<{\n market_id: Decimal;\n tier_id: Decimal;\n fee_parameter: Decimal | null;\n }>;\n collateralConfiguration: TradingApiListEndpoint<{\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 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 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};\n\nexport type Stringified<T, D = Decimal> = T extends D | bigint | Date\n ? string\n : T extends (infer U)[]\n ? Stringified<U, D>[]\n : { [K in keyof T]: Stringified<T[K], D> };\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\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 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\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":";;;AAmBa,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';\n\nexport type PaginatedQueryParams = {\n before: string;\n after: string;\n limit: string;\n direction: 'asc' | 'desc';\n};\n\nexport type PaginatedQueryMeta = {\n limit: number;\n count: number;\n before: bigint | null | undefined;\n after: bigint | null | undefined;\n};\n\nexport type Decimal = 'fake-decimal';\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 order_base: Decimal | null;\n fee: Decimal | null;\n price: Decimal | null;\n type: string;\n processed: boolean;\n transaction_hash: string;\n r_pnl: Decimal | null;\n price_variation_pnl: Decimal | null;\n funding_pnl: Decimal | null;\n average_entry_price: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n source: string | null;\n unique_id: bigint | null;\n created_at: Date;\n};\n\ntype Position = {\n market_id: Decimal;\n account_id: Decimal;\n base: Decimal | null;\n realized_pnl: Decimal | null;\n realized_pnl_latest_snapshot: Decimal | null;\n average_entry_price_off_chain_tracker: Decimal | null;\n funding_value_off_chain_tracker: Decimal | null;\n last_price: Decimal | null;\n position_data_last_price_data_timestamp: Decimal | null;\n funding_value: Decimal | null;\n base_multiplier: Decimal | null;\n adl_unwind_price: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | 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 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 status: string;\n creation_timestamp_ms: bigint;\n last_update_timestamp_ms: bigint;\n transaction_hash: string | null;\n};\n\ntype Market = {\n id: Decimal;\n ticker: string;\n isActive: boolean;\n maxLeverage: number;\n description: string;\n name: string;\n tickSizeDecimals: number;\n priority: number;\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 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};\n\nexport type TradingApiEndpoint<\n Response,\n Params,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = never,\n> = {\n params: Params;\n query: Query;\n response: Response;\n replication: ReplicationTable extends never\n ? never\n : GenericReplicationMessage<Replication, ReplicationTable>;\n};\n\nexport type TradingApiListEndpoint<\n Response,\n Params = never,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = never,\n> = {\n params: Params;\n query: Query;\n response: Response[];\n replication: ReplicationTable extends never\n ? never\n : GenericReplicationMessage<Replication, ReplicationTable>;\n};\n\nexport type TradingApiInfiniteListEndpointResponse<Response> = {\n data: Response[];\n meta: PaginatedQueryMeta;\n};\n\nexport type TradingApiInfiniteListEndpoint<\n Response,\n Params = never,\n ReplicationTable extends ReplicationModel = never,\n Replication = Response,\n Query = PaginatedQueryParams,\n> = {\n params: Params;\n query: Query;\n response: TradingApiInfiniteListEndpointResponse<Response>;\n replication: ReplicationTable extends never\n ? never\n : GenericReplicationMessage<Replication, ReplicationTable>;\n};\n\ntype AddressParam = {\n address: string;\n};\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 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 '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/orders': TradingApiInfiniteListEndpoint<\n Order,\n {\n marketId: string;\n },\n 'order_history'\n >;\n 'wallet/:address/positions': TradingApiListEndpoint<\n Position,\n AddressParam,\n 'position_raw'\n >;\n 'wallet/:address/conditionalOrders': 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/orders': TradingApiInfiniteListEndpoint<\n Order,\n {\n address: string;\n },\n 'order_history'\n >;\n 'wallet/:address/orders/:type': TradingApiInfiniteListEndpoint<\n Order,\n {\n address: string;\n type?: string;\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 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 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 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};\n\nexport type Stringified<T, D = Decimal> = T extends D | bigint | Date\n ? string\n : T extends (infer U)[]\n ? Stringified<U, D>[]\n : { [K in keyof T]: Stringified<T[K], D> };\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\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 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\nexport type Replication = {\n [K in ReplicationMessage as `replication:${K['model']}`]: Extract<\n ReplicationMessage,\n { model: K['model'] }\n >;\n};\n"]}
|
|
@@ -12,7 +12,6 @@ var ContractType;
|
|
|
12
12
|
ContractType["PASSIVE_PERP_PROXY"] = "passive_perp_proxy";
|
|
13
13
|
ContractType["ORACLE_ADAPTERS_PROXY"] = "oracle_adapters_proxy";
|
|
14
14
|
ContractType["MULTICALL"] = "multicall";
|
|
15
|
-
ContractType["CAMELOT_YAK_ROUTER"] = "camelot_yak_router";
|
|
16
15
|
ContractType["REYA_SBTS"] = "reya_sbts";
|
|
17
16
|
})(ContractType || (exports.ContractType = ContractType = {}));
|
|
18
17
|
var addresses = (_a = {},
|
|
@@ -24,7 +23,6 @@ var addresses = (_a = {},
|
|
|
24
23
|
_b[ContractType.PASSIVE_PERP_PROXY] = '0x9ec177fed042ef2307928be2f5cdbf663b20244b',
|
|
25
24
|
_b[ContractType.ORACLE_ADAPTERS_PROXY] = '0xc501a2356703cd351703d68963c6f4136120f7cf',
|
|
26
25
|
_b[ContractType.MULTICALL] = '0x5abde4f0af8eaf3c9967f7fa126e59a103357b5c',
|
|
27
|
-
_b[ContractType.CAMELOT_YAK_ROUTER] = '0x2b59eb03865d18d8b62a5956bbbfae352fc1c148',
|
|
28
26
|
_b[ContractType.REYA_SBTS] = '0xc0092ea9179ace93b0cd8910958e335575562722',
|
|
29
27
|
_b),
|
|
30
28
|
_a[types_1.ReyaChainId.reyaNetwork] = (_c = {},
|
|
@@ -35,7 +33,6 @@ var addresses = (_a = {},
|
|
|
35
33
|
_c[ContractType.PASSIVE_PERP_PROXY] = '0x27e5cb712334e101b3c232eb0be198baaa595f5f',
|
|
36
34
|
_c[ContractType.ORACLE_ADAPTERS_PROXY] = '0x32edabc058c1207fe0ec5f8557643c28e4ff379e',
|
|
37
35
|
_c[ContractType.MULTICALL] = '0xed28d27dfca47ad2513c9f2e2d3c098c2ea5a47f',
|
|
38
|
-
_c[ContractType.CAMELOT_YAK_ROUTER] = '0x2b59eb03865d18d8b62a5956bbbfae352fc1c148',
|
|
39
36
|
_c[ContractType.REYA_SBTS] = '0x14d7c1efc024e118df70b241afbd2447d37f1ed6',
|
|
40
37
|
_c),
|
|
41
38
|
_a);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractAddresses.js","sourceRoot":"/","sources":["transactions/contractAddresses.ts"],"names":[],"mappings":";;;;AAAA,kCAAgD;AAEhD,IAAY,
|
|
1
|
+
{"version":3,"file":"contractAddresses.js","sourceRoot":"/","sources":["transactions/contractAddresses.ts"],"names":[],"mappings":";;;;AAAA,kCAAgD;AAEhD,IAAY,YASX;AATD,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,yDAAyC,C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AAM,IAAI,KAAK,CAAC,6CAAsC,UAAU,CAAE,CAAC,CAAC;IACtE,CAAC;IAED,IAAM,gBAAgB,GAAG,SAAS,CAAC,OAAsB,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,kCAA2B,YAAY,cAAW,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACxC,CAAC,CAAC;AAhBW,QAAA,UAAU,cAgBrB","sourcesContent":["import { Address, ReyaChainId } from '../types';\n\nexport enum ContractType {\n CORE_PROXY = 'core_proxy',\n PASSIVE_POOL_PROXY = 'passive_pool_proxy',\n PERIPHERY_PROXY = 'periphery_proxy',\n CONDITIONAL_ORDERS_PROXY = 'conditional_orders_proxy',\n PASSIVE_PERP_PROXY = 'passive_perp_proxy',\n ORACLE_ADAPTERS_PROXY = 'oracle_adapters_proxy',\n MULTICALL = 'multicall',\n REYA_SBTS = 'reya_sbts',\n}\n\nconst addresses: Record<ReyaChainId, Record<ContractType, Address>> = {\n [ReyaChainId.reyaCronos]: {\n [ContractType.CORE_PROXY]: '0xc6fb022962e1426f4e0ec9d2f8861c57926e9f72',\n [ContractType.PASSIVE_POOL_PROXY]:\n '0x9a3a664987b88790a6fdc1632e3b607813fd94ff',\n [ContractType.PERIPHERY_PROXY]:\n '0x94ccae812f1647696754412082dd6684c2366a7f',\n [ContractType.CONDITIONAL_ORDERS_PROXY]:\n '0x5a0ac2f89e0bdeafc5c549e354842210a3e87ca5',\n [ContractType.PASSIVE_PERP_PROXY]:\n '0x9ec177fed042ef2307928be2f5cdbf663b20244b',\n [ContractType.ORACLE_ADAPTERS_PROXY]:\n '0xc501a2356703cd351703d68963c6f4136120f7cf',\n [ContractType.MULTICALL]: '0x5abde4f0af8eaf3c9967f7fa126e59a103357b5c',\n [ContractType.REYA_SBTS]: '0xc0092ea9179ace93b0cd8910958e335575562722',\n },\n [ReyaChainId.reyaNetwork]: {\n [ContractType.CORE_PROXY]: '0xa763b6a5e09378434406c003dae6487fbbdc1a80',\n [ContractType.PASSIVE_POOL_PROXY]:\n '0xb4b77d6180cc14472a9a7bdff01cc2459368d413',\n [ContractType.PERIPHERY_PROXY]:\n '0xcd2869d1eb1bc8991bc55de9e9b779e912faf736',\n [ContractType.CONDITIONAL_ORDERS_PROXY]:\n '0xfc8c96be87da63cecddbf54abfa7b13ee8044739',\n [ContractType.PASSIVE_PERP_PROXY]:\n '0x27e5cb712334e101b3c232eb0be198baaa595f5f',\n [ContractType.ORACLE_ADAPTERS_PROXY]:\n '0x32edabc058c1207fe0ec5f8557643c28e4ff379e',\n [ContractType.MULTICALL]: '0xed28d27dfca47ad2513c9f2e2d3c098c2ea5a47f',\n [ContractType.REYA_SBTS]: '0x14d7c1efc024e118df70b241afbd2447d37f1ed6',\n },\n};\nexport const getAddress = (\n chainId: number,\n contractName: ContractType,\n): Address => {\n const keyChainId = chainId.toString();\n\n if (!Object.keys(addresses).includes(keyChainId)) {\n throw new Error(`Unspecified addresses for chain id ${keyChainId}`);\n }\n\n const networkAddresses = addresses[chainId as ReyaChainId];\n if (!Object.keys(networkAddresses).includes(contractName)) {\n throw new Error(`Unspecified address for ${contractName} contract`);\n }\n\n return networkAddresses[contractName];\n};\n"]}
|
|
@@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
};
|
|
49
49
|
var _a;
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.decodeErrorBytes = exports.executeTransaction = exports.estimateGasFromTxAndChainId = exports.estimateGasGivenAddress = exports.estimateGas =
|
|
51
|
+
exports.decodeErrorBytes = exports.executeTransaction = exports.estimateGasFromTxAndChainId = exports.estimateGasGivenAddress = exports.estimateGas = void 0;
|
|
52
52
|
var ethers_1 = require("ethers");
|
|
53
53
|
var types_1 = require("../types");
|
|
54
54
|
var contractAddresses_1 = require("./contractAddresses");
|
|
@@ -57,7 +57,7 @@ var ethers_decode_error_1 = require("ethers-decode-error");
|
|
|
57
57
|
var txHelpers_1 = require("./txHelpers");
|
|
58
58
|
var utils_1 = require("../utils");
|
|
59
59
|
var ethers_2 = require("ethers");
|
|
60
|
-
|
|
60
|
+
var reyaChainIdRPCMapper = (_a = {},
|
|
61
61
|
_a[types_1.ReyaChainId.reyaNetwork] = 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',
|
|
62
62
|
_a[types_1.ReyaChainId.reyaCronos] = 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',
|
|
63
63
|
_a);
|
|
@@ -76,6 +76,7 @@ function estimateGas(signer, data, value, chainId, targetContract) {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
exports.estimateGas = estimateGas;
|
|
79
|
+
// TODO: deprecate this when /executeGelato is gone
|
|
79
80
|
function estimateGasGivenAddress(accountAddress, data, value, chainId, targetContract) {
|
|
80
81
|
return __awaiter(this, void 0, void 0, function () {
|
|
81
82
|
var contractAddress, tx, gasLimit, network, provider, error_1, decodedError, reason, maxPriorityFeePerGas, maxFeePerGas;
|
|
@@ -91,7 +92,7 @@ function estimateGasGivenAddress(accountAddress, data, value, chainId, targetCon
|
|
|
91
92
|
case 1:
|
|
92
93
|
_a.trys.push([1, 3, , 5]);
|
|
93
94
|
network = new ethers_1.Network('Reya', chainId);
|
|
94
|
-
provider = new ethers_1.JsonRpcProvider(
|
|
95
|
+
provider = new ethers_1.JsonRpcProvider(reyaChainIdRPCMapper[chainId], network, {
|
|
95
96
|
staticNetwork: network,
|
|
96
97
|
pollingInterval: 50,
|
|
97
98
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeTransaction.js","sourceRoot":"/","sources":["transactions/executeTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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0B,CAAC;QACpC,KAAK,gBAAgB;YACnB,OAAO,qDAAqD,CAAC;QAC/D,KAAK,gBAAgB;YACnB,OAAO,+BAA+B,CAAC;QACzC;YACE,qCAAqC;YACrC,OAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,6BAA6B,CAAC;IACnD,CAAC;AACH,CAAC,CAAC;AAEF,SAAS,YAAY,CAAC,UAAkB;IACtC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,SAAsB,gBAAgB,CAAC,UAAkB;;;;YACjD,SAAS,GAAG,IAAI,kBAAS,CAAC,iBAAG,CAAC,CAAC;YAC/B,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YACtD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC1B,sBAAO,UAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,eAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAE,IAAI,iBAAiB,EAAC;;;CAC5E;AALD,4CAKC","sourcesContent":["import {\n ethers,\n JsonRpcProvider,\n JsonRpcSigner,\n Network,\n Signer,\n} from 'ethers';\nimport { MoneyInOutChainId, ReyaChainId } from '../types';\nimport { ContractType, getAddress } from './contractAddresses';\nimport { abi } from './abis/Errors.json';\nimport { ErrorDecoder } from 'ethers-decode-error';\nimport type { DecodedError } from 'ethers-decode-error';\nimport { getGasBuffer } from './txHelpers';\nimport { getPublicRpcUrlsOrThrow } from '../utils';\nimport { Interface } from 'ethers';\n\nexport const reyaChainIdRPCMapper: { [key: number]: string } = {\n [ReyaChainId.reyaNetwork]:\n 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',\n [ReyaChainId.reyaCronos]:\n 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',\n};\n\nexport type Transaction = {\n from: string;\n to: string;\n data: string;\n value?: string;\n};\nconst errorDecoder = ErrorDecoder.create([abi]);\n\nexport async function estimateGas(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n return estimateGasGivenAddress(\n accountAddress,\n data,\n value,\n chainId,\n targetContract,\n );\n}\n\nexport async function estimateGasGivenAddress(\n accountAddress: string,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n\n const tx = {\n from: accountAddress, // @todo Update with relayer address\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n const gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const network = new Network('Reya', chainId);\n const provider = new JsonRpcProvider(\n reyaChainIdRPCMapper[chainId],\n network,\n {\n staticNetwork: network,\n pollingInterval: 50,\n },\n );\n await provider.call(tx);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\n\nexport async function estimateGasFromTxAndChainId(\n chainId: ReyaChainId | MoneyInOutChainId,\n tx: ethers.TransactionRequest,\n): Promise<bigint> {\n const rpcUrls = getPublicRpcUrlsOrThrow(chainId);\n let lastError = null;\n\n for (const url of rpcUrls) {\n try {\n const provider = new ethers.JsonRpcProvider(url);\n const estimation = await provider.estimateGas(tx);\n return addGasBuffer(estimation);\n } catch (error) {\n lastError = error;\n }\n }\n\n throw new Error('All RPC URLs failed; last error: ' + lastError);\n}\n\nasync function estimateGasExternalChains(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n const tx = {\n from: accountAddress,\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n let gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const gasEstimate = await signer.estimateGas(tx);\n gasLimit = getGasBuffer(gasEstimate);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating external transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\n\nexport async function executeTransaction(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n) {\n const txData = await estimateGasExternalChains(\n signer,\n data,\n value,\n chainId,\n targetContract,\n );\n\n try {\n const txResponse = await signer.sendTransaction(txData);\n const txReceipt = await txResponse.wait();\n return txReceipt;\n } catch (error) {\n console.warn(error);\n throw new Error('Transaction Execution Error');\n }\n}\nconst customReasonMapper = ({ name, reason }: DecodedError): string => {\n switch (name) {\n case 'SignatureInvalid':\n return `Invalid signature. Please refresh page and try again`;\n case 'StalePriceDetected':\n return `Price not updated, please try again a bit later`;\n case 'SmallOrderSize':\n return `Order size below minimum`;\n case 'DustyOrderSize':\n return `Order amount is not divisible by trade size spacing`;\n case 'AccountBelowIM':\n return `Account below required margin`;\n default:\n // This handles the non-custom errors\n return reason ?? 'Error executing transaction';\n }\n};\n\nfunction addGasBuffer(estimation: bigint): bigint {\n return (estimation * BigInt(120)) / BigInt(100);\n}\n\nexport async function decodeErrorBytes(returnData: string): Promise<string> {\n const INTERFACE = new Interface(abi);\n const decodedError = INTERFACE.parseError(returnData);\n console.log(decodedError);\n return `${decodedError?.name}: ${decodedError?.args}` || 'Error not found';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"executeTransaction.js","sourceRoot":"/","sources":["transactions/executeTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAMgB;AAChB,kCAA0D;AAC1D,yDAA+D;AAC/D,kDAAyC;AACzC,2DAAmD;AAEnD,yCAA2C;AAC3C,kCAAmD;AACnD,iCAAmC;AAEnC,IAAM,oBAAoB;IACxB,GAAC,mBAAW,CAAC,WAAW,IACtB,2DAA2D;IAC7D,GAAC,mBAAW,CAAC,UAAU,IACrB,yEAAyE;OAC5E,CAAC;AAQF,IAAM,YAAY,GAAG,kCAAY,CAAC,MAAM,CAAC,CAAC,iBAAG,CAAC,CAAC,CAAC;AAEhD,SAAsB,WAAW,CAC/B,MAA8B,EAC9B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,cAAqC;;;;;wBAQd,qBAAM,MAAM,CAAC,UAAU,EAAE,EAAA;;oBAA1C,cAAc,GAAG,SAAyB;oBAEhD,sBAAO,uBAAuB,CAC5B,cAAc,EACd,IAAI,EACJ,KAAK,EACL,OAAO,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,sBAAO,UAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,eAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAE,IAAI,iBAAiB,EAAC;;;CAC5E;AALD,4CAKC","sourcesContent":["import {\n ethers,\n JsonRpcProvider,\n JsonRpcSigner,\n Network,\n Signer,\n} from 'ethers';\nimport { MoneyInOutChainId, ReyaChainId } from '../types';\nimport { ContractType, getAddress } from './contractAddresses';\nimport { abi } from './abis/Errors.json';\nimport { ErrorDecoder } from 'ethers-decode-error';\nimport type { DecodedError } from 'ethers-decode-error';\nimport { getGasBuffer } from './txHelpers';\nimport { getPublicRpcUrlsOrThrow } from '../utils';\nimport { Interface } from 'ethers';\n\nconst reyaChainIdRPCMapper: { [key: number]: string } = {\n [ReyaChainId.reyaNetwork]:\n 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',\n [ReyaChainId.reyaCronos]:\n 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',\n};\n\nexport type Transaction = {\n from: string;\n to: string;\n data: string;\n value?: string;\n};\nconst errorDecoder = ErrorDecoder.create([abi]);\n\nexport async function estimateGas(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n return estimateGasGivenAddress(\n accountAddress,\n data,\n value,\n chainId,\n targetContract,\n );\n}\n\n// TODO: deprecate this when /executeGelato is gone\nexport async function estimateGasGivenAddress(\n accountAddress: string,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n\n const tx = {\n from: accountAddress, // @todo Update with relayer address\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n const gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const network = new Network('Reya', chainId);\n const provider = new JsonRpcProvider(\n reyaChainIdRPCMapper[chainId],\n network,\n {\n staticNetwork: network,\n pollingInterval: 50,\n },\n );\n await provider.call(tx);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\n\nexport async function estimateGasFromTxAndChainId(\n chainId: ReyaChainId | MoneyInOutChainId,\n tx: ethers.TransactionRequest,\n): Promise<bigint> {\n const rpcUrls = getPublicRpcUrlsOrThrow(chainId);\n let lastError = null;\n\n for (const url of rpcUrls) {\n try {\n const provider = new ethers.JsonRpcProvider(url);\n const estimation = await provider.estimateGas(tx);\n return addGasBuffer(estimation);\n } catch (error) {\n lastError = error;\n }\n }\n\n throw new Error('All RPC URLs failed; last error: ' + lastError);\n}\n\nasync function estimateGasExternalChains(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n const tx = {\n from: accountAddress,\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n let gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const gasEstimate = await signer.estimateGas(tx);\n gasLimit = getGasBuffer(gasEstimate);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating external transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\n\nexport async function executeTransaction(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n) {\n const txData = await estimateGasExternalChains(\n signer,\n data,\n value,\n chainId,\n targetContract,\n );\n\n try {\n const txResponse = await signer.sendTransaction(txData);\n const txReceipt = await txResponse.wait();\n return txReceipt;\n } catch (error) {\n console.warn(error);\n throw new Error('Transaction Execution Error');\n }\n}\nconst customReasonMapper = ({ name, reason }: DecodedError): string => {\n switch (name) {\n case 'SignatureInvalid':\n return `Invalid signature. Please refresh page and try again`;\n case 'StalePriceDetected':\n return `Price not updated, please try again a bit later`;\n case 'SmallOrderSize':\n return `Order size below minimum`;\n case 'DustyOrderSize':\n return `Order amount is not divisible by trade size spacing`;\n case 'AccountBelowIM':\n return `Account below required margin`;\n default:\n // This handles the non-custom errors\n return reason ?? 'Error executing transaction';\n }\n};\n\nfunction addGasBuffer(estimation: bigint): bigint {\n return (estimation * BigInt(120)) / BigInt(100);\n}\n\nexport async function decodeErrorBytes(returnData: string): Promise<string> {\n const INTERFACE = new Interface(abi);\n const decodedError = INTERFACE.parseError(returnData);\n console.log(decodedError);\n return `${decodedError?.name}: ${decodedError?.args}` || 'Error not found';\n}\n"]}
|
|
@@ -15,8 +15,7 @@ var CommandType;
|
|
|
15
15
|
CommandType[CommandType["DUTCH_LIQUIDATION"] = 2] = "DUTCH_LIQUIDATION";
|
|
16
16
|
CommandType[CommandType["MATCH_ORDER"] = 3] = "MATCH_ORDER";
|
|
17
17
|
CommandType[CommandType["TRANSFER_MARGIN_ACCOUNT"] = 4] = "TRANSFER_MARGIN_ACCOUNT";
|
|
18
|
-
CommandType[CommandType["
|
|
19
|
-
CommandType[CommandType["MANAGE_POOL_STAKE"] = 6] = "MANAGE_POOL_STAKE";
|
|
18
|
+
CommandType[CommandType["MANAGE_POOL_STAKE"] = 5] = "MANAGE_POOL_STAKE";
|
|
20
19
|
})(CommandType || (exports.CommandType = CommandType = {}));
|
|
21
20
|
var ABI_DEFINITION = (_a = {},
|
|
22
21
|
_a[CommandType.DEPOSIT] = ['address', 'uint256'],
|
|
@@ -24,9 +23,6 @@ var ABI_DEFINITION = (_a = {},
|
|
|
24
23
|
_a[CommandType.MATCH_ORDER] = ['uint128[]', 'bytes'],
|
|
25
24
|
_a[CommandType.DUTCH_LIQUIDATION] = ['tuple(uint128,address,uint128[],bytes[])'],
|
|
26
25
|
_a[CommandType.TRANSFER_MARGIN_ACCOUNT] = ['tuple(uint128,address,uint256)'],
|
|
27
|
-
_a[CommandType.CAMELOT_SWAP] = [
|
|
28
|
-
'tuple(uint256,uint256,address[],address[],address[])',
|
|
29
|
-
],
|
|
30
26
|
_a[CommandType.MANAGE_POOL_STAKE] = ['uint8', 'bytes'],
|
|
31
27
|
_a);
|
|
32
28
|
function createCommand(type, parameters, marketId, exchangeId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routerCommands.js","sourceRoot":"/","sources":["transactions/routerCommands.ts"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAGlC;;;;GAIG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"routerCommands.js","sourceRoot":"/","sources":["transactions/routerCommands.ts"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAG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QAAQ;YAC1B,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF,CAAC;AACJ,CAAC;AAfD,gCAeC","sourcesContent":["import { AbiCoder } from 'ethers';\nimport { SingleAction } from './action';\n\n/**\n * CommandTypes\n * @description Flags that modify a command's execution\n * @enum {number}\n */\nexport enum CommandType {\n DEPOSIT,\n WITHDRAW,\n DUTCH_LIQUIDATION,\n MATCH_ORDER,\n TRANSFER_MARGIN_ACCOUNT,\n MANAGE_POOL_STAKE,\n}\n\nconst ABI_DEFINITION: { [key in CommandType]: string[] } = {\n [CommandType.DEPOSIT]: ['address', 'uint256'],\n [CommandType.WITHDRAW]: ['address', 'uint256'],\n [CommandType.MATCH_ORDER]: ['uint128[]', 'bytes'],\n [CommandType.DUTCH_LIQUIDATION]: ['tuple(uint128,address,uint128[],bytes[])'],\n [CommandType.TRANSFER_MARGIN_ACCOUNT]: ['tuple(uint128,address,uint256)'],\n [CommandType.MANAGE_POOL_STAKE]: ['uint8', 'bytes'],\n};\n\nexport type RouterCommand = {\n type: CommandType;\n encodedInput: string;\n marketId: number;\n exchangeId: number;\n};\n\nexport function createCommand(\n type: CommandType,\n parameters: unknown[],\n marketId: number,\n exchangeId: number,\n): RouterCommand {\n const encodedInput = AbiCoder.defaultAbiCoder().encode(\n ABI_DEFINITION[type],\n parameters,\n );\n return { type, encodedInput, marketId, exchangeId };\n}\n\nexport function getCommand(\n type: CommandType,\n parameters: unknown[],\n marketId: number,\n exchangeId: number,\n): SingleAction {\n const command = createCommand(type, parameters, marketId, exchangeId);\n return {\n command: {\n commandType: command.type,\n inputs: command.encodedInput,\n marketId: command.marketId,\n exchangeId: command.exchangeId,\n },\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ParamsDictionary, Query } from 'express-serve-static-core';
|
|
2
|
-
import { AssetPair } from './types';
|
|
2
|
+
import { AssetPair, CollateralPrice, MarketPrice } from './types';
|
|
3
3
|
export type PaginatedQueryParams = {
|
|
4
4
|
before: string;
|
|
5
5
|
after: string;
|
|
@@ -87,42 +87,14 @@ type ConditionalOrder = {
|
|
|
87
87
|
last_update_timestamp_ms: bigint;
|
|
88
88
|
transaction_hash: string | null;
|
|
89
89
|
};
|
|
90
|
-
type Swap = {
|
|
91
|
-
id: string;
|
|
92
|
-
account_id: Decimal;
|
|
93
|
-
token_in: string;
|
|
94
|
-
token_out: string;
|
|
95
|
-
amount_in: Decimal;
|
|
96
|
-
amount_out: Decimal;
|
|
97
|
-
executed_amount_out: Decimal;
|
|
98
|
-
transaction_hash: string;
|
|
99
|
-
block_timestamp: Decimal;
|
|
100
|
-
block_number: Decimal;
|
|
101
|
-
unique_id: bigint | null;
|
|
102
|
-
};
|
|
103
90
|
type Market = {
|
|
104
91
|
id: Decimal;
|
|
105
92
|
ticker: string;
|
|
106
|
-
markPrice: number;
|
|
107
93
|
isActive: boolean;
|
|
108
94
|
maxLeverage: number;
|
|
109
|
-
volume24H: number;
|
|
110
|
-
priceChange24H: number;
|
|
111
|
-
longOI: number;
|
|
112
|
-
shortOI: number;
|
|
113
|
-
availableLong: number;
|
|
114
|
-
availableShort: number;
|
|
115
|
-
marketPriceDeviation: number;
|
|
116
|
-
riskBlockId: number;
|
|
117
|
-
rootCollateralPoolId: number;
|
|
118
95
|
description: string;
|
|
119
96
|
name: string;
|
|
120
|
-
quoteTokenId: string;
|
|
121
97
|
tickSizeDecimals: number;
|
|
122
|
-
underlyingAssetId: string;
|
|
123
|
-
priceChange24HPercentage: number;
|
|
124
|
-
openInterest: number;
|
|
125
|
-
fundingRate: number;
|
|
126
98
|
priority: number;
|
|
127
99
|
};
|
|
128
100
|
type Account = {
|
|
@@ -132,14 +104,6 @@ type Account = {
|
|
|
132
104
|
updated_timestamp_ms: Decimal;
|
|
133
105
|
source: string | null;
|
|
134
106
|
};
|
|
135
|
-
type Price = {
|
|
136
|
-
block_number: Decimal;
|
|
137
|
-
unique_id: bigint | null;
|
|
138
|
-
contract_id: string;
|
|
139
|
-
price: Decimal | null;
|
|
140
|
-
round_id: Decimal | null;
|
|
141
|
-
timestamp: Decimal;
|
|
142
|
-
};
|
|
143
107
|
type AccountBalance = {
|
|
144
108
|
account_id: number | null;
|
|
145
109
|
collateral: string | null;
|
|
@@ -171,6 +135,26 @@ type Leverage = {
|
|
|
171
135
|
type WalletStats = {
|
|
172
136
|
volume_14d: Decimal;
|
|
173
137
|
};
|
|
138
|
+
type MarketData = {
|
|
139
|
+
marketId: string;
|
|
140
|
+
updatedAt: number;
|
|
141
|
+
longOI: number;
|
|
142
|
+
shortOI: number;
|
|
143
|
+
longSkewPercentage: number;
|
|
144
|
+
shortSkewPercentage: number;
|
|
145
|
+
openInterest?: number;
|
|
146
|
+
fundingRate?: number;
|
|
147
|
+
last24hVolume: number;
|
|
148
|
+
priceChange24H?: number;
|
|
149
|
+
priceChange24HPercentage?: number;
|
|
150
|
+
maxAmountBaseLong?: number;
|
|
151
|
+
maxAmountSizeLong?: number;
|
|
152
|
+
maxAmountBaseShort?: number;
|
|
153
|
+
maxAmountSizeShort?: number;
|
|
154
|
+
oraclePrice?: number;
|
|
155
|
+
poolPrice?: number;
|
|
156
|
+
pricesUpdatedAt?: number;
|
|
157
|
+
};
|
|
174
158
|
export type TradingApiEndpoint<Response, Params, ReplicationTable extends ReplicationModel = never, Replication = Response, Query = never> = {
|
|
175
159
|
params: Params;
|
|
176
160
|
query: Query;
|
|
@@ -211,6 +195,8 @@ export type TradingApiSource = {
|
|
|
211
195
|
'wallet/:address/leverages': TradingApiListEndpoint<Leverage, {
|
|
212
196
|
address: string;
|
|
213
197
|
}, 'accountLeveragePerMarket'>;
|
|
198
|
+
markets: TradingApiListEndpoint<Market>;
|
|
199
|
+
'markets/data': TradingApiListEndpoint<MarketData, never, 'marketData'>;
|
|
214
200
|
'markets/configuration': TradingApiListEndpoint<{
|
|
215
201
|
market_id: Decimal;
|
|
216
202
|
risk_matrix_index: Decimal | null;
|
|
@@ -267,6 +253,15 @@ export type TradingApiSource = {
|
|
|
267
253
|
block_number: Decimal;
|
|
268
254
|
unique_id: bigint | null;
|
|
269
255
|
}>;
|
|
256
|
+
'market/:marketId': TradingApiEndpoint<Market, {
|
|
257
|
+
marketId: string;
|
|
258
|
+
}>;
|
|
259
|
+
'market/:marketId/data': TradingApiEndpoint<MarketData, {
|
|
260
|
+
marketId: string;
|
|
261
|
+
}, 'marketData'>;
|
|
262
|
+
'market/:marketId/orders': TradingApiInfiniteListEndpoint<Order, {
|
|
263
|
+
marketId: string;
|
|
264
|
+
}, 'order_history'>;
|
|
270
265
|
'wallet/:address/positions': TradingApiListEndpoint<Position, AddressParam, 'position_raw'>;
|
|
271
266
|
'wallet/:address/conditionalOrders': TradingApiListEndpoint<ConditionalOrder, AddressParam, 'ConditionalOrders'>;
|
|
272
267
|
assets: TradingApiListEndpoint<{
|
|
@@ -279,7 +274,10 @@ export type TradingApiSource = {
|
|
|
279
274
|
asset_price_usdc_contract_id: string | null;
|
|
280
275
|
decimals: number;
|
|
281
276
|
}>;
|
|
282
|
-
prices:
|
|
277
|
+
prices: TradingApiEndpoint<Partial<Record<AssetPair, MarketPrice | CollateralPrice>>, never>;
|
|
278
|
+
'prices/:assetPairId': TradingApiEndpoint<MarketPrice | CollateralPrice | undefined, {
|
|
279
|
+
assetPairId: string;
|
|
280
|
+
}, 'price'>;
|
|
283
281
|
'wallet/:address/accounts': TradingApiListEndpoint<Account, AddressParam, 'accountProfile'>;
|
|
284
282
|
'wallet/:address/accounts/tiers': TradingApiListEndpoint<{
|
|
285
283
|
market_id: Decimal;
|
|
@@ -288,10 +286,6 @@ export type TradingApiSource = {
|
|
|
288
286
|
}, AddressParam>;
|
|
289
287
|
'wallet/:address/accounts/balances': TradingApiListEndpoint<AccountBalance, AddressParam, 'account_balances'>;
|
|
290
288
|
'wallet/:address/autoExchange': TradingApiInfiniteListEndpoint<AutoExchange, AddressParam, 'auto_exchange'>;
|
|
291
|
-
'wallet/:address/swaps': TradingApiInfiniteListEndpoint<Swap, AddressParam, 'swaps'>;
|
|
292
|
-
'market/:marketId/orders': TradingApiInfiniteListEndpoint<Order, {
|
|
293
|
-
marketId: string;
|
|
294
|
-
}, 'order_history'>;
|
|
295
289
|
'wallet/:address/balanceHistory/:timestamp': TradingApiListEndpoint<{
|
|
296
290
|
timestamp: number;
|
|
297
291
|
balance: number;
|
|
@@ -312,7 +306,6 @@ export type TradingApiSource = {
|
|
|
312
306
|
}, {
|
|
313
307
|
poolId: string;
|
|
314
308
|
}>;
|
|
315
|
-
markets: TradingApiListEndpoint<Market>;
|
|
316
309
|
tierFees: TradingApiListEndpoint<{
|
|
317
310
|
market_id: Decimal;
|
|
318
311
|
tier_id: Decimal;
|
|
@@ -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,MAAM,SAAS,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,cAAc,CAAC;AAErC,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,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AAG,IAAI,CAAC;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,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,CAAC;AAEN,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"}
|
|
@@ -7,7 +7,6 @@ export declare enum ContractType {
|
|
|
7
7
|
PASSIVE_PERP_PROXY = "passive_perp_proxy",
|
|
8
8
|
ORACLE_ADAPTERS_PROXY = "oracle_adapters_proxy",
|
|
9
9
|
MULTICALL = "multicall",
|
|
10
|
-
CAMELOT_YAK_ROUTER = "camelot_yak_router",
|
|
11
10
|
REYA_SBTS = "reya_sbts"
|
|
12
11
|
}
|
|
13
12
|
export declare const getAddress: (chainId: number, contractName: ContractType) => Address;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractAddresses.d.ts","sourceRoot":"/","sources":["transactions/contractAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,UAAU,CAAC;AAEhD,oBAAY,YAAY;IACtB,UAAU,eAAe;IACzB,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,wBAAwB,6BAA6B;IACrD,kBAAkB,uBAAuB;IACzC,qBAAqB,0BAA0B;IAC/C,SAAS,cAAc;IACvB,
|
|
1
|
+
{"version":3,"file":"contractAddresses.d.ts","sourceRoot":"/","sources":["transactions/contractAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,UAAU,CAAC;AAEhD,oBAAY,YAAY;IACtB,UAAU,eAAe;IACzB,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,wBAAwB,6BAA6B;IACrD,kBAAkB,uBAAuB;IACzC,qBAAqB,0BAA0B;IAC/C,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAkCD,eAAO,MAAM,UAAU,YACZ,MAAM,gBACD,YAAY,KACzB,OAaF,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ethers, JsonRpcSigner, Signer } from 'ethers';
|
|
2
2
|
import { MoneyInOutChainId, ReyaChainId } from '../types';
|
|
3
3
|
import { ContractType } from './contractAddresses';
|
|
4
|
-
export declare const reyaChainIdRPCMapper: {
|
|
5
|
-
[key: number]: string;
|
|
6
|
-
};
|
|
7
4
|
export type Transaction = {
|
|
8
5
|
from: string;
|
|
9
6
|
to: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeTransaction.d.ts","sourceRoot":"/","sources":["transactions/executeTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAEN,aAAa,EAEb,MAAM,EACP,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;A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C,MAAM,CAAC,CAejB;AAoDD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,YAAY,GAAG,MAAM,6CAkBtC;AAuBD,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAK1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routerCommands.d.ts","sourceRoot":"/","sources":["transactions/routerCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;;;GAIG;AACH,oBAAY,WAAW;IACrB,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,iBAAiB,IAAA;IACjB,WAAW,IAAA;IACX,uBAAuB,IAAA;IACvB,
|
|
1
|
+
{"version":3,"file":"routerCommands.d.ts","sourceRoot":"/","sources":["transactions/routerCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;;;GAIG;AACH,oBAAY,WAAW;IACrB,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,iBAAiB,IAAA;IACjB,WAAW,IAAA;IACX,uBAAuB,IAAA;IACvB,iBAAiB,IAAA;CAClB;AAWD,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,OAAO,EAAE,EACrB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,aAAa,CAMf;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,OAAO,EAAE,EACrB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,YAAY,CAUd"}
|