What is @axelar-network/axelar-gmp-sdk-solidity?
The @axelar-network/axelar-gmp-sdk-solidity package is a software development kit designed to facilitate cross-chain communication and interoperability using the Axelar Network. It provides tools and functionalities for developers to build decentralized applications that can interact across different blockchain networks seamlessly.
What are @axelar-network/axelar-gmp-sdk-solidity's main functionalities?
Cross-Chain Message Passing
This feature allows developers to send messages between different blockchain networks. The code sample demonstrates how to use the AxelarGMPClient to send a message from Ethereum to Binance Smart Chain.
const { AxelarGMPClient } = require('@axelar-network/axelar-gmp-sdk-solidity');
async function sendMessage() {
const client = new AxelarGMPClient();
const tx = await client.sendMessage({
fromChain: 'Ethereum',
toChain: 'BinanceSmartChain',
payload: 'Hello, cross-chain world!'
});
console.log('Transaction:', tx);
}
sendMessage();
Token Transfer
This feature enables the transfer of tokens across different blockchain networks. The code sample shows how to transfer USDC tokens from Ethereum to Polygon using the AxelarGMPClient.
const { AxelarGMPClient } = require('@axelar-network/axelar-gmp-sdk-solidity');
async function transferToken() {
const client = new AxelarGMPClient();
const tx = await client.transferToken({
fromChain: 'Ethereum',
toChain: 'Polygon',
token: 'USDC',
amount: '100'
});
console.log('Token Transfer Transaction:', tx);
}
transferToken();
Other packages similar to @axelar-network/axelar-gmp-sdk-solidity
wormhole-sdk
The wormhole-sdk is a cross-chain interoperability protocol that allows for the transfer of assets and data across different blockchain networks. It is similar to @axelar-network/axelar-gmp-sdk-solidity in that it facilitates cross-chain communication, but it focuses more on providing a decentralized bridge for token transfers and data messaging.
connext
Connext is a protocol for fast, low-cost, and trust-minimized cross-chain communication. It provides similar functionalities to @axelar-network/axelar-gmp-sdk-solidity by enabling developers to build applications that can interact across multiple blockchains. Connext emphasizes speed and cost-efficiency in its cross-chain transactions.
Axelar GMP SDK Solidity
General Message Passing Development Kit
This repository contains all the necessary ingredients for successful cross-chain development
utilizing the Axelar General Message Passing protocol.
Installation
$ npm install @axelar-network/axelar-gmp-sdk-solidity
Documentation
Available contracts
AxelarExecutable
Base interface for validating and executing GMP contract calls.
AxelarExpressExecutable
Interface that allows expediting GMP calls by lending assets and performing execution
before it fully propagates through the Axelar network.
Create2Deployer and Create3Deployer
These contracts are used to deploy your Executable to have the same address on different EVM chains.
This simplifies message validation from peer Executables. You can learn more in the
documentation.
Proxy and Upgradable
Base implementation of upgradable contracts designed to be deployed with Create3Deployer
and to have the same Proxy address on different EVM chains.
TokenLinker and NTFLinker
Allows developers to create their own cross-chain gateways for
ERC20 and ERC721 tokens utilizing the GMP protocol.
Also it's a great example how to use AxelarExecutable with Upgradable.
StringAddressUtils
Allows conversion between string
and address
data types
StringBytesUtil
Allows conversion between string
and bytes32
data types
for storing strings under 31 bytes into a single storage slot