Granite Upgrade Activates in06d:23h:31m:12s
Warp Messages

Parsing Warp Messages

WarpMessage

Parse a signed Warp message from hex.

Methods

MethodParametersReturnsDescription
fromHexhex: stringWarpMessageParse signed Warp message

Example

import { WarpMessage } from "@avalanche-sdk/interchain/warp";

const signedWarpMsgHex = "0x...";
const warpMsg = WarpMessage.fromHex(signedWarpMsgHex);

// Access message properties
console.log(warpMsg.networkID);
console.log(warpMsg.sourceChainID);
console.log(warpMsg.addressedCallPayload);
console.log(warpMsg.signatures);

RegisterL1ValidatorMessage

Parse a Register L1 Validator message.

Methods

MethodParametersReturnsDescription
fromHexhex: stringRegisterL1ValidatorMessageParse from hex

Example

import { RegisterL1ValidatorMessage } from "@avalanche-sdk/interchain/warp";

const msg = RegisterL1ValidatorMessage.fromHex(signedWarpMsgHex);
console.log(msg.nodeID);
console.log(msg.publicKey);
console.log(msg.signature);

L1ValidatorWeightMessage

Parse an L1 Validator Weight message.

Methods

MethodParametersReturnsDescription
fromHexhex: stringL1ValidatorWeightMessageParse from hex

Example

import { L1ValidatorWeightMessage } from "@avalanche-sdk/interchain/warp";

const msg = L1ValidatorWeightMessage.fromHex(signedWarpMsgHex);
console.log(msg.nodeID);
console.log(msg.weight);
console.log(msg.startTime);

L1ValidatorRegistrationMessage

Parse an L1 Validator Registration message.

Methods

MethodParametersReturnsDescription
fromHexhex: stringL1ValidatorRegistrationMessageParse from hex

SubnetToL1ConversionMessage

Parse a Subnet to L1 Conversion message.

Methods

MethodParametersReturnsDescription
fromHexhex: stringSubnetToL1ConversionMessageParse from hex

Example

import { SubnetToL1ConversionMessage } from "@avalanche-sdk/interchain/warp";

const msg = SubnetToL1ConversionMessage.fromHex(signedWarpMsgHex);
console.log(msg.subnetID);
console.log(msg.assetID);
console.log(msg.initialSupply);

Is this guide helpful?