@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.
- package/dist/builders/action.d.ts +22 -0
- package/dist/builders/action.d.ts.map +1 -0
- package/dist/builders/mod.d.ts +5 -0
- package/dist/builders/mod.d.ts.map +1 -0
- package/dist/builders/namespace.d.ts +47 -0
- package/dist/builders/namespace.d.ts.map +1 -0
- package/dist/builders/provider.d.ts +37 -0
- package/dist/builders/provider.d.ts.map +1 -0
- package/dist/builders/types.d.ts +23 -0
- package/dist/builders/types.d.ts.map +1 -0
- package/dist/hub/helpers.d.ts +6 -0
- package/dist/hub/helpers.d.ts.map +1 -0
- package/dist/hub/hub.d.ts +44 -0
- package/dist/hub/hub.d.ts.map +1 -0
- package/dist/hub/mod.d.ts +9 -0
- package/dist/hub/mod.d.ts.map +1 -0
- package/dist/hub/namespaces/errors.d.ts +5 -0
- package/dist/hub/namespaces/errors.d.ts.map +1 -0
- package/dist/hub/namespaces/mod.d.ts +3 -0
- package/dist/hub/namespaces/mod.d.ts.map +1 -0
- package/dist/hub/namespaces/namespace.d.ts +148 -0
- package/dist/hub/namespaces/namespace.d.ts.map +1 -0
- package/dist/hub/namespaces/types.d.ts +36 -0
- package/dist/hub/namespaces/types.d.ts.map +1 -0
- package/dist/hub/provider/mod.d.ts +3 -0
- package/dist/hub/provider/mod.d.ts.map +1 -0
- package/dist/hub/provider/provider.d.ts +102 -0
- package/dist/hub/provider/provider.d.ts.map +1 -0
- package/dist/hub/provider/types.d.ts +28 -0
- package/dist/hub/provider/types.d.ts.map +1 -0
- package/dist/hub/store/events.d.ts +54 -0
- package/dist/hub/store/events.d.ts.map +1 -0
- package/dist/hub/store/extend.d.ts +14 -0
- package/dist/hub/store/extend.d.ts.map +1 -0
- package/dist/hub/store/hub.d.ts +11 -0
- package/dist/hub/store/hub.d.ts.map +1 -0
- package/dist/hub/store/mod.d.ts +8 -0
- package/dist/hub/store/mod.d.ts.map +1 -0
- package/dist/hub/store/mod.js +1 -1
- package/dist/hub/store/mod.js.map +2 -2
- package/dist/hub/store/namespaces.d.ts +38 -0
- package/dist/hub/store/namespaces.d.ts.map +1 -0
- package/dist/hub/store/providers.d.ts +84 -0
- package/dist/hub/store/providers.d.ts.map +1 -0
- package/dist/hub/store/selectors.d.ts +18 -0
- package/dist/hub/store/selectors.d.ts.map +1 -0
- package/dist/hub/store/store.d.ts +14 -0
- package/dist/hub/store/store.d.ts.map +1 -0
- package/dist/hub/types.d.ts +5 -0
- package/dist/hub/types.d.ts.map +1 -0
- package/dist/mod.d.ts +5 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +1 -1
- package/dist/mod.js.map +4 -4
- package/dist/test-utils/fixtures.d.ts +4 -0
- package/dist/test-utils/fixtures.d.ts.map +1 -0
- package/dist/test-utils/mod.d.ts +2 -0
- package/dist/test-utils/mod.d.ts.map +1 -0
- package/dist/test-utils/mod.js +2 -0
- package/dist/test-utils/mod.js.map +7 -0
- package/dist/utils/mod.d.ts +3 -0
- package/dist/utils/mod.d.ts.map +1 -0
- package/dist/utils/mod.js +1 -1
- package/dist/utils/mod.js.map +4 -4
- package/dist/utils/versions.d.ts +50 -0
- package/dist/utils/versions.d.ts.map +1 -0
- package/package.json +9 -60
- package/src/builders/action.test.ts +225 -0
- package/src/builders/action.ts +1 -1
- package/src/builders/namespace.ts +1 -1
- package/src/builders/provider.ts +59 -19
- package/src/builders/types.ts +6 -4
- package/src/hub/hub.test.ts +108 -0
- package/src/hub/hub.ts +26 -9
- package/src/hub/mod.ts +2 -1
- package/src/hub/namespaces/namespace.ts +2 -2
- package/src/hub/namespaces/types.ts +1 -1
- package/src/hub/provider/mod.ts +1 -2
- package/src/hub/provider/provider.test.ts +64 -19
- package/src/hub/provider/provider.ts +43 -92
- package/src/hub/provider/types.ts +14 -31
- package/src/hub/store/mod.ts +1 -0
- package/src/hub/store/providers.ts +32 -18
- package/src/mod.ts +2 -21
- package/src/test-utils/mod.ts +1 -0
- package/src/utils/mod.ts +2 -8
- package/src/utils/versions.test.ts +0 -1
- package/src/utils/versions.ts +71 -44
- package/dist/legacy/mod.js +0 -2
- package/dist/legacy/mod.js.map +0 -7
- package/dist/namespaces/common/mod.js +0 -2
- package/dist/namespaces/common/mod.js.map +0 -7
- package/dist/namespaces/cosmos/mod.js +0 -2
- package/dist/namespaces/cosmos/mod.js.map +0 -7
- package/dist/namespaces/evm/mod.js +0 -2
- package/dist/namespaces/evm/mod.js.map +0 -7
- package/dist/namespaces/solana/mod.js +0 -2
- package/dist/namespaces/solana/mod.js.map +0 -7
- package/dist/namespaces/starknet/mod.js +0 -2
- package/dist/namespaces/starknet/mod.js.map +0 -7
- package/dist/namespaces/sui/mod.js +0 -2
- package/dist/namespaces/sui/mod.js.map +0 -7
- package/dist/namespaces/tron/mod.js +0 -2
- package/dist/namespaces/tron/mod.js.map +0 -7
- package/dist/namespaces/utxo/mod.js +0 -2
- package/dist/namespaces/utxo/mod.js.map +0 -7
- package/dist/namespaces/xrpl/mod.js +0 -2
- package/dist/namespaces/xrpl/mod.js.map +0 -7
- package/legacy/package.json +0 -8
- package/namespaces/common/package.json +0 -8
- package/namespaces/cosmos/package.json +0 -8
- package/namespaces/evm/package.json +0 -8
- package/namespaces/solana/package.json +0 -8
- package/namespaces/starknet/package.json +0 -8
- package/namespaces/sui/package.json +0 -8
- package/namespaces/tron/package.json +0 -8
- package/namespaces/utxo/package.json +0 -8
- package/namespaces/xrpl/package.json +0 -8
- package/src/legacy/helpers.ts +0 -75
- package/src/legacy/mod.ts +0 -44
- package/src/legacy/persistor.ts +0 -19
- package/src/legacy/types.ts +0 -303
- package/src/legacy/utils.ts +0 -20
- package/src/legacy/wallet.ts +0 -552
- package/src/namespaces/common/actions.ts +0 -12
- package/src/namespaces/common/after.ts +0 -8
- package/src/namespaces/common/and.ts +0 -42
- package/src/namespaces/common/before.ts +0 -9
- package/src/namespaces/common/builders.ts +0 -14
- package/src/namespaces/common/helpers.ts +0 -10
- package/src/namespaces/common/hooks/changeAccountSubscriber.test.ts +0 -173
- package/src/namespaces/common/hooks/changeAccountSubscriber.ts +0 -236
- package/src/namespaces/common/mod.ts +0 -23
- package/src/namespaces/common/or.ts +0 -17
- package/src/namespaces/common/types.ts +0 -27
- package/src/namespaces/common/utils.ts +0 -43
- package/src/namespaces/cosmos/actions.ts +0 -3
- package/src/namespaces/cosmos/after.ts +0 -3
- package/src/namespaces/cosmos/and.ts +0 -5
- package/src/namespaces/cosmos/before.ts +0 -3
- package/src/namespaces/cosmos/builders.ts +0 -15
- package/src/namespaces/cosmos/constants.ts +0 -1
- package/src/namespaces/cosmos/mod.ts +0 -15
- package/src/namespaces/cosmos/types.ts +0 -31
- package/src/namespaces/cosmos/utils.ts +0 -21
- package/src/namespaces/evm/actions.ts +0 -134
- package/src/namespaces/evm/after.ts +0 -3
- package/src/namespaces/evm/and.ts +0 -5
- package/src/namespaces/evm/before.ts +0 -3
- package/src/namespaces/evm/builders.ts +0 -52
- package/src/namespaces/evm/constants.ts +0 -2
- package/src/namespaces/evm/eip1193.ts +0 -1415
- package/src/namespaces/evm/hooks.ts +0 -43
- package/src/namespaces/evm/mod.ts +0 -10
- package/src/namespaces/evm/types.ts +0 -36
- package/src/namespaces/evm/utils.ts +0 -106
- package/src/namespaces/solana/actions.ts +0 -44
- package/src/namespaces/solana/after.ts +0 -3
- package/src/namespaces/solana/and.ts +0 -5
- package/src/namespaces/solana/before.ts +0 -3
- package/src/namespaces/solana/builders.ts +0 -40
- package/src/namespaces/solana/constants.ts +0 -2
- package/src/namespaces/solana/hooks.ts +0 -10
- package/src/namespaces/solana/mod.ts +0 -10
- package/src/namespaces/solana/types.ts +0 -25
- package/src/namespaces/solana/utils.ts +0 -36
- package/src/namespaces/starknet/actions.ts +0 -19
- package/src/namespaces/starknet/after.ts +0 -3
- package/src/namespaces/starknet/and.ts +0 -5
- package/src/namespaces/starknet/before.ts +0 -3
- package/src/namespaces/starknet/builders.ts +0 -18
- package/src/namespaces/starknet/constants.ts +0 -8
- package/src/namespaces/starknet/mod.ts +0 -9
- package/src/namespaces/starknet/types.ts +0 -18
- package/src/namespaces/starknet/utils.ts +0 -35
- package/src/namespaces/sui/actions.ts +0 -27
- package/src/namespaces/sui/builders.ts +0 -77
- package/src/namespaces/sui/constants.ts +0 -8
- package/src/namespaces/sui/hooks.ts +0 -10
- package/src/namespaces/sui/mod.ts +0 -8
- package/src/namespaces/sui/types.ts +0 -25
- package/src/namespaces/sui/utils.ts +0 -56
- package/src/namespaces/tron/actions.ts +0 -3
- package/src/namespaces/tron/after.ts +0 -3
- package/src/namespaces/tron/and.ts +0 -5
- package/src/namespaces/tron/before.ts +0 -3
- package/src/namespaces/tron/builders.ts +0 -15
- package/src/namespaces/tron/constants.ts +0 -8
- package/src/namespaces/tron/mod.ts +0 -8
- package/src/namespaces/tron/types.ts +0 -14
- package/src/namespaces/tron/utils.ts +0 -18
- package/src/namespaces/utxo/actions.ts +0 -3
- package/src/namespaces/utxo/after.ts +0 -3
- package/src/namespaces/utxo/and.ts +0 -5
- package/src/namespaces/utxo/before.ts +0 -3
- package/src/namespaces/utxo/builders.ts +0 -12
- package/src/namespaces/utxo/constants.ts +0 -2
- package/src/namespaces/utxo/mod.ts +0 -8
- package/src/namespaces/utxo/types.ts +0 -14
- package/src/namespaces/utxo/utils.ts +0 -18
- package/src/namespaces/xrpl/builders.ts +0 -14
- package/src/namespaces/xrpl/constants.ts +0 -7
- package/src/namespaces/xrpl/mod.ts +0 -5
- package/src/namespaces/xrpl/types.ts +0 -16
- package/src/namespaces/xrpl/utils.ts +0 -15
- package/src/types/accounts.ts +0 -12
- package/src/types/mod.ts +0 -1
- package/src/types/utils.ts +0 -7
- /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,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,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,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,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
|
-
}
|
package/src/types/accounts.ts
DELETED
|
@@ -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';
|
package/src/types/utils.ts
DELETED
|
File without changes
|