@tetherto/wdk-wallet 1.0.0-beta.2 → 1.0.0-beta.21
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/AGENTS.md +49 -0
- package/README.md +2 -2
- package/bare.js +3 -3
- package/index.js +14 -2
- package/package.json +18 -4
- package/src/disposable.js +26 -0
- package/src/errors.js +318 -3
- package/src/multisig/errors.js +54 -0
- package/src/multisig/index.js +42 -0
- package/src/multisig/multisig-message-signing-read-only.js +63 -0
- package/src/multisig/multisig-message-signing.js +64 -0
- package/src/multisig/multisig-owner-management.js +94 -0
- package/src/multisig/wallet-account-multisig.js +144 -0
- package/src/multisig/wallet-account-read-only-multisig.js +98 -0
- package/src/protocols/bridge-protocol.js +35 -1
- package/src/protocols/errors.js +510 -0
- package/src/protocols/fiat-protocol.js +401 -0
- package/src/protocols/index.js +76 -0
- package/src/protocols/lending-protocol.js +114 -2
- package/src/protocols/sda-protocol.js +643 -0
- package/src/protocols/swap-protocol.js +36 -1
- package/src/protocols/swidge-protocol.js +516 -0
- package/src/signer.js +89 -0
- package/src/wallet-account-read-only-simple.js +162 -0
- package/src/wallet-account-read-only.js +186 -40
- package/src/wallet-account.js +59 -22
- package/src/wallet-manager.js +152 -25
- package/types/index.d.ts +13 -4
- package/types/src/disposable.d.ts +7 -0
- package/types/src/errors.d.ts +220 -2
- package/types/src/multisig/errors.d.ts +33 -0
- package/types/src/multisig/index.d.ts +15 -0
- package/types/src/multisig/multisig-message-signing-read-only.d.ts +53 -0
- package/types/src/multisig/multisig-message-signing.d.ts +40 -0
- package/types/src/multisig/multisig-owner-management.d.ts +65 -0
- package/types/src/multisig/wallet-account-multisig.d.ts +101 -0
- package/types/src/multisig/wallet-account-read-only-multisig.d.ts +83 -0
- package/types/src/protocols/bridge-protocol.d.ts +39 -3
- package/types/src/protocols/errors.d.ts +366 -0
- package/types/src/protocols/fiat-protocol.d.ts +409 -0
- package/types/src/protocols/index.d.ts +64 -0
- package/types/src/protocols/lending-protocol.d.ts +118 -4
- package/types/src/protocols/sda-protocol.d.ts +737 -0
- package/types/src/protocols/swap-protocol.d.ts +44 -4
- package/types/src/protocols/swidge-protocol.d.ts +483 -0
- package/types/src/signer.d.ts +53 -0
- package/types/src/wallet-account-read-only-simple.d.ts +144 -0
- package/types/src/wallet-account-read-only.d.ts +104 -27
- package/types/src/wallet-account.d.ts +55 -20
- package/types/src/wallet-manager.d.ts +109 -17
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds owner management features to a multisig wallet.
|
|
3
|
+
*
|
|
4
|
+
* @interface
|
|
5
|
+
*/
|
|
6
|
+
export interface IMultisigOwnerManagement {
|
|
7
|
+
/**
|
|
8
|
+
* Proposes adding a new owner to the multisig wallet account.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} owner - The owner's address.
|
|
11
|
+
* @param {MultisigOptions} [options] - The multisig options.
|
|
12
|
+
* @returns {Promise<MultisigProposal>} The multisig proposal.
|
|
13
|
+
* @throws {ValueError} If the address or options are not valid.
|
|
14
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
15
|
+
* @throws {ProviderError} If the provider fails to add the owner.
|
|
16
|
+
* @throws {AccountNotOwnerError} If the account is not an owner of the multisig wallet.
|
|
17
|
+
*/
|
|
18
|
+
addOwner(owner: string, options?: MultisigOptions): Promise<MultisigProposal>;
|
|
19
|
+
/**
|
|
20
|
+
* Proposes removing an owner from the multisig wallet account.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} owner - The owner's address.
|
|
23
|
+
* @param {MultisigOptions} [options] - The multisig options.
|
|
24
|
+
* @returns {Promise<MultisigProposal>} The multisig proposal.
|
|
25
|
+
* @throws {ValueError} If the address or options are not valid.
|
|
26
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
27
|
+
* @throws {ProviderError} If the provider fails to remove the owner.
|
|
28
|
+
* @throws {AccountNotOwnerError} If the account is not an owner of the multisig wallet.
|
|
29
|
+
*/
|
|
30
|
+
removeOwner(owner: string, options?: MultisigOptions): Promise<MultisigProposal>;
|
|
31
|
+
/**
|
|
32
|
+
* Proposes replacing an owner with a different one.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} oldOwner - The old owner.
|
|
35
|
+
* @param {string} newOwner - The new owner.
|
|
36
|
+
* @returns {Promise<MultisigProposal>} The multisig proposal.
|
|
37
|
+
* @throws {ValueError} If the addresses are not valid.
|
|
38
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
39
|
+
* @throws {ProviderError} If the provider fails to swap the two owners.
|
|
40
|
+
* @throws {AccountNotOwnerError} If the account is not an owner of the multisig wallet.
|
|
41
|
+
*/
|
|
42
|
+
swapOwner(oldOwner: string, newOwner: string): Promise<MultisigProposal>;
|
|
43
|
+
/**
|
|
44
|
+
* Proposes changing the signature threshold.
|
|
45
|
+
*
|
|
46
|
+
* @param {number} newThreshold - The new threshold.
|
|
47
|
+
* @returns {Promise<MultisigProposal>} The multisig proposal.
|
|
48
|
+
* @throws {ValueError} If the threshold is not valid.
|
|
49
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
50
|
+
* @throws {ProviderError} If the provider fails to change the threshold.
|
|
51
|
+
* @throws {AccountNotOwnerError} If the account is not an owner of the multisig wallet.
|
|
52
|
+
*/
|
|
53
|
+
changeThreshold(newThreshold: number): Promise<MultisigProposal>;
|
|
54
|
+
}
|
|
55
|
+
export type MultisigProposal = import("./wallet-account-read-only-multisig.js").MultisigProposal;
|
|
56
|
+
export type AccountNotOwnerError = import("./errors.js").AccountNotOwnerError;
|
|
57
|
+
export type ProviderError = import("./errors.js").ProviderError;
|
|
58
|
+
export type ProviderRequiredError = import("./errors.js").ProviderRequiredError;
|
|
59
|
+
export type ValueError = import("./errors.js").ValueError;
|
|
60
|
+
export type MultisigOptions = {
|
|
61
|
+
/**
|
|
62
|
+
* - The new amount of approvals required to execute a transaction.
|
|
63
|
+
*/
|
|
64
|
+
threshold: number;
|
|
65
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** @interface */
|
|
2
|
+
export interface IWalletAccountMultisig extends IWalletAccountReadOnlyMultisig {
|
|
3
|
+
/**
|
|
4
|
+
* The derivation path's index of this account.
|
|
5
|
+
*
|
|
6
|
+
* @type {number}
|
|
7
|
+
*/
|
|
8
|
+
get index(): number;
|
|
9
|
+
/**
|
|
10
|
+
* The derivation path of this account (see [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)).
|
|
11
|
+
*
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
get path(): string;
|
|
15
|
+
/**
|
|
16
|
+
* The key pair of this account.
|
|
17
|
+
*
|
|
18
|
+
* @type {KeyPair}
|
|
19
|
+
*/
|
|
20
|
+
get keyPair(): KeyPair;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the signer's address.
|
|
23
|
+
*
|
|
24
|
+
* @returns {Promise<string>} The signer's address.
|
|
25
|
+
*/
|
|
26
|
+
getSignerAddress(): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Proposes sending a transaction for the other owners to approve. Does not execute on-chain:
|
|
29
|
+
* the returned proposal must be approved up to the threshold and then executed via
|
|
30
|
+
* {@link executeProposal}.
|
|
31
|
+
*
|
|
32
|
+
* @param {Transaction} tx - The transaction.
|
|
33
|
+
* @param {MultisigTransactionOptions} [transactionOptions] - The multisig transaction's options.
|
|
34
|
+
* @returns {Promise<MultisigProposal>} The created proposal; its `status` is `'executed'` when `autoExecute` ran to completion, otherwise `'pending'`.
|
|
35
|
+
* @throws {ValueError} If the transaction is not valid.
|
|
36
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
37
|
+
* @throws {ProviderError} If the provider fails to propose the transaction.
|
|
38
|
+
* @throws {AccountNotOwnerError} If the account is not an owner of the multisig wallet.
|
|
39
|
+
*/
|
|
40
|
+
propose(tx: Transaction, transactionOptions?: MultisigTransactionOptions): Promise<MultisigProposal & MultisigInteractionResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Approves a pending proposal.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} proposalId - The proposal's id.
|
|
45
|
+
* @returns {Promise<MultisigProposal>} The multisig proposal.
|
|
46
|
+
* @throws {ValueError} If the proposal's identifier is not a valid id.
|
|
47
|
+
* @throws {NoSuchElementError} If no message exists for the given id.
|
|
48
|
+
* @throws {AccountNotOwnerError} If the account is not an owner of the multisig wallet.
|
|
49
|
+
*/
|
|
50
|
+
approveProposal(proposalId: string): Promise<MultisigProposal & MultisigInteractionResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Rejects a pending proposal.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} proposalId - The proposal's id.
|
|
55
|
+
* @returns {Promise<MultisigProposal>} The multisig proposal.
|
|
56
|
+
* @throws {ValueError} If the proposal's identifier is not a valid id.
|
|
57
|
+
* @throws {NoSuchElementError} If no message exists for the given id.
|
|
58
|
+
* @throws {AccountNotOwnerError} If the account is not an owner of the multisig wallet.
|
|
59
|
+
*/
|
|
60
|
+
rejectProposal(proposalId: string): Promise<MultisigProposal>;
|
|
61
|
+
/**
|
|
62
|
+
* Submits an approved proposal for on-chain execution.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} proposalId - The proposal's id.
|
|
65
|
+
* @returns {Promise<TransactionResult>} The on-chain transaction's result.
|
|
66
|
+
* @throws {ValueError} If the proposal's identifier is not a valid id.
|
|
67
|
+
* @throws {NoSuchElementError} If no proposal exists for the given id.
|
|
68
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
69
|
+
* @throws {ProviderError} If the provider fails to execute the proposal.
|
|
70
|
+
* @throws {TransactionError} If the transaction fails with an error.
|
|
71
|
+
* @throws {AccountNotOwnerError} If the account is not an owner of the multisig wallet.
|
|
72
|
+
* @throws {ThresholdNotMetError} If the proposal's threshold has not been met yet.
|
|
73
|
+
* @throws {MaximumFeeExceededError} If the the costs of the transaction exceeds the transaction max. fee option.
|
|
74
|
+
*/
|
|
75
|
+
executeProposal(proposalId: string): Promise<TransactionResult>;
|
|
76
|
+
}
|
|
77
|
+
export type Transaction = import("../wallet-account-read-only.js").Transaction;
|
|
78
|
+
export type TransactionResult = import("../wallet-account-read-only.js").TransactionResult;
|
|
79
|
+
export type KeyPair = import("../wallet-account.js").KeyPair;
|
|
80
|
+
export type MultisigProposal = import("./wallet-account-read-only-multisig.js").MultisigProposal;
|
|
81
|
+
export type AccountNotOwnerError = import("./errors.js").AccountNotOwnerError;
|
|
82
|
+
export type MaximumFeeExceededError = import("./errors.js").MaximumFeeExceededError;
|
|
83
|
+
export type NoSuchElementError = import("./errors.js").NoSuchElementError;
|
|
84
|
+
export type ProviderError = import("./errors.js").ProviderError;
|
|
85
|
+
export type ProviderRequiredError = import("./errors.js").ProviderRequiredError;
|
|
86
|
+
export type TransactionError = import("./errors.js").TransactionError;
|
|
87
|
+
export type ThresholdNotMetError = import("./errors.js").ThresholdNotMetError;
|
|
88
|
+
export type ValueError = import("./errors.js").ValueError;
|
|
89
|
+
export type MultisigTransactionOptions = {
|
|
90
|
+
/**
|
|
91
|
+
* - If true, automatically executes the transaction when the approval threshold is met (only takes effect if this signer's approval is the last one required).
|
|
92
|
+
*/
|
|
93
|
+
autoExecute?: boolean;
|
|
94
|
+
};
|
|
95
|
+
export type MultisigInteractionResult = {
|
|
96
|
+
/**
|
|
97
|
+
* - The on-chain transaction produced by this call, when the call itself settles on-chain — the execution transaction when a call triggers execution, or, on backends where every proposal/approval is its own on-chain transaction, that call's transaction. Undefined when the call only updates off-chain state. Its presence does not imply the proposal executed; execution is determined solely by `status`.
|
|
98
|
+
*/
|
|
99
|
+
transaction?: TransactionResult;
|
|
100
|
+
};
|
|
101
|
+
import { IWalletAccountReadOnlyMultisig } from './wallet-account-read-only-multisig.js';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** @interface */
|
|
2
|
+
export interface IWalletAccountReadOnlyMultisig extends IWalletAccountReadOnlySimple {
|
|
3
|
+
/**
|
|
4
|
+
* Returns the multisig wallet account info.
|
|
5
|
+
*
|
|
6
|
+
* @returns {Promise<MultisigInfo>} The info.
|
|
7
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
8
|
+
* @throws {ProviderError} If the provider fails to fetch the multisig wallet's info.
|
|
9
|
+
*/
|
|
10
|
+
getMultisigInfo(): Promise<MultisigInfo>;
|
|
11
|
+
/**
|
|
12
|
+
* Returns a list of proposals by their identifiers.
|
|
13
|
+
*
|
|
14
|
+
* @param {string[]} proposalIds - The list of proposal's identifiers.
|
|
15
|
+
* @returns {Promise<Record<string, MultisigProposal | null>>} For each proposal id, the proposal details or
|
|
16
|
+
* null if the proposal has not been found.
|
|
17
|
+
* @throws {ValueError} If the list of proposal's identifiers contains an invalid id.
|
|
18
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
19
|
+
* @throws {ProviderError} If the provider fails to fetch the proposals.
|
|
20
|
+
*/
|
|
21
|
+
getProposals(proposalIds: string[]): Promise<Record<string, MultisigProposal | null>>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns a proposal by its identifier.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} proposalId - The proposal's identifier.
|
|
26
|
+
* @returns {Promise<MultisigProposal | null>} The proposal details, or null if it has not been found.
|
|
27
|
+
* @throws {ValueError} If the proposal's identifier is not a valid id.
|
|
28
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
29
|
+
* @throws {ProviderError} If the provider fails to fetch the proposal.
|
|
30
|
+
*/
|
|
31
|
+
getProposal(proposalId: string): Promise<MultisigProposal | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Quotes the on-chain cost of executing a pending proposal.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} proposalId - The proposal's id.
|
|
36
|
+
* @returns {Promise<Omit<TransactionResult, 'hash'>>} The execution cost estimate.
|
|
37
|
+
* @throws {ValueError} If the proposal's identifier is not a valid id.
|
|
38
|
+
* @throws {NoSuchElementError} If no proposal exists for the given id.
|
|
39
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
40
|
+
* @throws {ProviderError} If the provider fails to estimate the costs of the transaction.
|
|
41
|
+
* @throws {TransactionError} If the transaction fails with an error.
|
|
42
|
+
*/
|
|
43
|
+
quoteExecuteProposal(proposalId: string): Promise<Omit<TransactionResult, "hash">>;
|
|
44
|
+
}
|
|
45
|
+
export type TransactionResult = import("../wallet-account-read-only.js").TransactionResult;
|
|
46
|
+
export type NoSuchElementError = import("./errors.js").NoSuchElementError;
|
|
47
|
+
export type ProviderError = import("./errors.js").ProviderError;
|
|
48
|
+
export type ProviderRequiredError = import("./errors.js").ProviderRequiredError;
|
|
49
|
+
export type TransactionError = import("./errors.js").TransactionError;
|
|
50
|
+
export type ValueError = import("./errors.js").ValueError;
|
|
51
|
+
export type MultisigInfo = {
|
|
52
|
+
/**
|
|
53
|
+
* - The multisig wallet account address.
|
|
54
|
+
*/
|
|
55
|
+
address: string;
|
|
56
|
+
/**
|
|
57
|
+
* - The owners of the multisig wallet account.
|
|
58
|
+
*/
|
|
59
|
+
owners: string[];
|
|
60
|
+
/**
|
|
61
|
+
* - The minimum amount of signatures to execute a transaction.
|
|
62
|
+
*/
|
|
63
|
+
threshold: number;
|
|
64
|
+
};
|
|
65
|
+
export type MultisigProposal = {
|
|
66
|
+
/**
|
|
67
|
+
* - The proposal's id.
|
|
68
|
+
*/
|
|
69
|
+
proposalId: string;
|
|
70
|
+
/**
|
|
71
|
+
* - The current number of confirmations.
|
|
72
|
+
*/
|
|
73
|
+
confirmations: number;
|
|
74
|
+
/**
|
|
75
|
+
* - The minimum amount of confirmations to execute the transaction.
|
|
76
|
+
*/
|
|
77
|
+
threshold: number;
|
|
78
|
+
/**
|
|
79
|
+
* - The proposal's lifecycle state: `'pending'` while it still awaits confirmations or on-chain execution, `'executed'` once it has been executed on-chain.
|
|
80
|
+
*/
|
|
81
|
+
status: "pending" | "executed";
|
|
82
|
+
};
|
|
83
|
+
import { IWalletAccountReadOnlySimple } from '../wallet-account-read-only-simple.js';
|
|
@@ -5,6 +5,13 @@ export interface IBridgeProtocol {
|
|
|
5
5
|
*
|
|
6
6
|
* @param {BridgeOptions} options - The bridge's options.
|
|
7
7
|
* @returns {Promise<BridgeResult>} The bridge's result.
|
|
8
|
+
* @throws {AccountRequiredError} If the protocol requires a full account to perform a bridge.
|
|
9
|
+
* @throws {ValueError} If the bridge options are not valid.
|
|
10
|
+
* @throws {InvalidTokenError} If the token is not a valid ERC 20 token's address.
|
|
11
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
12
|
+
* @throws {ProviderError} If the provider fails to perform the bridge.
|
|
13
|
+
* @throws {BridgeError} If the bridge fails with an error.
|
|
14
|
+
* @throws {MaximumFeeExceededError} If the the costs of the transaction exceeds the bridge max. fee option.
|
|
8
15
|
*/
|
|
9
16
|
bridge(options: BridgeOptions): Promise<BridgeResult>;
|
|
10
17
|
/**
|
|
@@ -12,10 +19,19 @@ export interface IBridgeProtocol {
|
|
|
12
19
|
*
|
|
13
20
|
* @param {BridgeOptions} options - The bridge's options.
|
|
14
21
|
* @returns {Promise<Omit<BridgeResult, 'hash'>>} The bridge's quotes.
|
|
22
|
+
* @throws {ReadOnlyAccountRequiredError} If the protocol requires a read-only or full account to quote the costs of a swap.
|
|
23
|
+
* @throws {ValueError} If the bridge options are not valid.
|
|
24
|
+
* @throws {InvalidTokenError} If the token is not a valid ERC 20 token's address.
|
|
25
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
26
|
+
* @throws {ProviderError} If the provider fails to perform the bridge.
|
|
27
|
+
* @throws {BridgeError} If the bridge fails with an error.
|
|
15
28
|
*/
|
|
16
29
|
quoteBridge(options: BridgeOptions): Promise<Omit<BridgeResult, "hash">>;
|
|
17
30
|
}
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @abstract
|
|
33
|
+
* @implements {IBridgeProtocol}
|
|
34
|
+
*/
|
|
19
35
|
export default abstract class BridgeProtocol implements IBridgeProtocol {
|
|
20
36
|
/**
|
|
21
37
|
* Creates a new read-only bridge protocol.
|
|
@@ -37,9 +53,9 @@ export default abstract class BridgeProtocol implements IBridgeProtocol {
|
|
|
37
53
|
* The wallet account to use to interact with the protocol.
|
|
38
54
|
*
|
|
39
55
|
* @protected
|
|
40
|
-
* @type {IWalletAccount}
|
|
56
|
+
* @type {IWalletAccountReadOnly | IWalletAccount}
|
|
41
57
|
*/
|
|
42
|
-
protected _account: IWalletAccount;
|
|
58
|
+
protected _account: IWalletAccountReadOnly | IWalletAccount;
|
|
43
59
|
/**
|
|
44
60
|
* The bridge protocol configuration.
|
|
45
61
|
*
|
|
@@ -53,6 +69,13 @@ export default abstract class BridgeProtocol implements IBridgeProtocol {
|
|
|
53
69
|
* @abstract
|
|
54
70
|
* @param {BridgeOptions} options - The bridge's options.
|
|
55
71
|
* @returns {Promise<BridgeResult>} The bridge's result.
|
|
72
|
+
* @throws {AccountRequiredError} If the protocol requires a full account to perform a bridge.
|
|
73
|
+
* @throws {ValueError} If the bridge options are not valid.
|
|
74
|
+
* @throws {InvalidTokenError} If the token is not a valid ERC 20 token's address.
|
|
75
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
76
|
+
* @throws {ProviderError} If the provider fails to perform the bridge.
|
|
77
|
+
* @throws {BridgeError} If the bridge fails with an error.
|
|
78
|
+
* @throws {MaximumFeeExceededError} If the the costs of the transaction exceeds the bridge max. fee option.
|
|
56
79
|
*/
|
|
57
80
|
abstract bridge(options: BridgeOptions): Promise<BridgeResult>;
|
|
58
81
|
/**
|
|
@@ -61,11 +84,24 @@ export default abstract class BridgeProtocol implements IBridgeProtocol {
|
|
|
61
84
|
* @abstract
|
|
62
85
|
* @param {BridgeOptions} options - The bridge's options.
|
|
63
86
|
* @returns {Promise<Omit<BridgeResult, 'hash'>>} The bridge's quotes.
|
|
87
|
+
* @throws {ValueError} If the bridge options are not valid.
|
|
88
|
+
* @throws {InvalidTokenError} If the token is not a valid ERC 20 token's address.
|
|
89
|
+
* @throws {ProviderRequiredError} If the method requires a provider.
|
|
90
|
+
* @throws {ProviderError} If the provider fails to perform the bridge.
|
|
91
|
+
* @throws {BridgeError} If the bridge fails with an error.
|
|
64
92
|
*/
|
|
65
93
|
abstract quoteBridge(options: BridgeOptions): Promise<Omit<BridgeResult, "hash">>;
|
|
66
94
|
}
|
|
67
95
|
export type IWalletAccountReadOnly = import("../wallet-account-read-only.js").IWalletAccountReadOnly;
|
|
68
96
|
export type IWalletAccount = import("../wallet-account.js").IWalletAccount;
|
|
97
|
+
export type AccountRequiredError = import("./errors.js").AccountRequiredError;
|
|
98
|
+
export type BridgeError = import("./errors.js").BridgeError;
|
|
99
|
+
export type InvalidTokenError = import("./errors.js").InvalidTokenError;
|
|
100
|
+
export type MaximumFeeExceededError = import("./errors.js").MaximumFeeExceededError;
|
|
101
|
+
export type ReadOnlyAccountRequiredError = import("./errors.js").ReadOnlyAccountRequiredError;
|
|
102
|
+
export type ProviderError = import("./errors.js").ProviderError;
|
|
103
|
+
export type ProviderRequiredError = import("./errors.js").ProviderRequiredError;
|
|
104
|
+
export type ValueError = import("./errors.js").ValueError;
|
|
69
105
|
export type BridgeProtocolConfig = {
|
|
70
106
|
/**
|
|
71
107
|
* - The maximum fee amount for bridge operations.
|