Open SamantaCasal opened 1 month ago
This document describes the code changes needed to be able to replace the old wormhole-sdk to the newest one
There are two steps that need to be done for the app to be able to run with the new wormhole-sdk:
Upgrade from ethers@4 to ethers@6: ethers versions are incompatible between them, we can't have both installed, and wormhole-sdk depends on v6. Doing this includes:
BigNumber
to a native JS BigInt
, for most cases it's straight-forward, but BigNumber had the from()
function that we'll need to implement manually.Replace every common function from the old sdk to the new sdk: old sdk functions won't work anymore because of the ethers upgrade, so they'll need to be replaced before the app can run. This includes:
ChainId
in the app to the new ChainId
type from the sdkChainId.Avalanche
or CHAIN_ID_AVALANCHE
to chainToChainId('Avalanche')
parseVaa()
with the new deserialize()
methodWith those steps the app should be able to run. But, standard relayers transactions and non-api-vaa transactions (RPC transactions) won't work.
Making those work will need a refactor in all the RPCs/ethers code, which is the hardest step regarding this migration.
Describe
https://github.com/wormhole-foundation/wormhole-sdk-ts