Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@hanchon/evmos-ts-wallet
Advanced tools
Evmos ts/js wallet to sign and broadcast messages created with evmosjs
Evmos ts/js wallet to sign and broadcast messages created with evmosjs
yarn add @hanchon/evmos-ts-wallet
Some constants are exported as helpers but the values may not be updated for the current state of the network:
The constants for fee
and chain
should be updated by the user to follow the network upgrade and the fee changes, I'll try to keep it up to date, but probably you want to control this values in your code.
Both getSender
and brodcast
should set the option parameter called url
, this should be pointing to the port 1317
of your node or a public rest endpoint. By default is using localhost:1317
.
Both signing
functions have the optional parameter broadcastMode
that by default is BROADCAST_MODE_BLOCK
.
import { Wallet } from '@ethersproject/wallet'
import { createMessageSend } from '@tharsis/transactions'
import {
broadcast,
getSender,
LOCALNET_CHAIN,
LOCALNET_FEE,
signTransaction,
} from '@hanchon/evmos-ts-wallet'
;(async () => {
const privateMnemonic =
'pluck view carry maid bamboo river major where dutch wood certain oval order wise awkward clerk adult summer because number raven coil crunch hat'
const wallet = Wallet.fromMnemonic(privateMnemonic)
const sender = await getSender(wallet)
const txSimple = createMessageSend(LOCALNET_CHAIN, sender, LOCALNET_FEE, '', {
destinationAddress: 'evmos1pmk2r32ssqwps42y3c9d4clqlca403yd9wymgr',
amount: '1',
denom: 'aevmos',
})
const resKeplr = await signTransaction(wallet, txSimple)
const broadcastRes = await broadcast(resKeplr)
if (broadcastRes.tx_response.code === 0) {
console.log('Success')
} else {
console.log('Error')
}
})()
import { Wallet } from '@ethersproject/wallet'
import { createMessageSend } from '@tharsis/transactions'
import {
broadcast,
getSender,
LOCALNET_CHAIN,
LOCALNET_FEE,
signTransactionUsingEIP712,
} from '@hanchon/evmos-ts-wallet'
;(async () => {
const privateMnemonic =
'pluck view carry maid bamboo river major where dutch wood certain oval order wise awkward clerk adult summer because number raven coil crunch hat'
const wallet = Wallet.fromMnemonic(privateMnemonic)
const sender = await getSender(wallet)
const txSimple = createMessageSend(LOCALNET_CHAIN, sender, LOCALNET_FEE, '', {
destinationAddress: 'evmos1pmk2r32ssqwps42y3c9d4clqlca403yd9wymgr',
amount: '1',
denom: 'aevmos',
})
const resMM = await signTransactionUsingEIP712(
wallet,
sender.accountAddress,
txSimple,
)
const broadcastRes = await broadcast(resMM)
if (broadcastRes.tx_response.code === 0) {
console.log('Success')
} else {
console.log('Error')
}
})()
getSender
function will throw an error.getSender
function should be called before sending each transaction to update the nonce or manually increment the value in the sender object.v2
that is limited but should work without enforcing ESM
. In src/helper.ts
there is a basic implementation of fetch
and post
that can be used to replace node-fetch
, in case that lib is not working for your case)FAQs
Evmos ts/js wallet to sign and broadcast messages created with evmosjs
The npm package @hanchon/evmos-ts-wallet receives a total of 22 weekly downloads. As such, @hanchon/evmos-ts-wallet popularity was classified as not popular.
We found that @hanchon/evmos-ts-wallet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.