BuyRamBytes

The buyRamBytes method facilitates the purchase of RAM by letting you specify a number of bytes to purchase. It returns an Action instance detailing the RAM purchase. That action can then be signed and executed on-chain using the SessionKit Transact method.

Usage

The buyRamBytes method is available on any Account instance. Here is an example of how to use it:

const action = testAccount.buyRamBytes(1024)

To override the receiver of the RAM purchase, the receiver option can be specified:

const action = testAccount.buyRamBytes(1024, {
  receiver: "wharfkit1112",
})

Arguments

  • bytes: The number of bytes of RAM to purchase.

Options

The buyRamBytes method accepts an optional object with the following property:

  • receiver: Specifies the name of the Antelope account that should receive the RAM. Defaults to the payer.

Return Value

The buyRamBytes method returns an Action instance. This action can be passed to the SessionKit Transact method for execution.