File tree Expand file tree Collapse file tree 6 files changed +52
-53
lines changed Expand file tree Collapse file tree 6 files changed +52
-53
lines changed Original file line number Diff line number Diff line change @@ -39,5 +39,7 @@ declare global {
3939 offlineSigner ?: any ;
4040 tomo_evm ?: any ;
4141 solflare ?: any ;
42+ pontem ?: any ;
43+ solanaPontem ?: any ;
4244 }
4345}
Original file line number Diff line number Diff line change 4242 "@rango-dev/provider-mytonwallet" : " ^0.25.1-next.5" ,
4343 "@rango-dev/provider-okx" : " ^0.40.1-next.5" ,
4444 "@rango-dev/provider-phantom" : " ^0.40.1-next.5" ,
45+ "@rango-dev/provider-pontem" : " ^0.1.0" ,
4546 "@rango-dev/provider-rabby" : " ^0.7.1-next.5" ,
4647 "@rango-dev/provider-safe" : " ^0.33.1-next.5" ,
4748 "@rango-dev/provider-safepal" : " ^0.40.1-next.5" ,
6263 "publishConfig" : {
6364 "access" : " public"
6465 }
65- }
66+ }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import * as metamask from '@rango-dev/provider-metamask';
2424import * as mytonwallet from '@rango-dev/provider-mytonwallet' ;
2525import * as okx from '@rango-dev/provider-okx' ;
2626import { versions as phantom } from '@rango-dev/provider-phantom' ;
27+ import { versions as pontem } from '@rango-dev/provider-pontem' ;
2728import * as rabby from '@rango-dev/provider-rabby' ;
2829import * as safe from '@rango-dev/provider-safe' ;
2930import * as safepal from '@rango-dev/provider-safepal' ;
@@ -113,6 +114,7 @@ export const allProviders = (options?: Options): VersionedProviders[] => {
113114 legacyProviderImportsToVersionsInterface ( tonconnect ) ,
114115 legacyProviderImportsToVersionsInterface ( keplr ) ,
115116 phantom ,
117+ pontem ,
116118 legacyProviderImportsToVersionsInterface ( argentx ) ,
117119 legacyProviderImportsToVersionsInterface ( tronLink ) ,
118120 legacyProviderImportsToVersionsInterface ( trustwallet ) ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { defineVersions } from '@rango-dev/wallets-core/utils' ;
22
3- import { legacyProvider } from './legacy.js' ;
3+ import { legacyProvider } from './legacy/index .js' ;
44import { provider } from './provider.js' ;
55
66const versions = defineVersions ( )
Original file line number Diff line number Diff line change 1+ import type { CaipAccount } from '@rango-dev/wallets-core/namespaces/common' ;
12import type { SolanaActions } from '@rango-dev/wallets-core/namespaces/solana' ;
23
34import { NamespaceBuilder } from '@rango-dev/wallets-core' ;
5+ import { builders as commonBuilders } from '@rango-dev/wallets-core/namespaces/common' ;
6+ import {
7+ builders ,
8+ CAIP_NAMESPACE ,
9+ CAIP_SOLANA_CHAIN_ID ,
10+ } from '@rango-dev/wallets-core/namespaces/solana' ;
11+ import { CAIP } from '@rango-dev/wallets-core/utils' ;
12+ import { getSolanaAccounts } from '@rango-dev/wallets-shared' ;
413
514import { WALLET_ID } from '../constants.js' ;
15+ import { solanaInstance } from '../utils.js' ;
616
7- export const solana = new NamespaceBuilder < SolanaActions > (
8- 'Solana' ,
9- WALLET_ID
10- ) . build ( ) ;
17+ const connect = builders
18+ . connect ( )
19+ . action ( async function ( ) {
20+ const instance = solanaInstance ( ) ;
21+ const result = await getSolanaAccounts ( {
22+ instance : instance ,
23+ meta : [ ] ,
24+ } ) ;
25+ if ( Array . isArray ( result ) ) {
26+ throw new Error (
27+ 'Expecting solana response to be a single value, not an array.'
28+ ) ;
29+ }
30+
31+ const formatAccounts = result . accounts . map (
32+ ( account ) =>
33+ CAIP . AccountId . format ( {
34+ address : account ,
35+ chainId : {
36+ namespace : CAIP_NAMESPACE ,
37+ reference : CAIP_SOLANA_CHAIN_ID ,
38+ } ,
39+ } ) as CaipAccount
40+ ) ;
41+
42+ return formatAccounts ;
43+ } )
44+ . build ( ) ;
45+
46+ const disconnect = commonBuilders . disconnect < SolanaActions > ( ) . build ( ) ;
47+
48+ export const solana = new NamespaceBuilder < SolanaActions > ( 'Solana' , WALLET_ID )
49+ . action ( connect )
50+ . action ( disconnect )
51+ . build ( ) ;
You can’t perform that action at this time.
0 commit comments