Skip to content

Commit

Permalink
Add decodeInstructionV2 for serum INSTRUCTION_LAYOUT_V2 instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielparke committed Apr 7, 2022
1 parent 56d2be7 commit 3ba6b9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/serum/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export {
export {
DexInstructions,
decodeInstruction,
decodeInstructionV2,
SETTLE_FUNDS_BASE_WALLET_INDEX,
SETTLE_FUNDS_QUOTE_WALLET_INDEX,
NEW_ORDER_OPEN_ORDERS_INDEX,
Expand Down
4 changes: 4 additions & 0 deletions packages/serum/src/instructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export function decodeInstruction(message) {
return INSTRUCTION_LAYOUT.decode(message);
}

export function decodeInstructionV2(message) {
return INSTRUCTION_LAYOUT_V2.decode(message);
}

export class DexInstructions {
static initializeMarket({
market,
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,14 @@
bn.js "^5.1.2"
buffer-layout "^1.2.0"

"@project-serum/token@^0.0.1-alpha.2":
version "0.0.1-alpha.3"
resolved "https://registry.yarnpkg.com/@project-serum/token/-/token-0.0.1-alpha.3.tgz#ddf2999315ab068fa956520e8950996650bac30f"
integrity sha512-QuEDvp92u4snzK8k+yxgDmz0+I09F37/Bkw2cJdmGA8yulVd+Sy6HnSgUrxIc9qxHPUR7K/uQUuUHn/LmphUeg==
dependencies:
"@project-serum/borsh" "^0.0.1-beta.0"
bn.js "^5.1.3"

"@sinonjs/commons@^1.7.0":
version "1.8.1"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217"
Expand Down

0 comments on commit 3ba6b9a

Please sign in to comment.