Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Commit b173002

Browse files
authored
adding ExecutionMessageMetadata (#15)
* adding ExecutionMessageMetadata * updated * making sure we export
1 parent da2c21a commit b173002

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reservoir0x/relay-protocol-sdk",
3-
"version": "0.0.45",
3+
"version": "0.0.48",
44
"description": "Relay protocol SDK",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
import {
4141
ActionType,
4242
ExecutionMessage,
43+
ExecutionMessageMetadata,
4344
getExecutionMessageId,
4445
encodeAction,
4546
decodeAction,
@@ -105,6 +106,7 @@ export {
105106

106107
// Execution
107108
ExecutionMessage,
109+
ExecutionMessageMetadata,
108110
ActionType,
109111
getExecutionMessageId,
110112
encodeAction,

src/messages/v2.2/execution.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,19 @@ export enum ActionType {
1414
TRANSFER,
1515
}
1616

17+
export type ExecutionMessageMetadata = {
18+
hubTokenId: bigint;
19+
origin: {
20+
address: string;
21+
chainId: bigint;
22+
family: VmType;
23+
};
24+
};
25+
1726
export type ExecutionMessage = {
1827
idempotencyKey: string;
1928
actions: string[];
29+
metadata?: ExecutionMessageMetadata[];
2030
};
2131

2232
export const getExecutionMessageId = (message: ExecutionMessage) => {
@@ -124,12 +134,12 @@ export const encodeAction = (action: DecodedAction): string => {
124134
};
125135

126136
export const decodeAction = (action: string): DecodedAction => {
127-
// decode just the uint8 type
128-
const [ type ] = decodeAbiParameters(
137+
// decode just the uint8 type
138+
const [type] = decodeAbiParameters(
129139
parseAbiParameters(["uint8 type"]),
130140
action as Hex
131141
);
132-
142+
133143
switch (type) {
134144
case ActionType.MINT: {
135145
const result = decodeAbiParameters(

0 commit comments

Comments
 (0)