@paradex/sdk 0.4.0 → 0.4.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/config.js CHANGED
@@ -1,3 +1,4 @@
1
+ import * as Starknet from 'starknet';
1
2
  /**
2
3
  * Fetches the Paradex config for the given environment.
3
4
  * This is required for account derivation.
@@ -36,7 +37,7 @@ export function buildConfig(rawConfig) {
36
37
  ]));
37
38
  return {
38
39
  starknetFullNodeRpcUrl: rawConfig.starknet_fullnode_rpc_url,
39
- starknetChainId: rawConfig.starknet_chain_id,
40
+ starknetChainId: Starknet.shortString.encodeShortString(rawConfig.starknet_chain_id),
40
41
  l1ChainId: rawConfig.l1_chain_id,
41
42
  paraclearAccountHash: rawConfig.paraclear_account_hash,
42
43
  paraclearAccountProxyHash: rawConfig.paraclear_account_proxy_hash,
@@ -115,7 +115,7 @@ interface WithdrawParams {
115
115
  * The bridge call must be made with the receivable amount calculated
116
116
  * using {@link getReceivableAmount}.
117
117
  */
118
- readonly bridgeCall: Starknet.Call;
118
+ readonly bridgeCall: Starknet.Call | readonly Starknet.Call[];
119
119
  }
120
120
  interface TransactionResult {
121
121
  readonly hash: Hex;
package/dist/paraclear.js CHANGED
@@ -108,7 +108,9 @@ export async function withdraw(params) {
108
108
  entrypoint: 'withdraw',
109
109
  calldata: [token.l2TokenAddress, chainAmountBn.toString()],
110
110
  },
111
- params.bridgeCall,
111
+ ...(Array.isArray(params.bridgeCall)
112
+ ? params.bridgeCall
113
+ : [params.bridgeCall]),
112
114
  ], undefined, { maxFee: maxFee.toString() });
113
115
  return { hash: result.transaction_hash };
114
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paradex/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "JavaScript SDK for Paradex",
5
5
  "main": "dist/index.js",
6
6
  "files": [