@rango-dev/wallets-core 0.41.1-next.2 → 0.41.1-next.4

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.
Files changed (71) hide show
  1. package/dist/hub/mod.d.ts +1 -0
  2. package/dist/hub/mod.d.ts.map +1 -1
  3. package/dist/hub/namespaces/mod.d.ts +1 -1
  4. package/dist/hub/namespaces/mod.d.ts.map +1 -1
  5. package/dist/hub/provider/types.d.ts +4 -0
  6. package/dist/hub/provider/types.d.ts.map +1 -1
  7. package/dist/legacy/mod.js +1 -1
  8. package/dist/legacy/mod.js.map +2 -2
  9. package/dist/legacy/types.d.ts +1 -0
  10. package/dist/legacy/types.d.ts.map +1 -1
  11. package/dist/mod.d.ts +1 -1
  12. package/dist/mod.d.ts.map +1 -1
  13. package/dist/namespaces/common/mod.js +1 -1
  14. package/dist/namespaces/common/types.d.ts +1 -1
  15. package/dist/namespaces/common/types.d.ts.map +1 -1
  16. package/dist/namespaces/evm/mod.js +1 -1
  17. package/dist/namespaces/solana/mod.js +1 -1
  18. package/dist/namespaces/sui/actions.d.ts +9 -0
  19. package/dist/namespaces/sui/actions.d.ts.map +1 -0
  20. package/dist/namespaces/sui/builders.d.ts +8 -0
  21. package/dist/namespaces/sui/builders.d.ts.map +1 -0
  22. package/dist/namespaces/sui/constants.d.ts +3 -0
  23. package/dist/namespaces/sui/constants.d.ts.map +1 -0
  24. package/dist/namespaces/sui/mod.d.ts +6 -0
  25. package/dist/namespaces/sui/mod.d.ts.map +1 -0
  26. package/dist/namespaces/sui/mod.js +2 -0
  27. package/dist/namespaces/sui/mod.js.map +7 -0
  28. package/dist/namespaces/sui/types.d.ts +7 -0
  29. package/dist/namespaces/sui/types.d.ts.map +1 -0
  30. package/dist/namespaces/sui/utils.d.ts +8 -0
  31. package/dist/namespaces/sui/utils.d.ts.map +1 -0
  32. package/dist/namespaces/utxo/actions.d.ts +2 -0
  33. package/dist/namespaces/utxo/actions.d.ts.map +1 -0
  34. package/dist/namespaces/utxo/after.d.ts +2 -0
  35. package/dist/namespaces/utxo/after.d.ts.map +1 -0
  36. package/dist/namespaces/utxo/and.d.ts +3 -0
  37. package/dist/namespaces/utxo/and.d.ts.map +1 -0
  38. package/dist/namespaces/utxo/before.d.ts +2 -0
  39. package/dist/namespaces/utxo/before.d.ts.map +1 -0
  40. package/dist/namespaces/utxo/builders.d.ts +4 -0
  41. package/dist/namespaces/utxo/builders.d.ts.map +1 -0
  42. package/dist/namespaces/utxo/constants.d.ts +3 -0
  43. package/dist/namespaces/utxo/constants.d.ts.map +1 -0
  44. package/dist/namespaces/utxo/mod.d.ts +8 -0
  45. package/dist/namespaces/utxo/mod.d.ts.map +1 -0
  46. package/dist/namespaces/utxo/mod.js +2 -0
  47. package/dist/namespaces/utxo/mod.js.map +7 -0
  48. package/dist/namespaces/utxo/types.d.ts +7 -0
  49. package/dist/namespaces/utxo/types.d.ts.map +1 -0
  50. package/dist/wallets-core.build.json +1 -1
  51. package/package.json +11 -2
  52. package/src/hub/mod.ts +1 -0
  53. package/src/hub/namespaces/mod.ts +1 -0
  54. package/src/hub/provider/types.ts +4 -0
  55. package/src/legacy/types.ts +1 -0
  56. package/src/mod.ts +2 -0
  57. package/src/namespaces/common/types.ts +2 -2
  58. package/src/namespaces/sui/actions.ts +59 -0
  59. package/src/namespaces/sui/builders.ts +41 -0
  60. package/src/namespaces/sui/constants.ts +8 -0
  61. package/src/namespaces/sui/mod.ts +7 -0
  62. package/src/namespaces/sui/types.ts +14 -0
  63. package/src/namespaces/sui/utils.ts +33 -0
  64. package/src/namespaces/utxo/actions.ts +3 -0
  65. package/src/namespaces/utxo/after.ts +3 -0
  66. package/src/namespaces/utxo/and.ts +5 -0
  67. package/src/namespaces/utxo/before.ts +3 -0
  68. package/src/namespaces/utxo/builders.ts +12 -0
  69. package/src/namespaces/utxo/constants.ts +2 -0
  70. package/src/namespaces/utxo/mod.ts +8 -0
  71. package/src/namespaces/utxo/types.ts +14 -0
@@ -0,0 +1,33 @@
1
+ import type {
2
+ StandardConnectFeature,
3
+ StandardEventsFeature,
4
+ SuiFeatures,
5
+ WalletWithFeatures,
6
+ } from '@mysten/wallet-standard';
7
+
8
+ import { getWallets, SUI_MAINNET_CHAIN } from '@mysten/wallet-standard';
9
+
10
+ // TODO: StandardFetures doesn't work, so we should add each feature separately
11
+ type SuiWalletStandard = WalletWithFeatures<
12
+ StandardConnectFeature & StandardEventsFeature & SuiFeatures
13
+ >;
14
+
15
+ /**
16
+ * @param name each wallet has a name in WalletStandard. you should pass that value
17
+ */
18
+ export function getInstanceOrThrow(name: string): SuiWalletStandard {
19
+ const wallet = getWallets()
20
+ .get()
21
+ .find(
22
+ (wallet) =>
23
+ wallet.name === name && wallet.chains.includes(SUI_MAINNET_CHAIN)
24
+ );
25
+
26
+ if (!wallet) {
27
+ throw new Error(
28
+ "We couldn't find the Sui instance on your wallet. It may be fixed by refreshing the page."
29
+ );
30
+ }
31
+
32
+ return wallet as SuiWalletStandard;
33
+ }
@@ -0,0 +1,3 @@
1
+ import { recommended as commonRecommended } from '../common/actions.js';
2
+
3
+ export const recommended = [...commonRecommended];
@@ -0,0 +1,3 @@
1
+ import { recommended as commonRecommended } from '../common/after.js';
2
+
3
+ export const recommended = [...commonRecommended];
@@ -0,0 +1,5 @@
1
+ import { connectAndUpdateStateForSingleNetwork } from '../common/mod.js';
2
+
3
+ export const recommended = [
4
+ ['connect', connectAndUpdateStateForSingleNetwork] as const,
5
+ ];
@@ -0,0 +1,3 @@
1
+ import { recommended as commonRecommended } from '../common/before.js';
2
+
3
+ export const recommended = [...commonRecommended];
@@ -0,0 +1,12 @@
1
+ import type { UtxoActions } from './types.js';
2
+
3
+ import { ActionBuilder } from '../../mod.js';
4
+ import { intoConnectionFinished } from '../common/after.js';
5
+ import { connectAndUpdateStateForSingleNetwork } from '../common/and.js';
6
+ import { intoConnecting } from '../common/before.js';
7
+
8
+ export const connect = () =>
9
+ new ActionBuilder<UtxoActions, 'connect'>('connect')
10
+ .and(connectAndUpdateStateForSingleNetwork)
11
+ .before(intoConnecting)
12
+ .after(intoConnectionFinished);
@@ -0,0 +1,2 @@
1
+ export const CAIP_NAMESPACE = 'bip122';
2
+ export const CAIP_BITCOIN_CHAIN_ID = '000000000019d6689c085ae165831e93';
@@ -0,0 +1,8 @@
1
+ export * as actions from './actions.js';
2
+ export * as after from './after.js';
3
+ export * as and from './and.js';
4
+ export * as before from './before.js';
5
+ export * as builders from './builders.js';
6
+
7
+ export type { ProviderAPI, UtxoActions } from './types.js';
8
+ export { CAIP_NAMESPACE, CAIP_BITCOIN_CHAIN_ID } from './constants.js';
@@ -0,0 +1,14 @@
1
+ import type { Accounts } from '../../types/accounts.js';
2
+ import type {
3
+ AutoImplementedActionsByRecommended,
4
+ CommonActions,
5
+ } from '../common/types.js';
6
+
7
+ export interface UtxoActions
8
+ extends AutoImplementedActionsByRecommended,
9
+ CommonActions {
10
+ connect: () => Promise<Accounts>;
11
+ }
12
+
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ export type ProviderAPI = Record<string, any>;