Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@terra-money/bridge-sdk
Advanced tools
Install from npm:
npm i @terra-money/bridge-sdk
Connect station:
import { StationWallet, ChainType, BridgeType, isValidAddress } from '@terra-money/bridge-sdk'
const wallet = new StationWallet()
if (!wallet.isSupported()) {
console.log(
`${wallet.description.name} is not supported on your device, please try from a different wallet.`,
)
} else if (!wallet.isInstalled()) {
console.log(`You can install ${wallet.description.name} here: ${wallet.description.installLink}`)
}
wallet
.connect(ChainType.terra)
.then(({ address }) => console.log(address))
If you are using
TerraLedgerWallet
you can specify more options on the connect function, to select a custom derivation index (default is 0) and to use bluetooth (default is USB)
Get the balance (wallet must be already connected):
wallet
.getBalance('uluna')
.then((res) => {
res.success
? console.log(`Balance: ${res.data} uluna`)
: console.log(`Error: ${res.error}`
})
Send tx from station (wallet must be already connected):
const destinationAddress = 'osmo1...'
// validate destination address
if(!isValidAddress(destinationAddress, ChainType.osmosis)) {
console.log('Error: invalid address')
return
}
// transfer
wallet
.transfer({
src: ChainType.terra,
dst: ChainType.osmosis,
bridge: BridgeType.ibc,
address: destinationAddress,
coin: {
amount: 100_000,
denom: 'uluna',
},
})
.then((res) => {
res.success
? console.log(`TX hash: ${res.txhash}`)
: console.log(`Error: ${res.error}`
})
You can use the same functions on the
TerraLedgerWallet
,KeplrWallet
andMetaMaskWallet
to send a tx from those walletsYou can find more info about the available functions on the Wallet inteface
More IBC chains
Support for wormhole
Other wallets: (Station mobile, Coinbase wallet, BSC, WalletConnect, Keplr Mobile)
Function estimateBridgeFee()
to calculate the fee that the user will pay on the transfer.
Function waitForTx()
to wait until the tx is confirmed on-chain.
Functions onAccountChange()
and onNetworkChange()
to trigger actions when the user switch account or networ.
FAQs
## Basic usage
We found that @terra-money/bridge-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.