@chainflip/rpc 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/common.d.cts CHANGED
@@ -80,37 +80,6 @@ type EncodeCfParametersParams = [
80
80
  dcaParams?: Nullish<DcaParams>
81
81
  ];
82
82
  type RpcRequest = WithHash<{
83
- broker_request_swap_deposit_address: [
84
- sourceAsset: UncheckedAssetAndChain,
85
- destinationAsset: UncheckedAssetAndChain,
86
- destinationAddress: string,
87
- brokerCommission: number,
88
- ccmMetadata: Nullish<CcmParams>,
89
- boostFee: Nullish<number>,
90
- affiliateFees: Nullish<{
91
- account: string;
92
- bps: number;
93
- }[]>,
94
- fillOrKillParams: FillOrKillParams,
95
- dcaParams?: Nullish<DcaParams>
96
- ];
97
- broker_request_account_creation_deposit_address: [
98
- signatureData: {
99
- Ethereum: {
100
- signature: HexString;
101
- signer: HexString;
102
- sig_type: 'Eip712';
103
- };
104
- },
105
- transactionMetadata: {
106
- nonce: number;
107
- expiry_block: number;
108
- },
109
- asset: UncheckedAssetAndChain,
110
- boostFee: Nullish<number>,
111
- refundAddress: string
112
- ];
113
- broker_request_swap_parameter_encoding: RequestSwapParameterEncodingParams;
114
83
  cf_request_swap_parameter_encoding: [
115
84
  brokerAccountId: string,
116
85
  ...RequestSwapParameterEncodingParams
@@ -215,6 +184,37 @@ type RpcRequest = WithHash<{
215
184
  cf_get_vault_addresses: [];
216
185
  }> & {
217
186
  chain_getBlockHash: [blockHeight?: number];
187
+ broker_request_swap_deposit_address: [
188
+ sourceAsset: UncheckedAssetAndChain,
189
+ destinationAsset: UncheckedAssetAndChain,
190
+ destinationAddress: string,
191
+ brokerCommission: number,
192
+ ccmMetadata: Nullish<CcmParams>,
193
+ boostFee: Nullish<number>,
194
+ affiliateFees: Nullish<{
195
+ account: string;
196
+ bps: number;
197
+ }[]>,
198
+ fillOrKillParams: FillOrKillParams,
199
+ dcaParams?: Nullish<DcaParams>
200
+ ];
201
+ broker_request_account_creation_deposit_address: [
202
+ signatureData: {
203
+ Ethereum: {
204
+ signature: HexString;
205
+ signer: HexString;
206
+ sig_type: 'Eip712';
207
+ };
208
+ },
209
+ transactionMetadata: {
210
+ nonce: number;
211
+ expiry_block: number;
212
+ },
213
+ asset: UncheckedAssetAndChain,
214
+ boostFee: Nullish<number>,
215
+ refundAddress: string
216
+ ];
217
+ broker_request_swap_parameter_encoding: RequestSwapParameterEncodingParams;
218
218
  };
219
219
  declare const rpcResult: {
220
220
  readonly broker_request_swap_deposit_address: z.ZodObject<{
@@ -26870,7 +26870,7 @@ declare const rpcResult: {
26870
26870
  lp_id: string;
26871
26871
  }[];
26872
26872
  }>>, "many">;
26873
- readonly cf_get_vault_addresses: z.ZodEffects<z.ZodEffects<z.ZodObject<{
26873
+ readonly cf_get_vault_addresses: z.ZodEffects<z.ZodObject<{
26874
26874
  ethereum: z.ZodObject<{
26875
26875
  Eth: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, `0x${string}`, number[]>;
26876
26876
  }, "strip", z.ZodTypeAny, {
@@ -26915,27 +26915,7 @@ declare const rpcResult: {
26915
26915
  }>, {
26916
26916
  Ethereum: `0x${string}`;
26917
26917
  Arbitrum: `0x${string}`;
26918
- Bitcoin: Map<`cF${string}`, {
26919
- current: string;
26920
- previous: string;
26921
- }>;
26922
- }, {
26923
- ethereum: {
26924
- Eth: number[];
26925
- };
26926
- arbitrum: {
26927
- Arb: number[];
26928
- };
26929
- bitcoin: [string, {
26930
- Btc: number[];
26931
- }][];
26932
- }>, {
26933
- Ethereum: `0x${string}`;
26934
- Arbitrum: `0x${string}`;
26935
- Bitcoin: Map<`cF${string}`, {
26936
- current: string;
26937
- previous: string;
26938
- }>;
26918
+ Bitcoin: Map<`cF${string}`, string>;
26939
26919
  }, {
26940
26920
  ethereum: {
26941
26921
  Eth: number[];
package/dist/common.d.ts CHANGED
@@ -80,37 +80,6 @@ type EncodeCfParametersParams = [
80
80
  dcaParams?: Nullish<DcaParams>
81
81
  ];
82
82
  type RpcRequest = WithHash<{
83
- broker_request_swap_deposit_address: [
84
- sourceAsset: UncheckedAssetAndChain,
85
- destinationAsset: UncheckedAssetAndChain,
86
- destinationAddress: string,
87
- brokerCommission: number,
88
- ccmMetadata: Nullish<CcmParams>,
89
- boostFee: Nullish<number>,
90
- affiliateFees: Nullish<{
91
- account: string;
92
- bps: number;
93
- }[]>,
94
- fillOrKillParams: FillOrKillParams,
95
- dcaParams?: Nullish<DcaParams>
96
- ];
97
- broker_request_account_creation_deposit_address: [
98
- signatureData: {
99
- Ethereum: {
100
- signature: HexString;
101
- signer: HexString;
102
- sig_type: 'Eip712';
103
- };
104
- },
105
- transactionMetadata: {
106
- nonce: number;
107
- expiry_block: number;
108
- },
109
- asset: UncheckedAssetAndChain,
110
- boostFee: Nullish<number>,
111
- refundAddress: string
112
- ];
113
- broker_request_swap_parameter_encoding: RequestSwapParameterEncodingParams;
114
83
  cf_request_swap_parameter_encoding: [
115
84
  brokerAccountId: string,
116
85
  ...RequestSwapParameterEncodingParams
@@ -215,6 +184,37 @@ type RpcRequest = WithHash<{
215
184
  cf_get_vault_addresses: [];
216
185
  }> & {
217
186
  chain_getBlockHash: [blockHeight?: number];
187
+ broker_request_swap_deposit_address: [
188
+ sourceAsset: UncheckedAssetAndChain,
189
+ destinationAsset: UncheckedAssetAndChain,
190
+ destinationAddress: string,
191
+ brokerCommission: number,
192
+ ccmMetadata: Nullish<CcmParams>,
193
+ boostFee: Nullish<number>,
194
+ affiliateFees: Nullish<{
195
+ account: string;
196
+ bps: number;
197
+ }[]>,
198
+ fillOrKillParams: FillOrKillParams,
199
+ dcaParams?: Nullish<DcaParams>
200
+ ];
201
+ broker_request_account_creation_deposit_address: [
202
+ signatureData: {
203
+ Ethereum: {
204
+ signature: HexString;
205
+ signer: HexString;
206
+ sig_type: 'Eip712';
207
+ };
208
+ },
209
+ transactionMetadata: {
210
+ nonce: number;
211
+ expiry_block: number;
212
+ },
213
+ asset: UncheckedAssetAndChain,
214
+ boostFee: Nullish<number>,
215
+ refundAddress: string
216
+ ];
217
+ broker_request_swap_parameter_encoding: RequestSwapParameterEncodingParams;
218
218
  };
219
219
  declare const rpcResult: {
220
220
  readonly broker_request_swap_deposit_address: z.ZodObject<{
@@ -26870,7 +26870,7 @@ declare const rpcResult: {
26870
26870
  lp_id: string;
26871
26871
  }[];
26872
26872
  }>>, "many">;
26873
- readonly cf_get_vault_addresses: z.ZodEffects<z.ZodEffects<z.ZodObject<{
26873
+ readonly cf_get_vault_addresses: z.ZodEffects<z.ZodObject<{
26874
26874
  ethereum: z.ZodObject<{
26875
26875
  Eth: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, `0x${string}`, number[]>;
26876
26876
  }, "strip", z.ZodTypeAny, {
@@ -26915,27 +26915,7 @@ declare const rpcResult: {
26915
26915
  }>, {
26916
26916
  Ethereum: `0x${string}`;
26917
26917
  Arbitrum: `0x${string}`;
26918
- Bitcoin: Map<`cF${string}`, {
26919
- current: string;
26920
- previous: string;
26921
- }>;
26922
- }, {
26923
- ethereum: {
26924
- Eth: number[];
26925
- };
26926
- arbitrum: {
26927
- Arb: number[];
26928
- };
26929
- bitcoin: [string, {
26930
- Btc: number[];
26931
- }][];
26932
- }>, {
26933
- Ethereum: `0x${string}`;
26934
- Arbitrum: `0x${string}`;
26935
- Bitcoin: Map<`cF${string}`, {
26936
- current: string;
26937
- previous: string;
26938
- }>;
26918
+ Bitcoin: Map<`cF${string}`, string>;
26939
26919
  }, {
26940
26920
  ethereum: {
26941
26921
  Eth: number[];
package/dist/parsers.cjs CHANGED
@@ -691,33 +691,14 @@ var cfVaultAddresses = _zod.z.object({
691
691
  ])
692
692
  )
693
693
  }).transform(({ ethereum, arbitrum, bitcoin }) => {
694
- const bitcoinAddresses = bitcoin.reduce((acc, [brokerId, { Btc }]) => {
695
- let obj = acc.get(brokerId);
696
- if (!obj) {
697
- obj = { current: "", previous: "" };
698
- acc.set(brokerId, obj);
699
- }
700
- if (!obj.previous) {
701
- obj.previous = Btc;
702
- } else {
703
- obj.current = Btc;
704
- }
705
- return acc;
706
- }, /* @__PURE__ */ new Map());
694
+ const bitcoinAddresses = new Map(
695
+ bitcoin.map(([brokerId, { Btc }]) => [brokerId, Btc])
696
+ );
707
697
  return {
708
698
  Ethereum: ethereum.Eth,
709
699
  Arbitrum: arbitrum.Arb,
710
700
  Bitcoin: bitcoinAddresses
711
701
  };
712
- }).superRefine(({ Bitcoin }, ctx) => {
713
- Bitcoin.forEach((value, key) => {
714
- if (!value.current) {
715
- ctx.addIssue({
716
- message: `No current BTC address for broker ${key}`,
717
- code: _zod.z.ZodIssueCode.custom
718
- });
719
- }
720
- });
721
702
  });
722
703
 
723
704
 
@@ -31923,7 +31923,7 @@ declare const cfLendingPoolSupplyBalances: z.ZodArray<z.ZodIntersection<z.ZodUni
31923
31923
  lp_id: string;
31924
31924
  }[];
31925
31925
  }>>, "many">;
31926
- declare const cfVaultAddresses: z.ZodEffects<z.ZodEffects<z.ZodObject<{
31926
+ declare const cfVaultAddresses: z.ZodEffects<z.ZodObject<{
31927
31927
  ethereum: z.ZodObject<{
31928
31928
  Eth: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, `0x${string}`, number[]>;
31929
31929
  }, "strip", z.ZodTypeAny, {
@@ -31968,27 +31968,7 @@ declare const cfVaultAddresses: z.ZodEffects<z.ZodEffects<z.ZodObject<{
31968
31968
  }>, {
31969
31969
  Ethereum: `0x${string}`;
31970
31970
  Arbitrum: `0x${string}`;
31971
- Bitcoin: Map<`cF${string}`, {
31972
- current: string;
31973
- previous: string;
31974
- }>;
31975
- }, {
31976
- ethereum: {
31977
- Eth: number[];
31978
- };
31979
- arbitrum: {
31980
- Arb: number[];
31981
- };
31982
- bitcoin: [string, {
31983
- Btc: number[];
31984
- }][];
31985
- }>, {
31986
- Ethereum: `0x${string}`;
31987
- Arbitrum: `0x${string}`;
31988
- Bitcoin: Map<`cF${string}`, {
31989
- current: string;
31990
- previous: string;
31991
- }>;
31971
+ Bitcoin: Map<`cF${string}`, string>;
31992
31972
  }, {
31993
31973
  ethereum: {
31994
31974
  Eth: number[];
package/dist/parsers.d.ts CHANGED
@@ -31923,7 +31923,7 @@ declare const cfLendingPoolSupplyBalances: z.ZodArray<z.ZodIntersection<z.ZodUni
31923
31923
  lp_id: string;
31924
31924
  }[];
31925
31925
  }>>, "many">;
31926
- declare const cfVaultAddresses: z.ZodEffects<z.ZodEffects<z.ZodObject<{
31926
+ declare const cfVaultAddresses: z.ZodEffects<z.ZodObject<{
31927
31927
  ethereum: z.ZodObject<{
31928
31928
  Eth: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, `0x${string}`, number[]>;
31929
31929
  }, "strip", z.ZodTypeAny, {
@@ -31968,27 +31968,7 @@ declare const cfVaultAddresses: z.ZodEffects<z.ZodEffects<z.ZodObject<{
31968
31968
  }>, {
31969
31969
  Ethereum: `0x${string}`;
31970
31970
  Arbitrum: `0x${string}`;
31971
- Bitcoin: Map<`cF${string}`, {
31972
- current: string;
31973
- previous: string;
31974
- }>;
31975
- }, {
31976
- ethereum: {
31977
- Eth: number[];
31978
- };
31979
- arbitrum: {
31980
- Arb: number[];
31981
- };
31982
- bitcoin: [string, {
31983
- Btc: number[];
31984
- }][];
31985
- }>, {
31986
- Ethereum: `0x${string}`;
31987
- Arbitrum: `0x${string}`;
31988
- Bitcoin: Map<`cF${string}`, {
31989
- current: string;
31990
- previous: string;
31991
- }>;
31971
+ Bitcoin: Map<`cF${string}`, string>;
31992
31972
  }, {
31993
31973
  ethereum: {
31994
31974
  Eth: number[];
package/dist/parsers.mjs CHANGED
@@ -691,33 +691,14 @@ var cfVaultAddresses = z.object({
691
691
  ])
692
692
  )
693
693
  }).transform(({ ethereum, arbitrum, bitcoin }) => {
694
- const bitcoinAddresses = bitcoin.reduce((acc, [brokerId, { Btc }]) => {
695
- let obj = acc.get(brokerId);
696
- if (!obj) {
697
- obj = { current: "", previous: "" };
698
- acc.set(brokerId, obj);
699
- }
700
- if (!obj.previous) {
701
- obj.previous = Btc;
702
- } else {
703
- obj.current = Btc;
704
- }
705
- return acc;
706
- }, /* @__PURE__ */ new Map());
694
+ const bitcoinAddresses = new Map(
695
+ bitcoin.map(([brokerId, { Btc }]) => [brokerId, Btc])
696
+ );
707
697
  return {
708
698
  Ethereum: ethereum.Eth,
709
699
  Arbitrum: arbitrum.Arb,
710
700
  Bitcoin: bitcoinAddresses
711
701
  };
712
- }).superRefine(({ Bitcoin }, ctx) => {
713
- Bitcoin.forEach((value, key) => {
714
- if (!value.current) {
715
- ctx.addIssue({
716
- message: `No current BTC address for broker ${key}`,
717
- code: z.ZodIssueCode.custom
718
- });
719
- }
720
- });
721
702
  });
722
703
  export {
723
704
  accountInfoCommon,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@chainflip/utils": "0.11.0",
7
7
  "zod": "^3.25.75"
8
8
  },
9
9
  "devDependencies": {
10
- "@types/node": "^24.10.0",
10
+ "@types/node": "^24.10.1",
11
11
  "@types/ws": "^8.18.1",
12
12
  "ws": "^8.18.3"
13
13
  },