
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@agoric/cosmos
Advanced tools
This module manages the integration between the Cosmos x/bank module and the VM.
"Bank purses" connect Cosmos-level bank module accounts with Agoric-level ERTP purses and payments. A "bank purse" is created at the ERTP level which be observed and manipulated as other purses, but modifications to it are sent over the bridge to act upon the bank account. Updates to the bank account balance are sent over the bridge to update the bank purse, whose balance can be queried entirely at the ERTP level.
feeCollectorName
: the module which handles fee distribution to stakers.feeEpochDurationBlocks
: the duration (in blocks) over which fees should be given to the fee collector.The Vbank module maintains no significant state, but will access stored state through the bank module.
Purse operations which change the balance result in a downcall to this module to update the underlying account. A downcall is also made to query the account balance.
Upon an EndBlock()
call, the module will scan the block for all MsgSend
and MsgMultiSend
events (see cosmos-sdk/x/bank/spec/04_events.md
) and perform a VBANK_BALANCE_UPDATE
upcall for all denominations held in all mentioned accounts.
The following fields are common to the Vbank messages:
"address"
, "recipient"
, "sender"
: account address as a bech32-encoded string"amount"
: either amount to transfer or account balance, as an integer string"denom"
: denomination as a string"nonce"
: unique integer, as a number"type"
: string of the type of message (enumerated below)"updated"
: list of objects with the fields "address"
, "denom"
, "amount"
.Downcalls from JS to Cosmos (by type
):
VBANK_GET_BALANCE (type, address, denom)
: gets the account balance in the given denomination from the bank. Returns the amount as a string.VBANK_GIVE (type, recipeient, denom, amount)
: adds amount of denomination to account balance to reflect a deposit to the virtual purse. Returns a VBANK_BALANCE_UPDATE
message restricted to the recipient account and denomination.VBANK_GIVE_TO_FEE_COLLECTOR (type, denom, amount)
: stores rewards which will be gradually sent to the fee collectorVBANK_GRAB (type, sender, denom, amount)
: burns amount of denomination from account balance to reflect withdrawal from virtual purse. Returns a VBANK_BALANCE_UPDATE
message restricted to the sender account and denomination.Upcalls from Cosmos to JS: (by type
)
VBANK_BALANCE_UPDATE (type, nonce, updated)
: inform virtual purse of change to the account balance (including a change initiated by VBANK_GRAB or VBANK_GIVE).Test the following transfer scenarios:
The initial BLD and RUN purses are bank purses, but newly-created purses will not be bank purses by default.
FAQs
Connect JS to the Cosmos blockchain SDK
The npm package @agoric/cosmos receives a total of 1,425 weekly downloads. As such, @agoric/cosmos popularity was classified as popular.
We found that @agoric/cosmos demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.