@proton/wrap-constants 0.2.124 → 0.2.126
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/dist/index.d.ts +40 -29
- package/dist/index.js +4 -3
- package/dist/index.mjs +4 -3
- package/package.json +2 -2
- package/src/constants.ts +9 -9
- package/src/parsers/dex.ts +33 -17
package/dist/index.d.ts
CHANGED
|
@@ -6411,7 +6411,8 @@ declare const getOhlcvParser: z.ZodObject<{
|
|
|
6411
6411
|
interval: string;
|
|
6412
6412
|
limit?: number | undefined;
|
|
6413
6413
|
}>;
|
|
6414
|
-
declare type GetOHLCV = z.
|
|
6414
|
+
declare type GetOHLCV = z.input<typeof getOhlcvParser>;
|
|
6415
|
+
declare type GetOHLCVParsed = z.output<typeof getOhlcvParser>;
|
|
6415
6416
|
declare const getOhlcvResponseParser: z.ZodObject<{
|
|
6416
6417
|
sync: z.ZodNumber;
|
|
6417
6418
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -6488,8 +6489,8 @@ declare const openOrderParser: z.ZodObject<{
|
|
|
6488
6489
|
filled_total: z.ZodOptional<z.ZodNumber>;
|
|
6489
6490
|
filled_amount: z.ZodOptional<z.ZodNumber>;
|
|
6490
6491
|
filled_fee: z.ZodOptional<z.ZodNumber>;
|
|
6491
|
-
created_at: z.
|
|
6492
|
-
updated_at: z.
|
|
6492
|
+
created_at: z.ZodString;
|
|
6493
|
+
updated_at: z.ZodString;
|
|
6493
6494
|
}, "strip", z.ZodTypeAny, {
|
|
6494
6495
|
status: string;
|
|
6495
6496
|
price: number;
|
|
@@ -6503,8 +6504,8 @@ declare const openOrderParser: z.ZodObject<{
|
|
|
6503
6504
|
order_type: number;
|
|
6504
6505
|
trigger_price: number;
|
|
6505
6506
|
fill_type: number;
|
|
6506
|
-
created_at:
|
|
6507
|
-
updated_at:
|
|
6507
|
+
created_at: string;
|
|
6508
|
+
updated_at: string;
|
|
6508
6509
|
quantity_init?: number | undefined;
|
|
6509
6510
|
filled_total?: number | undefined;
|
|
6510
6511
|
filled_amount?: number | undefined;
|
|
@@ -6522,8 +6523,8 @@ declare const openOrderParser: z.ZodObject<{
|
|
|
6522
6523
|
order_type: number;
|
|
6523
6524
|
trigger_price: number;
|
|
6524
6525
|
fill_type: number;
|
|
6525
|
-
created_at:
|
|
6526
|
-
updated_at:
|
|
6526
|
+
created_at: string;
|
|
6527
|
+
updated_at: string;
|
|
6527
6528
|
quantity_init?: number | undefined;
|
|
6528
6529
|
filled_total?: number | undefined;
|
|
6529
6530
|
filled_amount?: number | undefined;
|
|
@@ -6614,7 +6615,8 @@ declare const getOpenOrdersParser: z.ZodObject<{
|
|
|
6614
6615
|
limit?: number | undefined;
|
|
6615
6616
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6616
6617
|
}>;
|
|
6617
|
-
declare type GetOpenOrders = z.
|
|
6618
|
+
declare type GetOpenOrders = z.input<typeof getOpenOrdersParser>;
|
|
6619
|
+
declare type GetOpenOrdersParsed = z.output<typeof getOpenOrdersParser>;
|
|
6618
6620
|
declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
6619
6621
|
sync: z.ZodNumber;
|
|
6620
6622
|
count: z.ZodNumber;
|
|
@@ -6635,8 +6637,8 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6635
6637
|
filled_total: z.ZodOptional<z.ZodNumber>;
|
|
6636
6638
|
filled_amount: z.ZodOptional<z.ZodNumber>;
|
|
6637
6639
|
filled_fee: z.ZodOptional<z.ZodNumber>;
|
|
6638
|
-
created_at: z.
|
|
6639
|
-
updated_at: z.
|
|
6640
|
+
created_at: z.ZodString;
|
|
6641
|
+
updated_at: z.ZodString;
|
|
6640
6642
|
}, "strip", z.ZodTypeAny, {
|
|
6641
6643
|
status: string;
|
|
6642
6644
|
price: number;
|
|
@@ -6650,8 +6652,8 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6650
6652
|
order_type: number;
|
|
6651
6653
|
trigger_price: number;
|
|
6652
6654
|
fill_type: number;
|
|
6653
|
-
created_at:
|
|
6654
|
-
updated_at:
|
|
6655
|
+
created_at: string;
|
|
6656
|
+
updated_at: string;
|
|
6655
6657
|
quantity_init?: number | undefined;
|
|
6656
6658
|
filled_total?: number | undefined;
|
|
6657
6659
|
filled_amount?: number | undefined;
|
|
@@ -6669,8 +6671,8 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6669
6671
|
order_type: number;
|
|
6670
6672
|
trigger_price: number;
|
|
6671
6673
|
fill_type: number;
|
|
6672
|
-
created_at:
|
|
6673
|
-
updated_at:
|
|
6674
|
+
created_at: string;
|
|
6675
|
+
updated_at: string;
|
|
6674
6676
|
quantity_init?: number | undefined;
|
|
6675
6677
|
filled_total?: number | undefined;
|
|
6676
6678
|
filled_amount?: number | undefined;
|
|
@@ -6690,8 +6692,8 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6690
6692
|
order_type: number;
|
|
6691
6693
|
trigger_price: number;
|
|
6692
6694
|
fill_type: number;
|
|
6693
|
-
created_at:
|
|
6694
|
-
updated_at:
|
|
6695
|
+
created_at: string;
|
|
6696
|
+
updated_at: string;
|
|
6695
6697
|
quantity_init?: number | undefined;
|
|
6696
6698
|
filled_total?: number | undefined;
|
|
6697
6699
|
filled_amount?: number | undefined;
|
|
@@ -6713,8 +6715,8 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6713
6715
|
order_type: number;
|
|
6714
6716
|
trigger_price: number;
|
|
6715
6717
|
fill_type: number;
|
|
6716
|
-
created_at:
|
|
6717
|
-
updated_at:
|
|
6718
|
+
created_at: string;
|
|
6719
|
+
updated_at: string;
|
|
6718
6720
|
quantity_init?: number | undefined;
|
|
6719
6721
|
filled_total?: number | undefined;
|
|
6720
6722
|
filled_amount?: number | undefined;
|
|
@@ -6749,7 +6751,8 @@ declare const getOrderHistoryParser: z.ZodObject<{
|
|
|
6749
6751
|
trx_id?: string | undefined;
|
|
6750
6752
|
status?: string | undefined;
|
|
6751
6753
|
}>;
|
|
6752
|
-
declare type GetOrderHistory = z.
|
|
6754
|
+
declare type GetOrderHistory = z.input<typeof getOrderHistoryParser>;
|
|
6755
|
+
declare type GetOrderHistoryParsed = z.output<typeof getOrderHistoryParser>;
|
|
6753
6756
|
declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
6754
6757
|
sync: z.ZodNumber;
|
|
6755
6758
|
count: z.ZodNumber;
|
|
@@ -6879,7 +6882,8 @@ declare const getOrderLifecycleParser: z.ZodObject<{
|
|
|
6879
6882
|
order_id?: string | undefined;
|
|
6880
6883
|
ordinal_order_id?: string | undefined;
|
|
6881
6884
|
}>;
|
|
6882
|
-
declare type GetOrderLifecycle = z.
|
|
6885
|
+
declare type GetOrderLifecycle = z.input<typeof getOrderLifecycleParser>;
|
|
6886
|
+
declare type GetOrderLifecycleParsed = z.output<typeof getOrderLifecycleParser>;
|
|
6883
6887
|
declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
6884
6888
|
sync: z.ZodNumber;
|
|
6885
6889
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -7208,7 +7212,8 @@ declare const getDepthParser: z.ZodObject<{
|
|
|
7208
7212
|
step: number;
|
|
7209
7213
|
limit?: number | undefined;
|
|
7210
7214
|
}>;
|
|
7211
|
-
declare type GetDepth = z.
|
|
7215
|
+
declare type GetDepth = z.input<typeof getDepthParser>;
|
|
7216
|
+
declare type GetDepthParsed = z.output<typeof getDepthParser>;
|
|
7212
7217
|
declare const getDepthResponseParser: z.ZodObject<{
|
|
7213
7218
|
sync: z.ZodNumber;
|
|
7214
7219
|
data: z.ZodObject<{
|
|
@@ -7748,7 +7753,8 @@ declare const getTradesParser: z.ZodObject<{
|
|
|
7748
7753
|
offset?: number | undefined;
|
|
7749
7754
|
limit?: number | undefined;
|
|
7750
7755
|
}>;
|
|
7751
|
-
declare type GetTrades = z.
|
|
7756
|
+
declare type GetTrades = z.input<typeof getTradesParser>;
|
|
7757
|
+
declare type GetTradesParsed = z.output<typeof getTradesParser>;
|
|
7752
7758
|
declare const getTradesResponseParser: z.ZodObject<{
|
|
7753
7759
|
sync: z.ZodNumber;
|
|
7754
7760
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -7899,7 +7905,8 @@ declare const getTradeHistoryParser: z.ZodObject<{
|
|
|
7899
7905
|
ordinal_order_ids?: string | string[] | undefined;
|
|
7900
7906
|
limit?: number | undefined;
|
|
7901
7907
|
}>;
|
|
7902
|
-
declare type GetTradeHistory = z.
|
|
7908
|
+
declare type GetTradeHistory = z.input<typeof getTradeHistoryParser>;
|
|
7909
|
+
declare type GetTradeHistoryParsed = z.output<typeof getTradeHistoryParser>;
|
|
7903
7910
|
declare const getTradeHistoryResponseParser: z.ZodObject<{
|
|
7904
7911
|
sync: z.ZodNumber;
|
|
7905
7912
|
count: z.ZodNumber;
|
|
@@ -8107,7 +8114,8 @@ declare const getReferralTotalsParser: z.ZodObject<{
|
|
|
8107
8114
|
}, {
|
|
8108
8115
|
referrer: string;
|
|
8109
8116
|
}>;
|
|
8110
|
-
declare type GetReferralTotals = z.
|
|
8117
|
+
declare type GetReferralTotals = z.input<typeof getReferralTotalsParser>;
|
|
8118
|
+
declare type GetReferralTotalsParsed = z.output<typeof getReferralTotalsParser>;
|
|
8111
8119
|
declare const getReferralTotalsResponseParser: z.ZodObject<{
|
|
8112
8120
|
sync: z.ZodNumber;
|
|
8113
8121
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -8172,7 +8180,8 @@ declare const getReferralsParser: z.ZodObject<{
|
|
|
8172
8180
|
}, {
|
|
8173
8181
|
referrer: string;
|
|
8174
8182
|
}>;
|
|
8175
|
-
declare type GetReferrals = z.
|
|
8183
|
+
declare type GetReferrals = z.input<typeof getReferralsParser>;
|
|
8184
|
+
declare type GetReferralsParsed = z.output<typeof getReferralsParser>;
|
|
8176
8185
|
declare const getReferralsResponseParser: z.ZodObject<{
|
|
8177
8186
|
sync: z.ZodNumber;
|
|
8178
8187
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -8209,7 +8218,7 @@ declare const leaderboardParser: z.ZodObject<{
|
|
|
8209
8218
|
}>;
|
|
8210
8219
|
declare type Leaderboard = z.infer<typeof leaderboardParser>;
|
|
8211
8220
|
declare const getLeaderboardParser: z.ZodObject<{
|
|
8212
|
-
market_ids: z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodNumber]>, number[], number | number[]>;
|
|
8221
|
+
market_ids: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodNumber]>, number[], number | number[]>, number[], number | number[]>;
|
|
8213
8222
|
from: z.ZodString;
|
|
8214
8223
|
to: z.ZodString;
|
|
8215
8224
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -8221,7 +8230,8 @@ declare const getLeaderboardParser: z.ZodObject<{
|
|
|
8221
8230
|
to: string;
|
|
8222
8231
|
market_ids: (number | number[]) & (number | number[] | undefined);
|
|
8223
8232
|
}>;
|
|
8224
|
-
declare type GetLeaderboard = z.
|
|
8233
|
+
declare type GetLeaderboard = z.input<typeof getLeaderboardParser>;
|
|
8234
|
+
declare type GetLeaderboardParsed = z.output<typeof getLeaderboardParser>;
|
|
8225
8235
|
declare const getLeaderboardResponseParser: z.ZodObject<{
|
|
8226
8236
|
sync: z.ZodNumber;
|
|
8227
8237
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -10352,7 +10362,8 @@ declare const getHistoryTransactionResponseParser: z.ZodObject<{
|
|
|
10352
10362
|
};
|
|
10353
10363
|
} | null;
|
|
10354
10364
|
}>;
|
|
10355
|
-
declare type GetHistoryTransaction = z.
|
|
10365
|
+
declare type GetHistoryTransaction = z.input<typeof getHistoryTransactionResponseParser>;
|
|
10366
|
+
declare type GetHistoryTransactionParsed = z.output<typeof getHistoryTransactionResponseParser>;
|
|
10356
10367
|
/**
|
|
10357
10368
|
* Basic Types
|
|
10358
10369
|
*/
|
|
@@ -11398,4 +11409,4 @@ declare const isInputInvalid: (data: string, value: string | number, pool: {
|
|
|
11398
11409
|
}) => boolean;
|
|
11399
11410
|
declare const applyDiscountToFee: (fee: number, staked: number) => number;
|
|
11400
11411
|
|
|
11401
|
-
export { Address, Authorization, Authorizations, BloksRate, BloksRates, Chains, Coin, CoinWallet, CurrencyStat, CurrencyStats, Daily, DbHistoryTransaction, DbMarket, DepositBody, Depth, ExchangeRate, ExchangeRates, ExtendedAsset, ExtendedAssetParser, ExtendedToken, ExtendedTokenWithRate, FEE_FACTOR, GenerateAddressBody, GenerateAddressResponse, GenerateAuth, GenerateAuthBaseAction, GetDailyResponseParser, GetDepth, GetDepthResponse, GetHistoryTransaction, GetLeaderboard, GetLeaderboardResponseParser, GetMarketsResponse, GetOHLCV, GetOHLCVResponse, GetOpenOrders, GetOpenOrdersResponse, GetOrderHistory, GetOrderHistoryResponse, GetOrderLifecycle, GetOrderLifecycleResponse, GetReferralTotals, GetReferralTotalsResponseParser, GetReferrals, GetReferralsResponseParser, GetSyncResponse, GetTradeHistory, GetTradeHistoryResponse, GetTrades, GetTradesResponseParser, Graph, HistoryAccountRamDelta, HistoryAct, HistoryActionTrace, HistoryPartial, HistoryReceipt, HistoryTrace, HistoryTransaction, ILink, INode, ITopics, Leaderboard, LoginAccountParamsV3, Market, MetalTransaction, Networks, OHLCV, OpenOrder, OrderHistory, OtcOrderResponse, OtcQuoteBody, OtcQuoteResponse, Pool, PoolTable, Providers, Rate, RawPool, Referral, ReferralTotal, SerializeOrderParser, SerializeOrderResponse, Status, SubmitOrderParser, SubmitOrderResponse, Sync, TOPICS, Trade, Type, WRAP_AUTH_ACTION, WRAP_CONTRACT, Wallet, WithdrawBody, WithdrawBodyBaseAction, WithdrawHistoryMetalResponse, WithdrawHistoryMetalSwap, WithdrawMetalResponse, WithdrawalFeeQuote, Wrap, WrapSetConf, WrapStart, accountParser, accountRamDeltaParser, actParser, actionTraceParser, addressParser, applyDiscountToFee, authorizationParser, authorizationsParser, baseActionParser, baseActionSerializedParser, bloksRatesParser, compute_liquidity, compute_transfer, compute_transfer_curve, createAbstractAuthParser, dailyParser, dbHistoryTransactionParser, dbMarketParser, depositBodyParser, depthParser, exchangeRateParser, exchangeRatesParser, explorerLinkByChain, fillType, generateAddressBodyParser, generateAddressResponse, generateAuthParser, getDailyResponseParser, getDepthParser, getDepthResponseParser, getHistoryTransactionResponseParser, getLeaderboardParser, getLeaderboardResponseParser, getMarketsResponseParser, getOhlcvParser, getOhlcvResponseParser, getOpenOrdersParser, getOpenOrdersResponseParser, getOrderHistoryParser, getOrderHistoryResponseParser, getOrderLifecycleParser, getOrderLifecycleResponseParser, getReferralTotalsParser, getReferralTotalsResponseParser, getReferralsParser, getReferralsResponseParser, getSyncResponseParser, getTradeHistoryParser, getTradeHistoryResponseParser, getTradesParser, getTradesResponseParser, historyPartialParser, historyTransactionParser, initializeCoins, initializeConstants, isInputInvalid, isSameToken, leaderboardParser, logStatus, loginAccountParamsV3Parser, marketParser, median, metalTransactionParser, ohlcvParser, openOrderParser, orderHistoryParser, orderSide, orderType, otcOrderResponseParser, otcQuoteBodyParser, otcQuoteResponseParser, protonExplorerTxUrl, rateParser, receiptParser, refferalParser, refferalTotalParser, serializeOrderParser, serializeOrderResponseParser, similarChains, singleActionTransactionParser, submitOrderParser, submitOrderResponseParser, syncParser, traceParser, tradeParser, webauthActionParser, withdrawBodyParser, withdrawHistoryMetalResponseParser, withdrawHistoryMetalSwapParser, withdrawMetalResponseParser, withdrawalFeeQuoteParser, wrapParser, wrapSetConfParser, wrapStartParser };
|
|
11412
|
+
export { Address, Authorization, Authorizations, BloksRate, BloksRates, Chains, Coin, CoinWallet, CurrencyStat, CurrencyStats, Daily, DbHistoryTransaction, DbMarket, DepositBody, Depth, ExchangeRate, ExchangeRates, ExtendedAsset, ExtendedAssetParser, ExtendedToken, ExtendedTokenWithRate, FEE_FACTOR, GenerateAddressBody, GenerateAddressResponse, GenerateAuth, GenerateAuthBaseAction, GetDailyResponseParser, GetDepth, GetDepthParsed, GetDepthResponse, GetHistoryTransaction, GetHistoryTransactionParsed, GetLeaderboard, GetLeaderboardParsed, GetLeaderboardResponseParser, GetMarketsResponse, GetOHLCV, GetOHLCVParsed, GetOHLCVResponse, GetOpenOrders, GetOpenOrdersParsed, GetOpenOrdersResponse, GetOrderHistory, GetOrderHistoryParsed, GetOrderHistoryResponse, GetOrderLifecycle, GetOrderLifecycleParsed, GetOrderLifecycleResponse, GetReferralTotals, GetReferralTotalsParsed, GetReferralTotalsResponseParser, GetReferrals, GetReferralsParsed, GetReferralsResponseParser, GetSyncResponse, GetTradeHistory, GetTradeHistoryParsed, GetTradeHistoryResponse, GetTrades, GetTradesParsed, GetTradesResponseParser, Graph, HistoryAccountRamDelta, HistoryAct, HistoryActionTrace, HistoryPartial, HistoryReceipt, HistoryTrace, HistoryTransaction, ILink, INode, ITopics, Leaderboard, LoginAccountParamsV3, Market, MetalTransaction, Networks, OHLCV, OpenOrder, OrderHistory, OtcOrderResponse, OtcQuoteBody, OtcQuoteResponse, Pool, PoolTable, Providers, Rate, RawPool, Referral, ReferralTotal, SerializeOrderParser, SerializeOrderResponse, Status, SubmitOrderParser, SubmitOrderResponse, Sync, TOPICS, Trade, Type, WRAP_AUTH_ACTION, WRAP_CONTRACT, Wallet, WithdrawBody, WithdrawBodyBaseAction, WithdrawHistoryMetalResponse, WithdrawHistoryMetalSwap, WithdrawMetalResponse, WithdrawalFeeQuote, Wrap, WrapSetConf, WrapStart, accountParser, accountRamDeltaParser, actParser, actionTraceParser, addressParser, applyDiscountToFee, authorizationParser, authorizationsParser, baseActionParser, baseActionSerializedParser, bloksRatesParser, compute_liquidity, compute_transfer, compute_transfer_curve, createAbstractAuthParser, dailyParser, dbHistoryTransactionParser, dbMarketParser, depositBodyParser, depthParser, exchangeRateParser, exchangeRatesParser, explorerLinkByChain, fillType, generateAddressBodyParser, generateAddressResponse, generateAuthParser, getDailyResponseParser, getDepthParser, getDepthResponseParser, getHistoryTransactionResponseParser, getLeaderboardParser, getLeaderboardResponseParser, getMarketsResponseParser, getOhlcvParser, getOhlcvResponseParser, getOpenOrdersParser, getOpenOrdersResponseParser, getOrderHistoryParser, getOrderHistoryResponseParser, getOrderLifecycleParser, getOrderLifecycleResponseParser, getReferralTotalsParser, getReferralTotalsResponseParser, getReferralsParser, getReferralsResponseParser, getSyncResponseParser, getTradeHistoryParser, getTradeHistoryResponseParser, getTradesParser, getTradesResponseParser, historyPartialParser, historyTransactionParser, initializeCoins, initializeConstants, isInputInvalid, isSameToken, leaderboardParser, logStatus, loginAccountParamsV3Parser, marketParser, median, metalTransactionParser, ohlcvParser, openOrderParser, orderHistoryParser, orderSide, orderType, otcOrderResponseParser, otcQuoteBodyParser, otcQuoteResponseParser, protonExplorerTxUrl, rateParser, receiptParser, refferalParser, refferalTotalParser, serializeOrderParser, serializeOrderResponseParser, similarChains, singleActionTransactionParser, submitOrderParser, submitOrderResponseParser, syncParser, traceParser, tradeParser, webauthActionParser, withdrawBodyParser, withdrawHistoryMetalResponseParser, withdrawHistoryMetalSwapParser, withdrawMetalResponseParser, withdrawalFeeQuoteParser, wrapParser, wrapSetConfParser, wrapStartParser };
|
package/dist/index.js
CHANGED
|
@@ -1903,6 +1903,7 @@ var ordinalOrderIdsParser = z11.array(z11.string()).or(z11.string()).optional().
|
|
|
1903
1903
|
return [];
|
|
1904
1904
|
return Array.isArray(oids) ? oids : [oids];
|
|
1905
1905
|
});
|
|
1906
|
+
var marketIdsParser = z11.array(z11.coerce.number()).or(z11.coerce.number()).transform((mids) => Array.isArray(mids) ? mids : [mids]).refine((mids) => mids.length > 0, "Must provide atleast one market ID");
|
|
1906
1907
|
var ohlcvParser = z11.object({
|
|
1907
1908
|
time: z11.number(),
|
|
1908
1909
|
open: z11.number(),
|
|
@@ -1941,8 +1942,8 @@ var openOrderParser = z11.object({
|
|
|
1941
1942
|
filled_total: z11.number().optional(),
|
|
1942
1943
|
filled_amount: z11.number().optional(),
|
|
1943
1944
|
filled_fee: z11.number().optional(),
|
|
1944
|
-
created_at: z11.
|
|
1945
|
-
updated_at: z11.
|
|
1945
|
+
created_at: z11.string(),
|
|
1946
|
+
updated_at: z11.string()
|
|
1946
1947
|
});
|
|
1947
1948
|
var orderHistoryParser = z11.object({
|
|
1948
1949
|
block_num: z11.string(),
|
|
@@ -2197,7 +2198,7 @@ var leaderboardParser = z11.object({
|
|
|
2197
2198
|
total: z11.number()
|
|
2198
2199
|
});
|
|
2199
2200
|
var getLeaderboardParser = z11.object({
|
|
2200
|
-
market_ids:
|
|
2201
|
+
market_ids: marketIdsParser,
|
|
2201
2202
|
from: z11.string(),
|
|
2202
2203
|
to: z11.string()
|
|
2203
2204
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1760,6 +1760,7 @@ var ordinalOrderIdsParser = z11.array(z11.string()).or(z11.string()).optional().
|
|
|
1760
1760
|
return [];
|
|
1761
1761
|
return Array.isArray(oids) ? oids : [oids];
|
|
1762
1762
|
});
|
|
1763
|
+
var marketIdsParser = z11.array(z11.coerce.number()).or(z11.coerce.number()).transform((mids) => Array.isArray(mids) ? mids : [mids]).refine((mids) => mids.length > 0, "Must provide atleast one market ID");
|
|
1763
1764
|
var ohlcvParser = z11.object({
|
|
1764
1765
|
time: z11.number(),
|
|
1765
1766
|
open: z11.number(),
|
|
@@ -1798,8 +1799,8 @@ var openOrderParser = z11.object({
|
|
|
1798
1799
|
filled_total: z11.number().optional(),
|
|
1799
1800
|
filled_amount: z11.number().optional(),
|
|
1800
1801
|
filled_fee: z11.number().optional(),
|
|
1801
|
-
created_at: z11.
|
|
1802
|
-
updated_at: z11.
|
|
1802
|
+
created_at: z11.string(),
|
|
1803
|
+
updated_at: z11.string()
|
|
1803
1804
|
});
|
|
1804
1805
|
var orderHistoryParser = z11.object({
|
|
1805
1806
|
block_num: z11.string(),
|
|
@@ -2054,7 +2055,7 @@ var leaderboardParser = z11.object({
|
|
|
2054
2055
|
total: z11.number()
|
|
2055
2056
|
});
|
|
2056
2057
|
var getLeaderboardParser = z11.object({
|
|
2057
|
-
market_ids:
|
|
2058
|
+
market_ids: marketIdsParser,
|
|
2058
2059
|
from: z11.string(),
|
|
2059
2060
|
to: z11.string()
|
|
2060
2061
|
});
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.2.
|
|
8
|
+
"version": "0.2.126",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"typings": "dist/index.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"resolutions": {
|
|
41
41
|
"typescript": "4.5"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "9c859c69ba65b1fc1c32de8df7e6639bfbaf2fd1"
|
|
44
44
|
}
|
package/src/constants.ts
CHANGED
|
@@ -82,16 +82,16 @@ export const initializeConstants = (chain: string) => {
|
|
|
82
82
|
PROTON_ENDPOINTS:
|
|
83
83
|
chain === "proton"
|
|
84
84
|
? [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
"https://mainnet-rpc.api.protondex.com",
|
|
86
|
+
"https://proton.greymass.com",
|
|
87
|
+
"https://proton.eoscafeblock.com",
|
|
88
|
+
"https://proton.cryptolions.io",
|
|
89
|
+
"https://proton.eosusa.news",
|
|
90
|
+
]
|
|
91
91
|
: [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
"https://testnet-rpc.api.protondex.com",
|
|
93
|
+
"https://testnet.protonchain.com",
|
|
94
|
+
],
|
|
95
95
|
|
|
96
96
|
CHAIN_ID:
|
|
97
97
|
chain === "proton"
|
package/src/parsers/dex.ts
CHANGED
|
@@ -18,6 +18,12 @@ const ordinalOrderIdsParser = z
|
|
|
18
18
|
return Array.isArray(oids) ? oids : [oids];
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
+
const marketIdsParser = z
|
|
22
|
+
.array(z.coerce.number())
|
|
23
|
+
.or(z.coerce.number())
|
|
24
|
+
.transform((mids) => (Array.isArray(mids) ? mids : [mids]))
|
|
25
|
+
.refine((mids) => mids.length > 0, "Must provide atleast one market ID")
|
|
26
|
+
|
|
21
27
|
/**
|
|
22
28
|
* OHLCV
|
|
23
29
|
*/
|
|
@@ -40,7 +46,8 @@ export const getOhlcvParser = z.object({
|
|
|
40
46
|
symbol: z.string(),
|
|
41
47
|
limit: createLimit(500, 1000),
|
|
42
48
|
});
|
|
43
|
-
export type GetOHLCV = z.
|
|
49
|
+
export type GetOHLCV = z.input<typeof getOhlcvParser>;
|
|
50
|
+
export type GetOHLCVParsed = z.output<typeof getOhlcvParser>;
|
|
44
51
|
|
|
45
52
|
export const getOhlcvResponseParser = z.object({
|
|
46
53
|
sync: z.number(),
|
|
@@ -68,8 +75,8 @@ export const openOrderParser = z.object({
|
|
|
68
75
|
filled_total: z.number().optional(),
|
|
69
76
|
filled_amount: z.number().optional(),
|
|
70
77
|
filled_fee: z.number().optional(),
|
|
71
|
-
created_at: z.
|
|
72
|
-
updated_at: z.
|
|
78
|
+
created_at: z.string(),
|
|
79
|
+
updated_at: z.string(),
|
|
73
80
|
});
|
|
74
81
|
export type OpenOrder = z.infer<typeof openOrderParser>;
|
|
75
82
|
|
|
@@ -104,7 +111,8 @@ export const getOpenOrdersParser = z.object({
|
|
|
104
111
|
limit: createLimit(100, 250),
|
|
105
112
|
ordinal_order_ids: ordinalOrderIdsParser,
|
|
106
113
|
});
|
|
107
|
-
export type GetOpenOrders = z.
|
|
114
|
+
export type GetOpenOrders = z.input<typeof getOpenOrdersParser>;
|
|
115
|
+
export type GetOpenOrdersParsed = z.output<typeof getOpenOrdersParser>;
|
|
108
116
|
|
|
109
117
|
export const getOpenOrdersResponseParser = z.object({
|
|
110
118
|
sync: z.number(),
|
|
@@ -122,7 +130,8 @@ export const getOrderHistoryParser = z.object({
|
|
|
122
130
|
trx_id: z.string().optional(),
|
|
123
131
|
status: z.string().optional(),
|
|
124
132
|
});
|
|
125
|
-
export type GetOrderHistory = z.
|
|
133
|
+
export type GetOrderHistory = z.input<typeof getOrderHistoryParser>;
|
|
134
|
+
export type GetOrderHistoryParsed = z.output<typeof getOrderHistoryParser>;
|
|
126
135
|
|
|
127
136
|
export const getOrderHistoryResponseParser = z.object({
|
|
128
137
|
sync: z.number(),
|
|
@@ -137,7 +146,8 @@ export const getOrderLifecycleParser = z.object({
|
|
|
137
146
|
order_id: z.string().optional(),
|
|
138
147
|
ordinal_order_id: z.string().optional(),
|
|
139
148
|
});
|
|
140
|
-
export type GetOrderLifecycle = z.
|
|
149
|
+
export type GetOrderLifecycle = z.input<typeof getOrderLifecycleParser>;
|
|
150
|
+
export type GetOrderLifecycleParsed = z.output<typeof getOrderLifecycleParser>;
|
|
141
151
|
|
|
142
152
|
export const getOrderLifecycleResponseParser = z.object({
|
|
143
153
|
sync: z.number(),
|
|
@@ -216,7 +226,8 @@ export const getDepthParser = z.object({
|
|
|
216
226
|
step: z.coerce.number(),
|
|
217
227
|
limit: createLimit(100, 250),
|
|
218
228
|
});
|
|
219
|
-
export type GetDepth = z.
|
|
229
|
+
export type GetDepth = z.input<typeof getDepthParser>;
|
|
230
|
+
export type GetDepthParsed = z.output<typeof getDepthParser>;
|
|
220
231
|
|
|
221
232
|
export const getDepthResponseParser = z.object({
|
|
222
233
|
sync: z.number(),
|
|
@@ -332,7 +343,8 @@ export const getTradesParser = z.object({
|
|
|
332
343
|
offset: createOffset(0),
|
|
333
344
|
limit: createLimit(100, 250),
|
|
334
345
|
});
|
|
335
|
-
export type GetTrades = z.
|
|
346
|
+
export type GetTrades = z.input<typeof getTradesParser>;
|
|
347
|
+
export type GetTradesParsed = z.output<typeof getTradesParser>;
|
|
336
348
|
|
|
337
349
|
export const getTradesResponseParser = z.object({
|
|
338
350
|
sync: z.number(),
|
|
@@ -347,7 +359,8 @@ export const getTradeHistoryParser = z.object({
|
|
|
347
359
|
ordinal_order_ids: ordinalOrderIdsParser,
|
|
348
360
|
limit: createLimit(100, 250),
|
|
349
361
|
});
|
|
350
|
-
export type GetTradeHistory = z.
|
|
362
|
+
export type GetTradeHistory = z.input<typeof getTradeHistoryParser>;
|
|
363
|
+
export type GetTradeHistoryParsed = z.output<typeof getTradeHistoryParser>;
|
|
351
364
|
|
|
352
365
|
export const getTradeHistoryResponseParser = z.object({
|
|
353
366
|
sync: z.number(),
|
|
@@ -395,7 +408,8 @@ export type ReferralTotal = z.infer<typeof refferalTotalParser>;
|
|
|
395
408
|
export const getReferralTotalsParser = z.object({
|
|
396
409
|
referrer: z.string(),
|
|
397
410
|
});
|
|
398
|
-
export type GetReferralTotals = z.
|
|
411
|
+
export type GetReferralTotals = z.input<typeof getReferralTotalsParser>;
|
|
412
|
+
export type GetReferralTotalsParsed = z.output<typeof getReferralTotalsParser>;
|
|
399
413
|
|
|
400
414
|
export const getReferralTotalsResponseParser = z.object({
|
|
401
415
|
sync: z.number(),
|
|
@@ -416,7 +430,8 @@ export type Referral = z.infer<typeof refferalParser>;
|
|
|
416
430
|
export const getReferralsParser = z.object({
|
|
417
431
|
referrer: z.string(),
|
|
418
432
|
});
|
|
419
|
-
export type GetReferrals = z.
|
|
433
|
+
export type GetReferrals = z.input<typeof getReferralsParser>;
|
|
434
|
+
export type GetReferralsParsed = z.output<typeof getReferralsParser>;
|
|
420
435
|
|
|
421
436
|
export const getReferralsResponseParser = z.object({
|
|
422
437
|
sync: z.number(),
|
|
@@ -436,14 +451,12 @@ export const leaderboardParser = z.object({
|
|
|
436
451
|
export type Leaderboard = z.infer<typeof leaderboardParser>;
|
|
437
452
|
|
|
438
453
|
export const getLeaderboardParser = z.object({
|
|
439
|
-
market_ids:
|
|
440
|
-
.array(z.coerce.number())
|
|
441
|
-
.or(z.coerce.number())
|
|
442
|
-
.transform((mids) => (Array.isArray(mids) ? mids : [mids])),
|
|
454
|
+
market_ids: marketIdsParser,
|
|
443
455
|
from: z.string(),
|
|
444
456
|
to: z.string(),
|
|
445
457
|
});
|
|
446
|
-
export type GetLeaderboard = z.
|
|
458
|
+
export type GetLeaderboard = z.input<typeof getLeaderboardParser>;
|
|
459
|
+
export type GetLeaderboardParsed = z.output<typeof getLeaderboardParser>;
|
|
447
460
|
|
|
448
461
|
export const getLeaderboardResponseParser = z.object({
|
|
449
462
|
sync: z.number(),
|
|
@@ -548,7 +561,10 @@ export type HistoryTransaction = z.infer<typeof historyTransactionParser>;
|
|
|
548
561
|
export const getHistoryTransactionResponseParser = z.object({
|
|
549
562
|
data: historyTransactionParser.nullable(),
|
|
550
563
|
});
|
|
551
|
-
export type GetHistoryTransaction = z.
|
|
564
|
+
export type GetHistoryTransaction = z.input<
|
|
565
|
+
typeof getHistoryTransactionResponseParser
|
|
566
|
+
>;
|
|
567
|
+
export type GetHistoryTransactionParsed = z.output<
|
|
552
568
|
typeof getHistoryTransactionResponseParser
|
|
553
569
|
>;
|
|
554
570
|
|