@chainflip/rpc 2.2.0-alpha.5 → 2.2.0-alpha.6

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/common.d.cts CHANGED
@@ -234,18 +234,18 @@ declare const rpcResult: {
234
234
  calldata: string;
235
235
  source_token_address?: string | undefined;
236
236
  }>, z.ZodObject<{
237
- to: z.ZodEffects<z.ZodString, `0x${string}`, string>;
238
- calldata: z.ZodEffects<z.ZodString, `0x${string}`, string>;
239
237
  value: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>, z.ZodString]>, bigint, string | number>;
240
238
  source_token_address: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
241
239
  } & {
242
240
  chain: z.ZodLiteral<"Tron">;
241
+ to: z.ZodEffects<z.ZodString, string, string>;
242
+ calldata: z.ZodString;
243
243
  note: z.ZodEffects<z.ZodString, `0x${string}`, string>;
244
244
  }, "strip", z.ZodTypeAny, {
245
245
  value: bigint;
246
246
  chain: "Tron";
247
- to: `0x${string}`;
248
- calldata: `0x${string}`;
247
+ to: string;
248
+ calldata: string;
249
249
  note: `0x${string}`;
250
250
  source_token_address?: `0x${string}` | undefined;
251
251
  }, {
@@ -342,18 +342,18 @@ declare const rpcResult: {
342
342
  calldata: string;
343
343
  source_token_address?: string | undefined;
344
344
  }>, z.ZodObject<{
345
- to: z.ZodEffects<z.ZodString, `0x${string}`, string>;
346
- calldata: z.ZodEffects<z.ZodString, `0x${string}`, string>;
347
345
  value: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>, z.ZodString]>, bigint, string | number>;
348
346
  source_token_address: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
349
347
  } & {
350
348
  chain: z.ZodLiteral<"Tron">;
349
+ to: z.ZodEffects<z.ZodString, string, string>;
350
+ calldata: z.ZodString;
351
351
  note: z.ZodEffects<z.ZodString, `0x${string}`, string>;
352
352
  }, "strip", z.ZodTypeAny, {
353
353
  value: bigint;
354
354
  chain: "Tron";
355
- to: `0x${string}`;
356
- calldata: `0x${string}`;
355
+ to: string;
356
+ calldata: string;
357
357
  note: `0x${string}`;
358
358
  source_token_address?: `0x${string}` | undefined;
359
359
  }, {
package/dist/common.d.mts CHANGED
@@ -234,18 +234,18 @@ declare const rpcResult: {
234
234
  calldata: string;
235
235
  source_token_address?: string | undefined;
236
236
  }>, z.ZodObject<{
237
- to: z.ZodEffects<z.ZodString, `0x${string}`, string>;
238
- calldata: z.ZodEffects<z.ZodString, `0x${string}`, string>;
239
237
  value: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>, z.ZodString]>, bigint, string | number>;
240
238
  source_token_address: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
241
239
  } & {
242
240
  chain: z.ZodLiteral<"Tron">;
241
+ to: z.ZodEffects<z.ZodString, string, string>;
242
+ calldata: z.ZodString;
243
243
  note: z.ZodEffects<z.ZodString, `0x${string}`, string>;
244
244
  }, "strip", z.ZodTypeAny, {
245
245
  value: bigint;
246
246
  chain: "Tron";
247
- to: `0x${string}`;
248
- calldata: `0x${string}`;
247
+ to: string;
248
+ calldata: string;
249
249
  note: `0x${string}`;
250
250
  source_token_address?: `0x${string}` | undefined;
251
251
  }, {
@@ -342,18 +342,18 @@ declare const rpcResult: {
342
342
  calldata: string;
343
343
  source_token_address?: string | undefined;
344
344
  }>, z.ZodObject<{
345
- to: z.ZodEffects<z.ZodString, `0x${string}`, string>;
346
- calldata: z.ZodEffects<z.ZodString, `0x${string}`, string>;
347
345
  value: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>, z.ZodString]>, bigint, string | number>;
348
346
  source_token_address: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
349
347
  } & {
350
348
  chain: z.ZodLiteral<"Tron">;
349
+ to: z.ZodEffects<z.ZodString, string, string>;
350
+ calldata: z.ZodString;
351
351
  note: z.ZodEffects<z.ZodString, `0x${string}`, string>;
352
352
  }, "strip", z.ZodTypeAny, {
353
353
  value: bigint;
354
354
  chain: "Tron";
355
- to: `0x${string}`;
356
- calldata: `0x${string}`;
355
+ to: string;
356
+ calldata: string;
357
357
  note: `0x${string}`;
358
358
  source_token_address?: `0x${string}` | undefined;
359
359
  }, {
package/dist/parsers.cjs CHANGED
@@ -8,6 +8,7 @@ let _chainflip_utils_guard = require("@chainflip/utils/guard");
8
8
  let _chainflip_utils_ss58 = require("@chainflip/utils/ss58");
9
9
  _chainflip_utils_ss58 = require_runtime.__toESM(_chainflip_utils_ss58, 1);
10
10
  let _chainflip_utils_string = require("@chainflip/utils/string");
11
+ let _chainflip_utils_tron = require("@chainflip/utils/tron");
11
12
 
12
13
  //#region src/parsers.ts
13
14
  const accountId = zod.z.string().refine((val) => val.startsWith("cF"));
@@ -19,6 +20,7 @@ const numberOrHex = zod.z.union([
19
20
  u256,
20
21
  numericString
21
22
  ]).transform((n) => BigInt(n));
23
+ const tronAddress = zod.z.string().refine(_chainflip_utils_tron.isValidTronAddress, { message: "Invalid tron address" });
22
24
  const chainAssetMapFactory = (parser, defaultValue) => zod.z.object({
23
25
  Bitcoin: zod.z.object({ BTC: parser }),
24
26
  Ethereum: zod.z.object({
@@ -339,6 +341,8 @@ const requestSwapParameterEncoding = zod.z.discriminatedUnion("chain", [
339
341
  evmBrokerRequestSwapParameterEncoding.extend({ chain: zod.z.literal("Arbitrum") }),
340
342
  evmBrokerRequestSwapParameterEncoding.extend({
341
343
  chain: zod.z.literal("Tron"),
344
+ to: tronAddress,
345
+ calldata: zod.z.string(),
342
346
  note: hexString
343
347
  }),
344
348
  zod.z.object({
@@ -930,6 +934,7 @@ exports.requestSwapParameterEncoding = requestSwapParameterEncoding;
930
934
  exports.rpcResponse = rpcResponse;
931
935
  exports.stateGetMetadata = stateGetMetadata;
932
936
  exports.stateGetRuntimeVersion = stateGetRuntimeVersion;
937
+ exports.tronAddress = tronAddress;
933
938
  exports.u256 = u256;
934
939
  exports.unregistered = unregistered;
935
940
  exports.validator = validator;
@@ -5,6 +5,7 @@ declare const hexString: z.ZodEffects<z.ZodString, `0x${string}`, string>;
5
5
  declare const u256: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>;
6
6
  declare const numericString: z.ZodString;
7
7
  declare const numberOrHex: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>, z.ZodString]>, bigint, string | number>;
8
+ declare const tronAddress: z.ZodEffects<z.ZodString, string, string>;
8
9
  declare const rpcAssetSchema: z.ZodUnion<[z.ZodObject<{
9
10
  chain: z.ZodLiteral<"Bitcoin">;
10
11
  asset: z.ZodLiteral<"BTC">;
@@ -22714,18 +22715,18 @@ declare const requestSwapParameterEncoding: z.ZodDiscriminatedUnion<"chain", [z.
22714
22715
  calldata: string;
22715
22716
  source_token_address?: string | undefined;
22716
22717
  }>, z.ZodObject<{
22717
- to: z.ZodEffects<z.ZodString, `0x${string}`, string>;
22718
- calldata: z.ZodEffects<z.ZodString, `0x${string}`, string>;
22719
22718
  value: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>, z.ZodString]>, bigint, string | number>;
22720
22719
  source_token_address: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
22721
22720
  } & {
22722
22721
  chain: z.ZodLiteral<"Tron">;
22722
+ to: z.ZodEffects<z.ZodString, string, string>;
22723
+ calldata: z.ZodString;
22723
22724
  note: z.ZodEffects<z.ZodString, `0x${string}`, string>;
22724
22725
  }, "strip", z.ZodTypeAny, {
22725
22726
  value: bigint;
22726
22727
  chain: "Tron";
22727
- to: `0x${string}`;
22728
- calldata: `0x${string}`;
22728
+ to: string;
22729
+ calldata: string;
22729
22730
  note: `0x${string}`;
22730
22731
  source_token_address?: `0x${string}` | undefined;
22731
22732
  }, {
@@ -43905,4 +43906,4 @@ declare const cfAllLoans: z.ZodArray<z.ZodObject<{
43905
43906
  created_at?: number | undefined;
43906
43907
  }>, "many">;
43907
43908
  //#endregion
43908
- export { AssetAndChain, RpcLimitOrder, RpcRangeOrder, accountInfoCommon, broker, brokerRequestAccountCreationDepositAddress, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAllLoans, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfIngressEgressEvents, cfLendingConfig, cfLendingPoolSupplyBalances, cfLendingPools, cfLoanAccount, cfLoanAccounts, cfMonitoringSimulateAuction, cfOraclePrices, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, cfVaultAddresses, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, numericString, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
43909
+ export { AssetAndChain, RpcLimitOrder, RpcRangeOrder, accountInfoCommon, broker, brokerRequestAccountCreationDepositAddress, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAllLoans, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfIngressEgressEvents, cfLendingConfig, cfLendingPoolSupplyBalances, cfLendingPools, cfLoanAccount, cfLoanAccounts, cfMonitoringSimulateAuction, cfOraclePrices, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, cfVaultAddresses, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, numericString, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, tronAddress, u256, unregistered, validator };
@@ -5,6 +5,7 @@ declare const hexString: z.ZodEffects<z.ZodString, `0x${string}`, string>;
5
5
  declare const u256: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>;
6
6
  declare const numericString: z.ZodString;
7
7
  declare const numberOrHex: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>, z.ZodString]>, bigint, string | number>;
8
+ declare const tronAddress: z.ZodEffects<z.ZodString, string, string>;
8
9
  declare const rpcAssetSchema: z.ZodUnion<[z.ZodObject<{
9
10
  chain: z.ZodLiteral<"Bitcoin">;
10
11
  asset: z.ZodLiteral<"BTC">;
@@ -22714,18 +22715,18 @@ declare const requestSwapParameterEncoding: z.ZodDiscriminatedUnion<"chain", [z.
22714
22715
  calldata: string;
22715
22716
  source_token_address?: string | undefined;
22716
22717
  }>, z.ZodObject<{
22717
- to: z.ZodEffects<z.ZodString, `0x${string}`, string>;
22718
- calldata: z.ZodEffects<z.ZodString, `0x${string}`, string>;
22719
22718
  value: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>, z.ZodString]>, bigint, string | number>;
22720
22719
  source_token_address: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
22721
22720
  } & {
22722
22721
  chain: z.ZodLiteral<"Tron">;
22722
+ to: z.ZodEffects<z.ZodString, string, string>;
22723
+ calldata: z.ZodString;
22723
22724
  note: z.ZodEffects<z.ZodString, `0x${string}`, string>;
22724
22725
  }, "strip", z.ZodTypeAny, {
22725
22726
  value: bigint;
22726
22727
  chain: "Tron";
22727
- to: `0x${string}`;
22728
- calldata: `0x${string}`;
22728
+ to: string;
22729
+ calldata: string;
22729
22730
  note: `0x${string}`;
22730
22731
  source_token_address?: `0x${string}` | undefined;
22731
22732
  }, {
@@ -43905,4 +43906,4 @@ declare const cfAllLoans: z.ZodArray<z.ZodObject<{
43905
43906
  created_at?: number | undefined;
43906
43907
  }>, "many">;
43907
43908
  //#endregion
43908
- export { AssetAndChain, RpcLimitOrder, RpcRangeOrder, accountInfoCommon, broker, brokerRequestAccountCreationDepositAddress, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAllLoans, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfIngressEgressEvents, cfLendingConfig, cfLendingPoolSupplyBalances, cfLendingPools, cfLoanAccount, cfLoanAccounts, cfMonitoringSimulateAuction, cfOraclePrices, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, cfVaultAddresses, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, numericString, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
43909
+ export { AssetAndChain, RpcLimitOrder, RpcRangeOrder, accountInfoCommon, broker, brokerRequestAccountCreationDepositAddress, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAllLoans, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfIngressEgressEvents, cfLendingConfig, cfLendingPoolSupplyBalances, cfLendingPools, cfLoanAccount, cfLoanAccounts, cfMonitoringSimulateAuction, cfOraclePrices, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, cfVaultAddresses, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, numericString, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, tronAddress, u256, unregistered, validator };
package/dist/parsers.mjs CHANGED
@@ -5,6 +5,7 @@ import { CHAINFLIP_SS58_PREFIX } from "@chainflip/utils/consts";
5
5
  import { isUndefined } from "@chainflip/utils/guard";
6
6
  import * as ss58 from "@chainflip/utils/ss58";
7
7
  import { isHex } from "@chainflip/utils/string";
8
+ import { isValidTronAddress } from "@chainflip/utils/tron";
8
9
 
9
10
  //#region src/parsers.ts
10
11
  const accountId = z.string().refine((val) => val.startsWith("cF"));
@@ -16,6 +17,7 @@ const numberOrHex = z.union([
16
17
  u256,
17
18
  numericString
18
19
  ]).transform((n) => BigInt(n));
20
+ const tronAddress = z.string().refine(isValidTronAddress, { message: "Invalid tron address" });
19
21
  const chainAssetMapFactory = (parser, defaultValue) => z.object({
20
22
  Bitcoin: z.object({ BTC: parser }),
21
23
  Ethereum: z.object({
@@ -336,6 +338,8 @@ const requestSwapParameterEncoding = z.discriminatedUnion("chain", [
336
338
  evmBrokerRequestSwapParameterEncoding.extend({ chain: z.literal("Arbitrum") }),
337
339
  evmBrokerRequestSwapParameterEncoding.extend({
338
340
  chain: z.literal("Tron"),
341
+ to: tronAddress,
342
+ calldata: z.string(),
339
343
  note: hexString
340
344
  }),
341
345
  z.object({
@@ -875,4 +879,4 @@ const cfVaultAddresses = z.object({
875
879
  const cfAllLoans = z.array(cfLoan);
876
880
 
877
881
  //#endregion
878
- export { accountInfoCommon, broker, brokerRequestAccountCreationDepositAddress, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAllLoans, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfIngressEgressEvents, cfLendingConfig, cfLendingPoolSupplyBalances, cfLendingPools, cfLoanAccount, cfLoanAccounts, cfMonitoringSimulateAuction, cfOraclePrices, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, cfVaultAddresses, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, numericString, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
882
+ export { accountInfoCommon, broker, brokerRequestAccountCreationDepositAddress, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAllLoans, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfIngressEgressEvents, cfLendingConfig, cfLendingPoolSupplyBalances, cfLendingPools, cfLoanAccount, cfLoanAccounts, cfMonitoringSimulateAuction, cfOraclePrices, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, cfVaultAddresses, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, numericString, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, tronAddress, u256, unregistered, validator };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "2.2.0-alpha.5",
3
+ "version": "2.2.0-alpha.6",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@chainflip/utils": "2.2.0-alpha.1",