Call.make
Builds a raw call: no function and no ABI, the bytes as they are, to an address or as a deployment.
import { Call, type Address, type Hex } from "@ethect/core";
const calls = (treasury: Address.Address, bytecode: Hex.Hex) => [ // a transfer of ether: no data Call.make({ to: treasury, value: 10n ** 17n }), // calldata you have already: from another library, from a relayer Call.make({ to: treasury, data: "0xd0e30db0", value: 1n }), // a deployment: no address, the creation code as data Call.make({ data: bytecode }),];A raw call is sent like any other, alone or beside calls of functions, with
Tx.
Returns
Section titled “Returns”Call.Call<Hex.Hex, never>
A call without a function. What it returns is bytes, and it declares no error. It is plain data, and not an effect.
| A raw call holds | Value |
|---|---|
fn |
undefined |
to |
the address, or undefined for a deployment |
data |
the bytes, "0x" when none was given |
value |
the value, 0n when none was given |
args |
[] |
Parameters
Section titled “Parameters”call.to (optional)
Section titled “call.to (optional)”- Type:
Address.Address
The address called. Without it the call is a deployment: its data is the creation code of a contract.
call.data (optional)
Section titled “call.data (optional)”- Type:
Hex.Hex - Default:
"0x"
The calldata, as it is sent.
call.value (optional)
Section titled “call.value (optional)”- Type:
bigint - Default:
0n
The ether the call carries, in wei.