-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e6c5c6
commit f2393aa
Showing
6 changed files
with
55 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import jazzicon1 from './images/jazzicon1.svg'; | ||
import jazzicon2 from './images/jazzicon2.svg'; | ||
import type { Account } from './types'; | ||
|
||
/** | ||
* Example accounts data. | ||
*/ | ||
export const accounts: Record<string, Account> = { | ||
bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh: { | ||
name: 'My Bitcoin Account', | ||
address: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', | ||
balance: { amount: 1.8, fiat: 92000 }, | ||
icon: jazzicon1, | ||
}, | ||
bc1pmpg8yzpty4xgp497qdydkcqt90zz68n48wzwm757vk8nrlkat99q272xm3: { | ||
name: 'Savings Account', | ||
address: 'bc1pmpg8yzpty4xgp497qdydkcqt90zz68n48wzwm757vk8nrlkat99q272xm3', | ||
balance: { amount: 2.5, fiat: 150000 }, | ||
icon: jazzicon2, | ||
}, | ||
}; | ||
|
||
/** | ||
* Example accounts data as an array. | ||
*/ | ||
export const accountsArray = Object.values(accounts); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect } from '@jest/globals'; | ||
import { installSnap } from '@metamask/snaps-jest'; | ||
|
||
describe('onRpcRequest', () => { | ||
it('throws an error if the requested method does not exist', async () => { | ||
const { request } = await installSnap(); | ||
|
||
const response = await request({ | ||
method: 'foo', | ||
}); | ||
|
||
expect(response).toRespondWithError({ | ||
code: -32601, | ||
message: 'The method does not exist / is not available.', | ||
stack: expect.any(String), | ||
data: { | ||
method: 'foo', | ||
cause: null, | ||
}, | ||
}); | ||
}); | ||
|
||
describe('display', () => { | ||
it.todo('shows a custom dialog with the SendFlow interface'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters