Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for trezor in pali mv3 #611

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/config/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const MV3_OPTIONS = {
'clipboardWrite',
'unlimitedStorage',
'offscreen',
'scripting',
],
host_permissions: [
'http://*/*',
Expand Down
4 changes: 1 addition & 3 deletions source/config/generateManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const { MV2_OPTIONS, MV3_OPTIONS } = require('./consts.js');

dotenv.config();

const manifestPath = path.join(__dirname, 'manifest.json');

function generateManifest() {
console.log(process.env.MANIFEST_TYPE);
const manifestOptions =
Expand All @@ -36,7 +34,7 @@ function generateManifest() {
}

const manifestContent = JSON.stringify(manifestOptions, null, 2);
fs.writeFileSync(manifestPath, manifestContent);
fs.writeFileSync('manifest.json', manifestContent);
}

generateManifest();
10 changes: 9 additions & 1 deletion source/pages/Send/Confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,21 @@ export const SendConfirm = () => {
// SYSCOIN TRANSACTIONS
case isBitcoinBased === true:
try {
if (activeAccount.isTrezorWallet) {
await controllerEmitter(
['wallet', 'trezorSigner', 'init'],
[],
false
);
}
controllerEmitter(
['wallet', 'syscoinTransaction', 'sendTransaction'],
[
{ ...basicTxValues, fee: 0.00001 },
activeAccount.isTrezorWallet,
activeAccount.isLedgerWallet,
]
],
false
)
.then((response) => {
setConfirmedTx(response);
Expand Down
8 changes: 7 additions & 1 deletion source/pages/Settings/ConnectHardwareWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ const ConnectHardwareWalletView: FC = () => {
switch (selectedHardwareWallet) {
case 'trezor':
await controllerEmitter(
['wallet', 'importTrezorAccount'],
['wallet', 'trezorSigner', 'init'],
[],
false
);

await controllerEmitter(
['wallet', 'importTrezorAccountFromController'],
[
isBitcoinBased ? activeNetwork.currency : 'eth',
`${activeNetwork.currency === 'sys' ? '57' : slip44}`,
Expand Down
2 changes: 1 addition & 1 deletion source/scripts/Background/controllers/MainController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ class MainController extends KeyringManager {
return importedAccount;
}

public async importTrezorAccount(
public async importTrezorAccountFromController(
coin: string,
slip44: string,
index: string
Expand Down
Loading