Repository navigation
chore(stellar): read asset metadata from controller and gated by FF and local config #493
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
Changes from all commits
6ddfdd9
4e3eb89
dd84af1
94fe3bc
67b7d94
6d48c21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. praise: just like Tron's, very nice 👏 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import type { | ||
| AssetsControllerGetAccountAssetByIDAction, | ||
| AssetsControllerGetAccountAssetsByIDsAction, | ||
| AssetsControllerGetAccountAssetsByScopeAction, | ||
| AssetsControllerGetAssetMetadataAction, | ||
| } from '@metamask/assets-controller'; | ||
| import type { Messenger } from '@metamask/messenger'; | ||
| import type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller'; | ||
| import type { AsyncMessenger } from '@metamask/snaps-sdk'; | ||
|
|
||
| /** | ||
| * Namespace for this Snap's Core messenger endowment. | ||
| */ | ||
| export const STELLAR_WALLET_SNAP_MESSENGER_NAMESPACE = | ||
| 'StellarWalletSnap' as const; | ||
|
|
||
| export type CoreMessengerActions = | ||
| | RemoteFeatureFlagControllerGetStateAction | ||
| | AssetsControllerGetAccountAssetByIDAction | ||
| | AssetsControllerGetAccountAssetsByIDsAction | ||
| | AssetsControllerGetAccountAssetsByScopeAction | ||
| | AssetsControllerGetAssetMetadataAction; | ||
|
|
||
| /** | ||
| * Messenger type passed to `getMessenger` for Core controller actions. | ||
| */ | ||
| export type CoreMessenger = Messenger< | ||
| typeof STELLAR_WALLET_SNAP_MESSENGER_NAMESPACE, | ||
| CoreMessengerActions | ||
| >; | ||
|
|
||
| /** | ||
| * Async messenger returned by `getMessenger` for Core controller actions | ||
| * available to this Snap via `endowment:messenger`. | ||
| */ | ||
| export type CoreMessengerClient = AsyncMessenger<CoreMessenger>; | ||
|
|
||
| /** | ||
| * Narrow dependency for services that only need to invoke Core actions. | ||
| */ | ||
| export type CoreMessengerCaller = Pick<CoreMessengerClient, 'call'>; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ export const ValidStellarAmountStruct = refine( | |
| if ( | ||
| (decimalPlaces && decimalPlaces > STELLAR_DECIMAL_PLACES) || | ||
| // > Max value | ||
| toSmallestUnit(amount).gt(new BigNumber(MAX_INT64).toString()) | ||
| toSmallestUnit(amount).gt(MAX_INT64) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not related to this PR, but just a small refactor
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very worthwhile! |
||
| ) { | ||
| return 'Invalid amount'; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: is the goal of this sub-point to specify that by default the current changes make it
off?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, we only switch to on, when full set of code ready to use controller
becoz in stellar we keep shipping new feature, i dont wanna this block / change any behavior when the migration is not ready