@kodiak-finance/orderly-core 2.8.30 → 2.8.32-alpha.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/dist/index.d.mts CHANGED
@@ -963,6 +963,8 @@ declare class Assets {
963
963
  token: string;
964
964
  amount: string | number;
965
965
  allowCrossChainWithdraw: boolean;
966
+ /** destination EVM address (defaults to connected account) */
967
+ receiver?: string;
966
968
  /** orderly withdraw decimals */
967
969
  decimals: number;
968
970
  }): Promise<any>;
package/dist/index.d.ts CHANGED
@@ -963,6 +963,8 @@ declare class Assets {
963
963
  token: string;
964
964
  amount: string | number;
965
965
  allowCrossChainWithdraw: boolean;
966
+ /** destination EVM address (defaults to connected account) */
967
+ receiver?: string;
966
968
  /** orderly withdraw decimals */
967
969
  decimals: number;
968
970
  }): Promise<any>;
package/dist/index.js CHANGED
@@ -5489,6 +5489,7 @@ var Assets = class {
5489
5489
  throw new Error("account address is required");
5490
5490
  }
5491
5491
  const { chainId, token, allowCrossChainWithdraw, decimals } = inputs;
5492
+ const customReceiver = typeof inputs.receiver === "string" ? inputs.receiver.trim() : "";
5492
5493
  let { amount } = inputs;
5493
5494
  if (typeof amount === "number") {
5494
5495
  amount = amount.toString();
@@ -5500,7 +5501,7 @@ var Assets = class {
5500
5501
  const nonce = await this.getWithdrawalNonce();
5501
5502
  const timestamp = getTimestamp();
5502
5503
  const messageData = {
5503
- receiver: this.account.stateValue.address,
5504
+ receiver: customReceiver || this.account.stateValue.address,
5504
5505
  token,
5505
5506
  brokerId: this.configStore.get("brokerId"),
5506
5507
  amount: this.account.walletAdapter.parseUnits(amount, decimals),
@@ -5510,7 +5511,7 @@ var Assets = class {
5510
5511
  verifyContract: this.contractManger.getContractInfoByEnv().verifyContractAddress
5511
5512
  };
5512
5513
  const agwGobalAddress = this.account.getAdditionalInfo()?.AGWAddress ?? "";
5513
- if (import_orderly_types3.ABSTRACT_CHAIN_ID_MAP.has(chainId) && agwGobalAddress) {
5514
+ if (!customReceiver && import_orderly_types3.ABSTRACT_CHAIN_ID_MAP.has(chainId) && agwGobalAddress) {
5514
5515
  messageData.receiver = agwGobalAddress;
5515
5516
  }
5516
5517
  const { message, signatured, domain } = await this.account.walletAdapter.generateWithdrawMessage(messageData);