Skip to content

Commit 8aee9ae

Browse files
committed
chore: adds the METAMASK_ORIGIN
1 parent ada31f6 commit 8aee9ae

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/snap/src/core/constants/solana.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const SOL_IMAGE_URL =
77
export const MICRO_LAMPORTS_PER_LAMPORTS = 1_000_000n;
88
export const LAMPORTS_PER_SOL = 1_000_000_000;
99
export const DEFAULT_NETWORK_BLOCK_EXPLORER_URL = 'https://solscan.io';
10+
export const METAMASK_ORIGIN = 'metamask';
1011

1112
/**
1213
* Solana CAIP-2 Networks

packages/snap/src/features/send/views/SendForm/events.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { InputChangeEvent } from '@metamask/snaps-sdk';
22
import BigNumber from 'bignumber.js';
33
import { merge } from 'lodash';
44

5-
import { Networks } from '../../../../core/constants/solana';
5+
import { METAMASK_ORIGIN, Networks } from '../../../../core/constants/solana';
66
import { ScheduleBackgroundEventMethod } from '../../../../core/handlers/onCronjob/backgroundEvents/ScheduleBackgroundEventMethod';
77
import { buildUrl } from '../../../../core/utils/buildUrl';
88
import {
@@ -470,7 +470,7 @@ async function onSendButtonClick({
470470
base64EncodedTransaction: context.transactionMessage,
471471
metadata: {
472472
scope: context.scope,
473-
origin: null,
473+
origin: METAMASK_ORIGIN,
474474
},
475475
},
476476
},

packages/snap/src/features/send/views/TransactionConfirmation/events.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { METAMASK_ORIGIN } from '../../../../core/constants/solana';
12
import { ScheduleBackgroundEventMethod } from '../../../../core/handlers/onCronjob/backgroundEvents/ScheduleBackgroundEventMethod';
23
import {
34
resolveInterface,
@@ -70,7 +71,7 @@ async function onCancelButtonClick({
7071
base64EncodedTransaction: transactionMessage,
7172
metadata: {
7273
scope,
73-
origin: null,
74+
origin: METAMASK_ORIGIN,
7475
},
7576
},
7677
},
@@ -120,7 +121,7 @@ async function onConfirmButtonClick({
120121
base64EncodedTransaction: context.transactionMessage,
121122
metadata: {
122123
scope: context.scope,
123-
origin: null,
124+
origin: METAMASK_ORIGIN,
124125
},
125126
},
126127
},

0 commit comments

Comments
 (0)