
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@xpla/xpla
Advanced tools
Transaction codec and client to communicate with any xpla blockchain.
npm install @xpla/xpla
Taking direct signing mode as example.
import { EthSecp256k1Auth } from "@interchainjs/auth/ethSecp256k1"
import { HDPath } from "@interchainjs/types";
import { Network } from "@xpla/xpla/defaults"
import { DirectSigner } from "@xpla/xpla/signers/direct"
import { toEncoders } from "@interchainjs/cosmos/utils"
import { MsgSend } from "@xpla/xplajs/cosmos/bank/v1beta1/tx"
import { StdFee } from "@interchainjs/types"
import { MessageComposer } from "@xpla/xplajs/cosmos/bank/v1beta1/tx.registry"
const [auth] = EthSecp256k1Auth.fromMnemonic("<MNEMONIC>", [HDPath.eth().toString()])
const signer = new DirectSigner(auth, toEncoders(MsgSend), Network.Testnet.rpc)
const msg = MsgSend.fromPartial({
amount: [{amount: "1", denom: "axpla"}],
fromAddress: wallet.accounts[0].address,
toAddress: "xpla1888g76xr3phk7qkfknnn8hvxyzfj0e2vuh4jmw"
})
const fee: StdFee = {
amount: [{amount: "28000000000000000", denom: "axpla"}],
gas: "100000"
}
const { send } = MessageComposer.fromPartial
const msgs = [send(msg)]
const fee: StdFee = await signer.estimateFee({messages: [msgs]})
const res = await signer.signAndBroadcast({messages: [msgs], fee})
console.log(res.hash) // the hash of TxRaw
Taking amino signing mode as example.
import { EthSecp256k1Auth } from "@interchainjs/auth/ethSecp256k1"
import { HDPath } from "@interchainjs/types";
import { Network } from "@xpla/xpla/defaults"
import { AminoSigner } from "@xpla/xpla/signers/amino"
import { toEncoders } from "@interchainjs/cosmos/utils"
import { MsgSend } from "@xpla/xplajs/cosmos/bank/v1beta1/tx"
import { StdFee } from "@interchainjs/types"
import { MessageComposer } from "@xpla/xplajs/cosmos/bank/v1beta1/tx.registry"
const [auth] = EthSecp256k1Auth.fromMnemonic("<MNEMONIC>", [HDPath.eth().toString()])
const signer = new AminoSigner(auth, toEncoders(MsgSend), toConverters(MsgSend), Network.Testnet.rpc)
const msg = MsgSend.fromPartial({
amount: [{amount: "1", denom: "axpla"}],
fromAddress: wallet.accounts[0].address,
toAddress: "xpla1888g76xr3phk7qkfknnn8hvxyzfj0e2vuh4jmw"
})
const fee: StdFee = {
amount: [{amount: "28000000000000000", denom: "axpla"}],
gas: "100000"
}
const { send } = MessageComposer.fromPartial
const msgs = [send(msg)]
const fee: StdFee = await signer.estimateFee({messages: [msgs]})
const res = await signer.signAndBroadcast({messages: [msgs], fee})
console.log(res.hash) // the hash of TxRaw
Taking PrecompileContract bank as example
import { JsonRpcProvider } from "ethers";
import { PrecompileBank } from "@xpla/xpla/evm";
const provider = new JsonRpcProvider(Network.Testnet.evm);
const bank = PrecompileBank.connect(provider);
const totalSupply = await bank.totalSupply();
console.log(totalSupply)
@xpla/xpla/signers/direct@xpla/xpla/signers/aminoMIT License (MIT) & Apache License
FAQs
Unknown package
We found that @xpla/xpla demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.