@rango-dev/wallets-core 0.49.0 → 0.49.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/namespaces/common/hooks/changeAccountSubscriber.d.ts +65 -0
- package/dist/namespaces/common/hooks/changeAccountSubscriber.d.ts.map +1 -0
- package/dist/namespaces/common/hooks/changeAccountSubscriber.test.d.ts +2 -0
- package/dist/namespaces/common/hooks/changeAccountSubscriber.test.d.ts.map +1 -0
- package/dist/namespaces/evm/actions.d.ts +2 -4
- package/dist/namespaces/evm/actions.d.ts.map +1 -1
- package/dist/namespaces/evm/builders.d.ts +3 -1
- package/dist/namespaces/evm/builders.d.ts.map +1 -1
- package/dist/namespaces/evm/hooks.d.ts +5 -0
- package/dist/namespaces/evm/hooks.d.ts.map +1 -0
- package/dist/namespaces/evm/mod.d.ts +1 -0
- package/dist/namespaces/evm/mod.d.ts.map +1 -1
- package/dist/namespaces/evm/mod.js +1 -1
- package/dist/namespaces/evm/mod.js.map +4 -4
- package/dist/namespaces/evm/types.d.ts +2 -1
- package/dist/namespaces/evm/types.d.ts.map +1 -1
- package/dist/namespaces/evm/utils.d.ts +1 -0
- package/dist/namespaces/evm/utils.d.ts.map +1 -1
- package/dist/namespaces/solana/actions.d.ts +1 -3
- package/dist/namespaces/solana/actions.d.ts.map +1 -1
- package/dist/namespaces/solana/builders.d.ts +3 -1
- package/dist/namespaces/solana/builders.d.ts.map +1 -1
- package/dist/namespaces/solana/hooks.d.ts +4 -0
- package/dist/namespaces/solana/hooks.d.ts.map +1 -0
- package/dist/namespaces/solana/mod.d.ts +1 -0
- package/dist/namespaces/solana/mod.d.ts.map +1 -1
- package/dist/namespaces/solana/mod.js +1 -1
- package/dist/namespaces/solana/mod.js.map +4 -4
- package/dist/namespaces/solana/types.d.ts +4 -1
- package/dist/namespaces/solana/types.d.ts.map +1 -1
- package/dist/namespaces/solana/utils.d.ts +1 -0
- package/dist/namespaces/solana/utils.d.ts.map +1 -1
- package/dist/namespaces/sui/actions.d.ts +1 -6
- package/dist/namespaces/sui/actions.d.ts.map +1 -1
- package/dist/namespaces/sui/builders.d.ts +6 -1
- package/dist/namespaces/sui/builders.d.ts.map +1 -1
- package/dist/namespaces/sui/hooks.d.ts +4 -0
- package/dist/namespaces/sui/hooks.d.ts.map +1 -0
- package/dist/namespaces/sui/mod.d.ts +1 -0
- package/dist/namespaces/sui/mod.d.ts.map +1 -1
- package/dist/namespaces/sui/mod.js +1 -1
- package/dist/namespaces/sui/mod.js.map +4 -4
- package/dist/namespaces/sui/types.d.ts +5 -1
- package/dist/namespaces/sui/types.d.ts.map +1 -1
- package/dist/namespaces/sui/utils.d.ts +3 -0
- package/dist/namespaces/sui/utils.d.ts.map +1 -1
- package/dist/wallets-core.build.json +1 -1
- package/package.json +1 -1
- package/src/namespaces/common/hooks/changeAccountSubscriber.test.ts +162 -0
- package/src/namespaces/common/hooks/changeAccountSubscriber.ts +188 -0
- package/src/namespaces/evm/actions.ts +8 -127
- package/src/namespaces/evm/builders.ts +39 -1
- package/src/namespaces/evm/hooks.ts +43 -0
- package/src/namespaces/evm/mod.ts +1 -0
- package/src/namespaces/evm/types.ts +5 -1
- package/src/namespaces/evm/utils.ts +31 -1
- package/src/namespaces/solana/actions.ts +2 -56
- package/src/namespaces/solana/builders.ts +25 -1
- package/src/namespaces/solana/hooks.ts +10 -0
- package/src/namespaces/solana/mod.ts +1 -0
- package/src/namespaces/solana/types.ts +5 -1
- package/src/namespaces/solana/utils.ts +18 -0
- package/src/namespaces/sui/actions.ts +1 -61
- package/src/namespaces/sui/builders.ts +33 -2
- package/src/namespaces/sui/hooks.ts +10 -0
- package/src/namespaces/sui/mod.ts +1 -0
- package/src/namespaces/sui/types.ts +13 -2
- package/src/namespaces/sui/utils.ts +14 -0
|
@@ -3,6 +3,12 @@ import type {
|
|
|
3
3
|
AutoImplementedActionsByRecommended,
|
|
4
4
|
CommonActions,
|
|
5
5
|
} from '../common/types.js';
|
|
6
|
+
import type {
|
|
7
|
+
StandardConnectFeature,
|
|
8
|
+
StandardEventsFeature,
|
|
9
|
+
SuiFeatures,
|
|
10
|
+
WalletWithFeatures,
|
|
11
|
+
} from '@mysten/wallet-standard';
|
|
6
12
|
|
|
7
13
|
export interface SuiActions
|
|
8
14
|
extends AutoImplementedActionsByRecommended,
|
|
@@ -11,5 +17,10 @@ export interface SuiActions
|
|
|
11
17
|
canEagerConnect: () => Promise<boolean>;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
export type ProviderAPI = WalletWithFeatures<
|
|
21
|
+
StandardConnectFeature & StandardEventsFeature & SuiFeatures
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
export interface ChangeAccountSubscriberParams {
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
@@ -6,6 +6,9 @@ import type {
|
|
|
6
6
|
} from '@mysten/wallet-standard';
|
|
7
7
|
|
|
8
8
|
import { getWallets, SUI_MAINNET_CHAIN } from '@mysten/wallet-standard';
|
|
9
|
+
import { AccountId } from 'caip';
|
|
10
|
+
|
|
11
|
+
import { CAIP_NAMESPACE, CAIP_SUI_CHAIN_ID } from './constants.js';
|
|
9
12
|
|
|
10
13
|
// TODO: StandardFetures doesn't work, so we should add each feature separately
|
|
11
14
|
type SuiWalletStandard = WalletWithFeatures<
|
|
@@ -40,3 +43,14 @@ export function getInstanceOrThrow(name: string): SuiWalletStandard {
|
|
|
40
43
|
|
|
41
44
|
return wallet;
|
|
42
45
|
}
|
|
46
|
+
export function formatAccountsToCAIP(accounts: readonly { address: string }[]) {
|
|
47
|
+
return accounts.map((account) => {
|
|
48
|
+
return AccountId.format({
|
|
49
|
+
address: account.address,
|
|
50
|
+
chainId: {
|
|
51
|
+
namespace: CAIP_NAMESPACE,
|
|
52
|
+
reference: CAIP_SUI_CHAIN_ID,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|