
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@equilab/api
Advanced tools
API bindings to access Equilibruim substrate queries and transactions
NOTE Typescript bindings included
# Testnet version
$ npm i --save @equilab/api # if you are using npm or
$ yarn add @equilab/api # for yarn package manager
# Mainnet version
$ npm i --save @equilab/api@tge
$ yarn add @equilab/api@tge
Use createApi(node: string) factory from @equilab/api package
import { createApi } from "@equilab/api";
(async () => { // async/await usage
// Connect to TGE node with websocket
const api = await createApi("wss://tge.equilibrium.io:9944");
// do the interaction below
const balance = await api.getBalance("YOUR_ADDRESS", "EQ"); // get EQ tokens
console.log(balance.toJSON());
})();
createApi("wss://tge.equilibrium.io:9944")
.then(api => api.getBalance("YOUR_ADDRESS", "EQ"))
.then(balance => console.log(balance.toJSON())); // Promise usage
type Currency = "Unknown" | "Usd" | "EQ" | "Eth" | "Btc" | "Eos" | "Dot";
type UserGroup = "Unknown" | "Balances" | "Bailsmen" | "Borrowers" | "Lenders";
type UnsubscribePromise = Promise<() => void /* call this func to unsubscribe */>;
interface SignedBalance {
readonly isPositive: boolean;
readonly asPositive: Balance;
readonly isNegative: boolean;
readonly asNegative: Balance;
}
interface DataPoint {
price: u64;
account_id: AccountId;
block_number: BlockNumber;
timestamp: u64;
}
interface PricePoint {
block_number: BlockNumber;
timestamp: u64;
price: u64;
data_points: Vec<DataPoint>;
}
Fetch list of addresses in system
Fetch hash of block by its number
Retrieves the best finalized header via subscription
Sets transaction signer, can be used with injected wallet
Allows for the querying of multiple storage entries and the combination thereof into a single result. This is a very optimal way to make multiple queries since it only makes a single connection to the node and retrieves the data over one subscription. Refer to multiple queries section of polkadot.js api docs
Fetch next available nonce for this address
Storage queries are compliant with Polkadot.JS storage interfaces
Pallet storage - balances for all accounts
Testnet only
Pallet storage for added price points
Testnet only
Pallet storage - vectors of prices for every Currency
for each PricePeriod
Pallet storage - volatilities for every Currency
Pallet storage: information about already vested balances for given account
Pallet storage: information regarding the vesting of a given account
Pallet storage - stores amount to be claimed by each EthereumAddress
Pallet storage - stores Ethereum addresses from which additional statement
singing is required
Pallet storage - vesting schedule for a claim.
First balance is the total amount that should be held for vesting.
Second balance is how much should be unlocked per block.
The block number is when the vesting should start.
Pallet storage - total Claims
amount
Testnet only
Pallet storage - stores user groups
Testnet only
Pallet storage - stores aggregates for each user group
Pallet storage - double map storing subaccounts as AccountId
where
user's main AccountId
and SubAccType
used as keys
Pallet storage - a map storing a tuple (AccountId
, SubAccType
)
for each existing subaccount. First element in stored tuple is
AccountId
of main user account, owning the subaccount and second
is SubAccType
of key subaccount
Transaction methods are compliant with Polkadot.JS transaction interfaces
Testnet only
Transfers value
amount of currency
from trx sender to account id to
Authenticates the sudo key and dispatches a function call with Root
origin.
The dispatch origin for this call must be Signed.
call
execution + 10,000.Testnet only
Unlock any vested funds of the sender account.
The dispatch origin for this call must be Signed and the sender must have funds still
locked under this module.
Emits either VestingCompleted
or VestingUpdated
.
Unlock any vested funds of a target
account.
The dispatch origin for this call must be Signed.
target
: The account whose vested funds should be unlocked. Must have funds stillEmits either VestingCompleted
or VestingUpdated
.
Make a claim to collect your currency.
The dispatch origin for this call must be None.
Unsigned Validation:
A call to claim is deemed valid if the signature provided matches
the expected signed message of:
Ethereum Signed Message:
(configured prefix string)(address)
and address
matches the dest
account.
Parameters:
dest
: The destination account to payout the claim.
ethereum_signature
: The signature of an ethereum signed message
matching the format described above.
Make a claim to collect your currency by signing a statement.
The dispatch origin for this call must be None.
Unsigned Validation:
A call to claim_attest
is deemed valid if the signature provided matches
the expected signed message of:
Ethereum Signed Message:
(configured prefix string)(address)(statement)
and address
matches the dest
account; the statement
must match that which is
expected according to your purchase arrangement.
Parameters:
dest
: The destination account to payout the claim.
ethereum_signature
: The signature of an ethereum signed message
matching the format described above.
statement
: The identity of the statement which is being attested to in the signature.
Transfers amount
of currency
from subaccount to main account. If subacc_type
is Bailsman
and it's total collateral value becomes less than minimal bailsman
collateral value - subaccount will be unregistered as bailsman.
Transfers value
amount of currency
from main account to subacc_type
subaccount
FAQs
JS API for Equilibrium and Genshiro parachains.
The npm package @equilab/api receives a total of 64 weekly downloads. As such, @equilab/api popularity was classified as not popular.
We found that @equilab/api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.