@hub3js/core 0.59.0 → 0.59.1-next.0

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 (209) hide show
  1. package/dist/builders/action.d.ts +22 -0
  2. package/dist/builders/action.d.ts.map +1 -0
  3. package/dist/builders/mod.d.ts +5 -0
  4. package/dist/builders/mod.d.ts.map +1 -0
  5. package/dist/builders/namespace.d.ts +47 -0
  6. package/dist/builders/namespace.d.ts.map +1 -0
  7. package/dist/builders/provider.d.ts +37 -0
  8. package/dist/builders/provider.d.ts.map +1 -0
  9. package/dist/builders/types.d.ts +23 -0
  10. package/dist/builders/types.d.ts.map +1 -0
  11. package/dist/hub/helpers.d.ts +6 -0
  12. package/dist/hub/helpers.d.ts.map +1 -0
  13. package/dist/hub/hub.d.ts +44 -0
  14. package/dist/hub/hub.d.ts.map +1 -0
  15. package/dist/hub/mod.d.ts +9 -0
  16. package/dist/hub/mod.d.ts.map +1 -0
  17. package/dist/hub/namespaces/errors.d.ts +5 -0
  18. package/dist/hub/namespaces/errors.d.ts.map +1 -0
  19. package/dist/hub/namespaces/mod.d.ts +3 -0
  20. package/dist/hub/namespaces/mod.d.ts.map +1 -0
  21. package/dist/hub/namespaces/namespace.d.ts +148 -0
  22. package/dist/hub/namespaces/namespace.d.ts.map +1 -0
  23. package/dist/hub/namespaces/types.d.ts +36 -0
  24. package/dist/hub/namespaces/types.d.ts.map +1 -0
  25. package/dist/hub/provider/mod.d.ts +3 -0
  26. package/dist/hub/provider/mod.d.ts.map +1 -0
  27. package/dist/hub/provider/provider.d.ts +102 -0
  28. package/dist/hub/provider/provider.d.ts.map +1 -0
  29. package/dist/hub/provider/types.d.ts +28 -0
  30. package/dist/hub/provider/types.d.ts.map +1 -0
  31. package/dist/hub/store/events.d.ts +54 -0
  32. package/dist/hub/store/events.d.ts.map +1 -0
  33. package/dist/hub/store/extend.d.ts +14 -0
  34. package/dist/hub/store/extend.d.ts.map +1 -0
  35. package/dist/hub/store/hub.d.ts +11 -0
  36. package/dist/hub/store/hub.d.ts.map +1 -0
  37. package/dist/hub/store/mod.d.ts +8 -0
  38. package/dist/hub/store/mod.d.ts.map +1 -0
  39. package/dist/hub/store/mod.js +1 -1
  40. package/dist/hub/store/mod.js.map +2 -2
  41. package/dist/hub/store/namespaces.d.ts +38 -0
  42. package/dist/hub/store/namespaces.d.ts.map +1 -0
  43. package/dist/hub/store/providers.d.ts +84 -0
  44. package/dist/hub/store/providers.d.ts.map +1 -0
  45. package/dist/hub/store/selectors.d.ts +18 -0
  46. package/dist/hub/store/selectors.d.ts.map +1 -0
  47. package/dist/hub/store/store.d.ts +14 -0
  48. package/dist/hub/store/store.d.ts.map +1 -0
  49. package/dist/hub/types.d.ts +5 -0
  50. package/dist/hub/types.d.ts.map +1 -0
  51. package/dist/mod.d.ts +5 -0
  52. package/dist/mod.d.ts.map +1 -0
  53. package/dist/mod.js +1 -1
  54. package/dist/mod.js.map +4 -4
  55. package/dist/test-utils/fixtures.d.ts +4 -0
  56. package/dist/test-utils/fixtures.d.ts.map +1 -0
  57. package/dist/test-utils/mod.d.ts +2 -0
  58. package/dist/test-utils/mod.d.ts.map +1 -0
  59. package/dist/test-utils/mod.js +2 -0
  60. package/dist/test-utils/mod.js.map +7 -0
  61. package/dist/utils/mod.d.ts +3 -0
  62. package/dist/utils/mod.d.ts.map +1 -0
  63. package/dist/utils/mod.js +1 -1
  64. package/dist/utils/mod.js.map +4 -4
  65. package/dist/utils/versions.d.ts +50 -0
  66. package/dist/utils/versions.d.ts.map +1 -0
  67. package/package.json +9 -60
  68. package/src/builders/action.test.ts +225 -0
  69. package/src/builders/action.ts +1 -1
  70. package/src/builders/namespace.ts +1 -1
  71. package/src/builders/provider.ts +59 -19
  72. package/src/builders/types.ts +6 -4
  73. package/src/hub/hub.test.ts +108 -0
  74. package/src/hub/hub.ts +26 -9
  75. package/src/hub/mod.ts +2 -1
  76. package/src/hub/namespaces/namespace.ts +2 -2
  77. package/src/hub/namespaces/types.ts +1 -1
  78. package/src/hub/provider/mod.ts +1 -2
  79. package/src/hub/provider/provider.test.ts +64 -19
  80. package/src/hub/provider/provider.ts +43 -92
  81. package/src/hub/provider/types.ts +14 -31
  82. package/src/hub/store/mod.ts +1 -0
  83. package/src/hub/store/providers.ts +32 -18
  84. package/src/mod.ts +2 -21
  85. package/src/test-utils/mod.ts +1 -0
  86. package/src/utils/mod.ts +2 -8
  87. package/src/utils/versions.test.ts +0 -1
  88. package/src/utils/versions.ts +71 -44
  89. package/dist/legacy/mod.js +0 -2
  90. package/dist/legacy/mod.js.map +0 -7
  91. package/dist/namespaces/common/mod.js +0 -2
  92. package/dist/namespaces/common/mod.js.map +0 -7
  93. package/dist/namespaces/cosmos/mod.js +0 -2
  94. package/dist/namespaces/cosmos/mod.js.map +0 -7
  95. package/dist/namespaces/evm/mod.js +0 -2
  96. package/dist/namespaces/evm/mod.js.map +0 -7
  97. package/dist/namespaces/solana/mod.js +0 -2
  98. package/dist/namespaces/solana/mod.js.map +0 -7
  99. package/dist/namespaces/starknet/mod.js +0 -2
  100. package/dist/namespaces/starknet/mod.js.map +0 -7
  101. package/dist/namespaces/sui/mod.js +0 -2
  102. package/dist/namespaces/sui/mod.js.map +0 -7
  103. package/dist/namespaces/tron/mod.js +0 -2
  104. package/dist/namespaces/tron/mod.js.map +0 -7
  105. package/dist/namespaces/utxo/mod.js +0 -2
  106. package/dist/namespaces/utxo/mod.js.map +0 -7
  107. package/dist/namespaces/xrpl/mod.js +0 -2
  108. package/dist/namespaces/xrpl/mod.js.map +0 -7
  109. package/legacy/package.json +0 -8
  110. package/namespaces/common/package.json +0 -8
  111. package/namespaces/cosmos/package.json +0 -8
  112. package/namespaces/evm/package.json +0 -8
  113. package/namespaces/solana/package.json +0 -8
  114. package/namespaces/starknet/package.json +0 -8
  115. package/namespaces/sui/package.json +0 -8
  116. package/namespaces/tron/package.json +0 -8
  117. package/namespaces/utxo/package.json +0 -8
  118. package/namespaces/xrpl/package.json +0 -8
  119. package/src/legacy/helpers.ts +0 -75
  120. package/src/legacy/mod.ts +0 -44
  121. package/src/legacy/persistor.ts +0 -19
  122. package/src/legacy/types.ts +0 -303
  123. package/src/legacy/utils.ts +0 -20
  124. package/src/legacy/wallet.ts +0 -552
  125. package/src/namespaces/common/actions.ts +0 -12
  126. package/src/namespaces/common/after.ts +0 -8
  127. package/src/namespaces/common/and.ts +0 -42
  128. package/src/namespaces/common/before.ts +0 -9
  129. package/src/namespaces/common/builders.ts +0 -14
  130. package/src/namespaces/common/helpers.ts +0 -10
  131. package/src/namespaces/common/hooks/changeAccountSubscriber.test.ts +0 -173
  132. package/src/namespaces/common/hooks/changeAccountSubscriber.ts +0 -236
  133. package/src/namespaces/common/mod.ts +0 -23
  134. package/src/namespaces/common/or.ts +0 -17
  135. package/src/namespaces/common/types.ts +0 -27
  136. package/src/namespaces/common/utils.ts +0 -43
  137. package/src/namespaces/cosmos/actions.ts +0 -3
  138. package/src/namespaces/cosmos/after.ts +0 -3
  139. package/src/namespaces/cosmos/and.ts +0 -5
  140. package/src/namespaces/cosmos/before.ts +0 -3
  141. package/src/namespaces/cosmos/builders.ts +0 -15
  142. package/src/namespaces/cosmos/constants.ts +0 -1
  143. package/src/namespaces/cosmos/mod.ts +0 -15
  144. package/src/namespaces/cosmos/types.ts +0 -31
  145. package/src/namespaces/cosmos/utils.ts +0 -21
  146. package/src/namespaces/evm/actions.ts +0 -134
  147. package/src/namespaces/evm/after.ts +0 -3
  148. package/src/namespaces/evm/and.ts +0 -5
  149. package/src/namespaces/evm/before.ts +0 -3
  150. package/src/namespaces/evm/builders.ts +0 -52
  151. package/src/namespaces/evm/constants.ts +0 -2
  152. package/src/namespaces/evm/eip1193.ts +0 -1415
  153. package/src/namespaces/evm/hooks.ts +0 -43
  154. package/src/namespaces/evm/mod.ts +0 -10
  155. package/src/namespaces/evm/types.ts +0 -36
  156. package/src/namespaces/evm/utils.ts +0 -106
  157. package/src/namespaces/solana/actions.ts +0 -44
  158. package/src/namespaces/solana/after.ts +0 -3
  159. package/src/namespaces/solana/and.ts +0 -5
  160. package/src/namespaces/solana/before.ts +0 -3
  161. package/src/namespaces/solana/builders.ts +0 -40
  162. package/src/namespaces/solana/constants.ts +0 -2
  163. package/src/namespaces/solana/hooks.ts +0 -10
  164. package/src/namespaces/solana/mod.ts +0 -10
  165. package/src/namespaces/solana/types.ts +0 -25
  166. package/src/namespaces/solana/utils.ts +0 -36
  167. package/src/namespaces/starknet/actions.ts +0 -19
  168. package/src/namespaces/starknet/after.ts +0 -3
  169. package/src/namespaces/starknet/and.ts +0 -5
  170. package/src/namespaces/starknet/before.ts +0 -3
  171. package/src/namespaces/starknet/builders.ts +0 -18
  172. package/src/namespaces/starknet/constants.ts +0 -8
  173. package/src/namespaces/starknet/mod.ts +0 -9
  174. package/src/namespaces/starknet/types.ts +0 -18
  175. package/src/namespaces/starknet/utils.ts +0 -35
  176. package/src/namespaces/sui/actions.ts +0 -27
  177. package/src/namespaces/sui/builders.ts +0 -77
  178. package/src/namespaces/sui/constants.ts +0 -8
  179. package/src/namespaces/sui/hooks.ts +0 -10
  180. package/src/namespaces/sui/mod.ts +0 -8
  181. package/src/namespaces/sui/types.ts +0 -25
  182. package/src/namespaces/sui/utils.ts +0 -56
  183. package/src/namespaces/tron/actions.ts +0 -3
  184. package/src/namespaces/tron/after.ts +0 -3
  185. package/src/namespaces/tron/and.ts +0 -5
  186. package/src/namespaces/tron/before.ts +0 -3
  187. package/src/namespaces/tron/builders.ts +0 -15
  188. package/src/namespaces/tron/constants.ts +0 -8
  189. package/src/namespaces/tron/mod.ts +0 -8
  190. package/src/namespaces/tron/types.ts +0 -14
  191. package/src/namespaces/tron/utils.ts +0 -18
  192. package/src/namespaces/utxo/actions.ts +0 -3
  193. package/src/namespaces/utxo/after.ts +0 -3
  194. package/src/namespaces/utxo/and.ts +0 -5
  195. package/src/namespaces/utxo/before.ts +0 -3
  196. package/src/namespaces/utxo/builders.ts +0 -12
  197. package/src/namespaces/utxo/constants.ts +0 -2
  198. package/src/namespaces/utxo/mod.ts +0 -8
  199. package/src/namespaces/utxo/types.ts +0 -14
  200. package/src/namespaces/utxo/utils.ts +0 -18
  201. package/src/namespaces/xrpl/builders.ts +0 -14
  202. package/src/namespaces/xrpl/constants.ts +0 -7
  203. package/src/namespaces/xrpl/mod.ts +0 -5
  204. package/src/namespaces/xrpl/types.ts +0 -16
  205. package/src/namespaces/xrpl/utils.ts +0 -15
  206. package/src/types/accounts.ts +0 -12
  207. package/src/types/mod.ts +0 -1
  208. package/src/types/utils.ts +0 -7
  209. /package/src/{types/actions.ts → hub/types.ts} +0 -0
@@ -1,25 +0,0 @@
1
- import type { Accounts } from '../../types/accounts.js';
2
- import type {
3
- AutoImplementedActionsByRecommended,
4
- CommonActions,
5
- } from '../common/types.js';
6
- import type {
7
- StandardConnectFeature,
8
- StandardEventsFeature,
9
- SuiFeatures,
10
- WalletWithFeatures,
11
- } from '@mysten/wallet-standard';
12
-
13
- export interface SuiActions
14
- extends AutoImplementedActionsByRecommended, CommonActions {
15
- connect: () => Promise<Accounts>;
16
- canEagerConnect: () => Promise<boolean>;
17
- }
18
-
19
- export type ProviderAPI = WalletWithFeatures<
20
- StandardConnectFeature & StandardEventsFeature & SuiFeatures
21
- >;
22
-
23
- export interface ChangeAccountSubscriberParams {
24
- name: string;
25
- }
@@ -1,56 +0,0 @@
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
- import { AccountId } from 'caip';
10
-
11
- import { CAIP_NAMESPACE, CAIP_SUI_CHAIN_ID } from './constants.js';
12
-
13
- // TODO: StandardFetures doesn't work, so we should add each feature separately
14
- type SuiWalletStandard = WalletWithFeatures<
15
- StandardConnectFeature & StandardEventsFeature & SuiFeatures
16
- >;
17
-
18
- /**
19
- * @param name each wallet has a name in WalletStandard. you should pass that value
20
- */
21
- export function getInstance(name: string): SuiWalletStandard | undefined {
22
- const wallet = getWallets()
23
- .get()
24
- .find(
25
- (wallet) =>
26
- wallet.name === name && wallet.chains.includes(SUI_MAINNET_CHAIN),
27
- );
28
-
29
- return wallet as SuiWalletStandard;
30
- }
31
-
32
- /**
33
- * @param name each wallet has a name in WalletStandard. you should pass that value
34
- */
35
- export function getInstanceOrThrow(name: string): SuiWalletStandard {
36
- const wallet = getInstance(name);
37
-
38
- if (!wallet) {
39
- throw new Error(
40
- "We couldn't find the Sui instance on your wallet. It may be fixed by refreshing the page.",
41
- );
42
- }
43
-
44
- return wallet;
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
- }
@@ -1,3 +0,0 @@
1
- import { recommended as commonRecommended } from '../common/actions.js';
2
-
3
- export const recommended = [...commonRecommended];
@@ -1,3 +0,0 @@
1
- import { recommended as commonRecommended } from '../common/after.js';
2
-
3
- export const recommended = [...commonRecommended];
@@ -1,5 +0,0 @@
1
- import { connectAndUpdateStateForSingleNetwork } from '../common/mod.js';
2
-
3
- export const recommended = [
4
- ['connect', connectAndUpdateStateForSingleNetwork] as const,
5
- ];
@@ -1,3 +0,0 @@
1
- import { recommended as commonRecommended } from '../common/before.js';
2
-
3
- export const recommended = [...commonRecommended];
@@ -1,15 +0,0 @@
1
- import type { TronActions } 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<TronActions, 'connect'>('connect')
10
- .and(connectAndUpdateStateForSingleNetwork)
11
- .before(intoConnecting)
12
- .after(intoConnectionFinished);
13
-
14
- export const canEagerConnect = () =>
15
- new ActionBuilder<TronActions, 'canEagerConnect'>('canEagerConnect');
@@ -1,8 +0,0 @@
1
- /*
2
- * TODO: I couldn't found tron in caip
3
- * @see https://namespaces.chainagnostic.org/
4
- */
5
-
6
- // if the value needs to be change make sure you will update mapCaipNamespaceToLegacyNetworkName as well
7
- export const CAIP_NAMESPACE = 'tron';
8
- export const CAIP_TRON_CHAIN_ID = 'tron';
@@ -1,8 +0,0 @@
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
- export * as utils from './utils.js';
7
- export type { ProviderAPI, TronActions } from './types.js';
8
- export { CAIP_NAMESPACE, CAIP_TRON_CHAIN_ID } from './constants.js';
@@ -1,14 +0,0 @@
1
- import type { Accounts } from '../../types/accounts.js';
2
- import type {
3
- AutoImplementedActionsByRecommended,
4
- CommonActions,
5
- } from '../common/types.js';
6
-
7
- export interface TronActions
8
- extends AutoImplementedActionsByRecommended, CommonActions {
9
- connect: () => Promise<Accounts>;
10
- canEagerConnect: () => Promise<boolean>;
11
- }
12
-
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
- export type ProviderAPI = Record<string, any>;
@@ -1,18 +0,0 @@
1
- import type { CaipAccount } from '../common/mod.js';
2
-
3
- import { AccountId } from 'caip';
4
-
5
- import { CAIP_NAMESPACE, CAIP_TRON_CHAIN_ID } from './constants.js';
6
-
7
- export function formatAccountsToCAIP(accounts: string[]) {
8
- return accounts.map(
9
- (account) =>
10
- AccountId.format({
11
- address: account.toString(),
12
- chainId: {
13
- namespace: CAIP_NAMESPACE,
14
- reference: CAIP_TRON_CHAIN_ID,
15
- },
16
- }) as CaipAccount,
17
- );
18
- }
@@ -1,3 +0,0 @@
1
- import { recommended as commonRecommended } from '../common/actions.js';
2
-
3
- export const recommended = [...commonRecommended];
@@ -1,3 +0,0 @@
1
- import { recommended as commonRecommended } from '../common/after.js';
2
-
3
- export const recommended = [...commonRecommended];
@@ -1,5 +0,0 @@
1
- import { connectAndUpdateStateForSingleNetwork } from '../common/mod.js';
2
-
3
- export const recommended = [
4
- ['connect', connectAndUpdateStateForSingleNetwork] as const,
5
- ];
@@ -1,3 +0,0 @@
1
- import { recommended as commonRecommended } from '../common/before.js';
2
-
3
- export const recommended = [...commonRecommended];
@@ -1,12 +0,0 @@
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);
@@ -1,2 +0,0 @@
1
- export const CAIP_NAMESPACE = 'bip122';
2
- export const CAIP_BITCOIN_CHAIN_ID = '000000000019d6689c085ae165831e93';
@@ -1,8 +0,0 @@
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
- export * as utils from './utils.js';
7
- export type { ProviderAPI, UtxoActions } from './types.js';
8
- export { CAIP_NAMESPACE, CAIP_BITCOIN_CHAIN_ID } from './constants.js';
@@ -1,14 +0,0 @@
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, CommonActions {
9
- connect: () => Promise<Accounts>;
10
- canEagerConnect: () => Promise<boolean>;
11
- }
12
-
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
- export type ProviderAPI = Record<string, any>;
@@ -1,18 +0,0 @@
1
- import type { CaipAccount } from '../common/mod.js';
2
-
3
- import { AccountId } from 'caip';
4
-
5
- import { CAIP_BITCOIN_CHAIN_ID, CAIP_NAMESPACE } from './constants.js';
6
-
7
- export function formatAccountsToCAIP(accounts: string[]) {
8
- return accounts.map(
9
- (account) =>
10
- AccountId.format({
11
- address: account.toString(),
12
- chainId: {
13
- namespace: CAIP_NAMESPACE,
14
- reference: CAIP_BITCOIN_CHAIN_ID,
15
- },
16
- }) as CaipAccount,
17
- );
18
- }
@@ -1,14 +0,0 @@
1
- import type { XRPLActions } from './types.js';
2
-
3
- import { ActionBuilder } from '../../mod.js';
4
- import {
5
- connectAndUpdateStateForSingleNetwork,
6
- intoConnecting,
7
- intoConnectionFinished,
8
- } from '../common/mod.js';
9
-
10
- export const connect = () =>
11
- new ActionBuilder<XRPLActions, 'connect'>('connect')
12
- .and(connectAndUpdateStateForSingleNetwork)
13
- .before(intoConnecting)
14
- .after(intoConnectionFinished);
@@ -1,7 +0,0 @@
1
- /*
2
- * @see https://namespaces.chainagnostic.org/xrpl/README
3
- */
4
-
5
- // if the value neeeds to be change make sure you will update mapCaipNamespaceToLegacyNetworkName as well
6
- export const CAIP_NAMESPACE = 'xrpl';
7
- export const CAIP_XRPL_CHAIN_ID = 'mainnet';
@@ -1,5 +0,0 @@
1
- export * as builders from './builders.js';
2
- export type { XRPLActions } from './types.js';
3
-
4
- export * as utils from './utils.js';
5
- export { CAIP_XRPL_CHAIN_ID, CAIP_NAMESPACE } from './constants.js';
@@ -1,16 +0,0 @@
1
- import type { Accounts } from '../common/mod.js';
2
- import type {
3
- AutoImplementedActionsByRecommended,
4
- CommonActions,
5
- } from '../common/types.js';
6
- import type { AccountLinesTrustline } from 'xrpl';
7
-
8
- export interface XRPLActions
9
- extends AutoImplementedActionsByRecommended, CommonActions {
10
- connect: () => Promise<Accounts>;
11
- canEagerConnect: () => Promise<boolean>;
12
- accountLines: (
13
- account: string,
14
- options?: { peer?: string },
15
- ) => Promise<AccountLinesTrustline[]>;
16
- }
@@ -1,15 +0,0 @@
1
- import type { CaipAccount } from '../common/mod.js';
2
-
3
- import { AccountId } from 'caip';
4
-
5
- import { CAIP_NAMESPACE, CAIP_XRPL_CHAIN_ID } from './constants.js';
6
-
7
- export function formatAddressToCAIP(address: string): CaipAccount {
8
- return AccountId.format({
9
- address,
10
- chainId: {
11
- namespace: CAIP_NAMESPACE,
12
- reference: CAIP_XRPL_CHAIN_ID,
13
- },
14
- }) as CaipAccount;
15
- }
@@ -1,12 +0,0 @@
1
- type CaipNamespace = string;
2
- type CaipChainId = string;
3
- type CaipAccountAddress = string;
4
-
5
- export type CaipAccount =
6
- `${CaipNamespace}:${CaipChainId}:${CaipAccountAddress}`;
7
-
8
- export type Accounts = CaipAccount[];
9
- export type AccountsWithActiveChain = {
10
- accounts: Accounts;
11
- network: string;
12
- };
package/src/types/mod.ts DELETED
@@ -1 +0,0 @@
1
- export type { AnyFunction, FunctionWithContext } from './actions.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @see https://x.com/mattpocockuk/status/1622730173446557697
3
- */
4
- export type Prettify<T> = {
5
- [K in keyof T]: T[K];
6
- // todo: should use this comment after configuring rango rules eslint: eslint-disable-next-line @typescript-eslint/ban-types
7
- } & {};
File without changes