Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
fix: match official RPC spec
Browse files Browse the repository at this point in the history
  • Loading branch information
danroc committed Sep 12, 2023
1 parent ebcc5e7 commit e466cde
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SnapKeyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@metamask/keyring-api';
import { KeyringEvent } from '@metamask/keyring-api/dist/events';
import { SnapController } from '@metamask/snaps-controllers';
import { Json } from '@metamask/utils';
import { Json, bigIntToHex } from '@metamask/utils';
import { EventEmitter } from 'events';
import { assert, object, string, record, Infer } from 'superstruct';
import { v4 as uuid } from 'uuid';
Expand Down Expand Up @@ -221,8 +221,9 @@ export class SnapKeyring extends EventEmitter {
): Promise<Json | TypedTransaction> {
const tx = toJson({
...transaction.toJSON(),
type: transaction.type,
chainId: transaction.common.chainId().toString(),
from: address,
type: `0x${transaction.type.toString(16)}`,
chainId: bigIntToHex(transaction.common.chainId()),
});

const signature = await this.#submitRequest({
Expand Down Expand Up @@ -258,7 +259,6 @@ export class SnapKeyring extends EventEmitter {

// Use 'V1' by default to match other keyring implementations.
const method = methods[opts.version] || EthMethod.SignTypedDataV1;

const signature = await this.#submitRequest({
address,
method,
Expand Down

0 comments on commit e466cde

Please sign in to comment.