File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 ]
3737 },
3838 "resolutions" : {
39- "@metamask/snaps-sdk" : " 8.1 .0"
39+ "@metamask/snaps-sdk" : " 9.0 .0"
4040 },
4141 "devDependencies" : {
4242 "@commitlint/cli" : " ^17.7.1" ,
6969 "sharp" : " ^0.33.5" ,
7070 "typescript" : " ^5.6.3"
7171 },
72- "packageManager" : " yarn@4.9.2 " ,
72+ "packageManager" : " yarn@3.8.6 " ,
7373 "engines" : {
7474 "node" : " >=20.17.0"
7575 },
Original file line number Diff line number Diff line change 4545 "@metamask/keyring-snap-sdk" : " ^4.0.0" ,
4646 "@metamask/snaps-cli" : " ^8.1.0" ,
4747 "@metamask/snaps-jest" : " 9.2.0" ,
48- "@metamask/snaps-sdk" : " ^8.1 .0" ,
48+ "@metamask/snaps-sdk" : " ^9.0 .0" ,
4949 "@metamask/superstruct" : " ^3.1.0" ,
5050 "@metamask/utils" : " 11.4.0" ,
5151 "@noble/ed25519" : " 2.1.0" ,
Original file line number Diff line number Diff line change 77 "url" : " https://github.com/MetaMask/snap-solana-wallet.git"
88 },
99 "source" : {
10- "shasum" : " g/jfpUCvmwu6piUwA21tuyxrmaZZnZl3JdLeVJysYFM =" ,
10+ "shasum" : " 7CefbKb7jCuxLkSz1ySQYgmQIh8ih3OBOVXeVpfIirU =" ,
1111 "location" : {
1212 "npm" : {
1313 "filePath" : " dist/bundle.js" ,
100100 "snap_dialog" : {},
101101 "snap_getPreferences" : {}
102102 },
103- "platformVersion" : " 8.1 .0" ,
103+ "platformVersion" : " 9.0 .0" ,
104104 "manifestVersion" : " 0.1"
105- }
105+ }
Original file line number Diff line number Diff line change @@ -15,23 +15,15 @@ import logger from '../../utils/logger';
1515export const onAssetHistoricalPrice : OnAssetHistoricalPriceHandler = async (
1616 params ,
1717) => {
18- try {
19- logger . log ( '[📈 onAssetHistoricalPrice]' , params ) ;
18+ logger . log ( '[📈 onAssetHistoricalPrice]' , params ) ;
2019
21- const { from, to } = params ;
22- assert ( from , CaipAssetTypeStruct ) ;
23- assert ( to , CaipAssetTypeStruct ) ;
20+ const { from, to } = params ;
21+ assert ( from , CaipAssetTypeStruct ) ;
22+ assert ( to , CaipAssetTypeStruct ) ;
2423
25- const historicalPrice = await tokenPricesService . getHistoricalPrice (
26- from ,
27- to ,
28- ) ;
24+ const historicalPrice = await tokenPricesService . getHistoricalPrice ( from , to ) ;
2925
30- return {
31- historicalPrice,
32- } ;
33- } catch ( error : any ) {
34- logger . error ( '[📈 onAssetHistoricalPrice]' , error ) ;
35- return null ;
36- }
26+ return {
27+ historicalPrice,
28+ } ;
3729} ;
Original file line number Diff line number Diff line change 1- import {
2- InternalError ,
3- type OnAssetsConversionHandler ,
4- } from '@metamask/snaps-sdk' ;
1+ import { type OnAssetsConversionHandler } from '@metamask/snaps-sdk' ;
52
63import { tokenPricesService } from '../../../snapContext' ;
74import logger from '../../utils/logger' ;
85
96export const onAssetsConversion : OnAssetsConversionHandler = async ( params ) => {
10- try {
11- logger . log ( '[💱 onAssetsConversion]' , params ) ;
7+ logger . log ( '[💱 onAssetsConversion]' , params ) ;
128
13- const { conversions } = params ;
9+ const { conversions } = params ;
1410
15- const conversionRates =
16- await tokenPricesService . getMultipleTokenConversions ( conversions ) ;
11+ const conversionRates =
12+ await tokenPricesService . getMultipleTokenConversions ( conversions ) ;
1713
18- return {
19- conversionRates,
20- } ;
21- } catch ( error : any ) {
22- logger . error ( '[💱 onAssetsConversion]' , error ) ;
23- throw new InternalError ( error ) as Error ;
24- }
14+ return {
15+ conversionRates,
16+ } ;
2517} ;
Original file line number Diff line number Diff line change 11import type { OnAssetsMarketDataHandler } from '@metamask/snaps-sdk' ;
2- import { InternalError } from '@metamask/snaps-sdk' ;
32
43import { assetsService } from '../../../snapContext' ;
54import logger from '../../utils/logger' ;
65
76export const onAssetsMarketData : OnAssetsMarketDataHandler = async ( params ) => {
8- try {
9- logger . log ( '[💰 onAssetsMarketData]' , params ) ;
7+ logger . log ( '[💰 onAssetsMarketData]' , params ) ;
108
11- const { assets } = params ;
9+ const { assets } = params ;
1210
13- const marketData = await assetsService . getAssetsMarketData ( assets ) ;
11+ const marketData = await assetsService . getAssetsMarketData ( assets ) ;
1412
15- return { marketData } ;
16- } catch ( error : any ) {
17- logger . error ( '[💰 onAssetsMarketData]' , error ) ;
18- throw new InternalError ( error ) as Error ;
19- }
13+ return { marketData } ;
2014} ;
You can’t perform that action at this time.
0 commit comments