Chains
GOAT aims to support as many chains as possible. If your chain is not supported you can open a PR to add it.
PR to support a new chain
Here are the changes you need to make to support a new chain:
Add your chain to the Chain.ts
file in the core package.
Create a new package in the wallets directory with the name of your chain (e.g. my-awesome-chain
) or copy an existing one (e.g. evm
).
In this package you will define the abstract class for your chain’s wallet client which will extend the WalletClientBase
class defined in the core package.
WalletClientBase only includes the methods that are supported by all chains such as:
getAddress
getChain
signMessage
balanceOf
As well as includes the getCoreTools
method which returns the core tools for the chain.
Create a plugin to allow sending your native token to a wallet. Create a file in the same package as your wallet client and create a new file like send<native-token>.plugin.ts
.
Implement the core plugin.
Extend your abstract class with the methods you need to implement and create your first wallet client! (e.g MyAwesomeChainKeyPairWalletClient
)
And you’re done! Now you can go and implement other wallet clients and plugins for your chain!