axelarnetwork / axelarjs

Axelar Network foundations for Javascript/Typescript application development
Apache License 2.0
10 stars 8 forks source link

feat: implement evm execute #380

Closed npty closed 4 months ago

npty commented 5 months ago

Description

AXE-4243

This PR migrated the execute destination contract function from sdk v1

Usage

To use the evmExecute function, call it with the required parameters:

const result = await evmExecute({
  environment: ENVIRONMENTS.mainnet,
  srcTxHash: "0x...", // The source transaction hash
  executeOptions: {
    privateKey: "0x...", // Optional: Private key for signing the transaction
    rpcUrl: "https://..." // Optional: RPC URL for the destination chain
  }
});

Important Note: Either privateKey or window.ethereum must be defined:

If you're in a browser environment with MetaMask or a similar wallet extension, window.ethereum will be used automatically. For non-browser environments or if you prefer to use a private key directly, provide the privateKey in the executeOptions.

Example with window.ethereum (browser environment):

const result = await evmExecute({
  environment: ENVIRONMENTS.mainnet,
  srcTxHash: "0x...",
  executeOptions: {
    rpcUrl: "https://..." // Optional: RPC URL for the destination chain
  }
});
vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
axelar-maestro ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:14am
axelar-registry ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:14am
axelar-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:14am
changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: 0a3e9910f21fbaf607ab528e70b0baa554fd730b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages | Name | Type | | ------------------------------ | ----- | | @axelarjs/transaction-recovery | Patch | | @axelarjs/api | Patch | | @axelarjs/evm | Patch | | @axelarjs/deposit-address | Patch | | @axelarjs/maestro | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR