@gardenfi/core 2.5.2-beta.5 → 2.5.3-beta.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/{ccip-DSGVoxhU.cjs → ccip-BixEUfCX.cjs} +1 -1
- package/dist/{ccip-Bg3f6Dwh.js → ccip-Cmo2J8uO.js} +1 -1
- package/dist/index-BsnXI660.js +33105 -0
- package/dist/index-Bx--llHe.cjs +106 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +35 -33
- package/dist/src/index.d.ts +12 -9
- package/dist/src/lib/bitcoin/bitcoinHtlc.d.ts +107 -0
- package/dist/src/lib/bitcoin/bitcoinhtlc.types.d.ts +53 -0
- package/dist/src/lib/blockNumberFetcher/blockNumber.d.ts +2 -2
- package/dist/src/lib/constants.d.ts +4 -8
- package/dist/src/lib/evm/htlc/evmHTLC.d.ts +27 -27
- package/dist/src/lib/evm/htlc.types.d.ts +4 -4
- package/dist/src/lib/evm/relay/evmRelay.d.ts +5 -4
- package/dist/src/lib/evm/relay/evmRelay.types.d.ts +2 -2
- package/dist/src/lib/garden/cache/GardenCache.d.ts +46 -0
- package/dist/src/lib/garden/executor/executor.d.ts +26 -0
- package/dist/src/lib/garden/garden.d.ts +44 -51
- package/dist/src/lib/garden/garden.types.d.ts +57 -100
- package/dist/src/lib/garden/utils.d.ts +4 -0
- package/dist/src/lib/orderStatus/orderStatus.d.ts +25 -0
- package/dist/src/lib/quote/quote.d.ts +4 -3
- package/dist/src/lib/quote/quote.types.d.ts +17 -8
- package/dist/src/lib/routeValidator/routeValidator.d.ts +30 -0
- package/dist/src/lib/solana/htlc/ISolanaHTLC.d.ts +4 -4
- package/dist/src/lib/solana/htlc/solanaHTLC.d.ts +7 -7
- package/dist/src/lib/solana/relayer/solanaRelay.d.ts +13 -25
- package/dist/src/lib/solana/solanaTypes.d.ts +3 -3
- package/dist/src/lib/starknet/htlc/starknetHTLC.d.ts +4 -4
- package/dist/src/lib/starknet/relay/starknetRelay.d.ts +8 -5
- package/dist/src/lib/starknet/starknetHTLC.types.d.ts +4 -4
- package/dist/src/lib/sui/htlc/suiHTLC.d.ts +7 -6
- package/dist/src/lib/sui/relay/suiRelay.d.ts +4 -3
- package/dist/src/lib/sui/suiHTLC.types.d.ts +4 -4
- package/dist/src/lib/switchOrAddNetwork.d.ts +1 -0
- package/dist/src/lib/utils.d.ts +26 -5
- package/package.json +5 -4
- package/dist/index-D-NHDZrP.js +0 -31936
- package/dist/index-s2tkcnpk.cjs +0 -105
- package/dist/src/lib/bitcoin/htlc.d.ts +0 -106
- package/dist/src/lib/garden/cache/executorCache.d.ts +0 -14
- package/dist/src/lib/orderStatus/orderStatusParser.d.ts +0 -37
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnchorProvider } from '@coral-xyz/anchor';
|
|
2
|
-
import { AsyncResult, Url } from '@gardenfi/utils';
|
|
2
|
+
import { AsyncResult, IAuth, Url } from '@gardenfi/utils';
|
|
3
3
|
import { ISolanaHTLC } from '../htlc/ISolanaHTLC';
|
|
4
|
-
import {
|
|
4
|
+
import { Order, SolanaOrderResponse } from '@gardenfi/orderbook';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A Relay is an endpoint that submits the transaction on-chain on one's behalf, paying any fees.
|
|
@@ -18,6 +18,8 @@ export declare class SolanaRelay implements ISolanaHTLC {
|
|
|
18
18
|
private splProgram?;
|
|
19
19
|
private nativeProgram?;
|
|
20
20
|
private relayer;
|
|
21
|
+
private orderbook;
|
|
22
|
+
private auth;
|
|
21
23
|
/**
|
|
22
24
|
* Creates a new instance of SolanaRelay.
|
|
23
25
|
* @param {AnchorProvider} provider - An abstraction of RPC connection and a Wallet
|
|
@@ -30,20 +32,13 @@ export declare class SolanaRelay implements ISolanaHTLC {
|
|
|
30
32
|
constructor(provider: AnchorProvider, url: Url, relayer: string, programAddress: {
|
|
31
33
|
native?: string;
|
|
32
34
|
spl?: string;
|
|
33
|
-
});
|
|
35
|
+
}, auth: IAuth);
|
|
34
36
|
/**
|
|
35
37
|
* Gets the on-chain address of the current user's wallet.
|
|
36
38
|
* @returns {string} The wallet's on-chain address in base58 format
|
|
37
39
|
* @throws {Error} If no provider public key is found
|
|
38
40
|
*/
|
|
39
41
|
get htlcActorAddress(): string;
|
|
40
|
-
/**
|
|
41
|
-
* Determines if the given order is for a native Solana token (SOL).
|
|
42
|
-
* @param {MatchedOrder} order - The matched order to check
|
|
43
|
-
* @returns {boolean} True if it's a native token, false if it's an SPL token
|
|
44
|
-
* @private
|
|
45
|
-
*/
|
|
46
|
-
private isNativeToken;
|
|
47
42
|
/**
|
|
48
43
|
* Sends a transaction via the relayer for SPL tokens.
|
|
49
44
|
* @param {web3.Transaction} transaction - The transaction to send
|
|
@@ -57,24 +52,16 @@ export declare class SolanaRelay implements ISolanaHTLC {
|
|
|
57
52
|
/**
|
|
58
53
|
* Initiates a swap directly via HTLC (without relayer).
|
|
59
54
|
* @param {web3.Transaction} transaction - The transaction to send
|
|
60
|
-
* @param {
|
|
55
|
+
* @param {Order} order - The matched order
|
|
61
56
|
* @returns {Promise<AsyncResult<string, string>>} A promise that resolves to either:
|
|
62
57
|
* - Ok with the transaction ID on success
|
|
63
58
|
* - Err with an error message on failure
|
|
64
59
|
* @private
|
|
65
60
|
*/
|
|
66
61
|
private initiateViaHTLC;
|
|
67
|
-
/**
|
|
68
|
-
* Creates a PDA (Program Derived Address) for the swap account.
|
|
69
|
-
* @param {Buffer} secretHash - The secret hash buffer
|
|
70
|
-
* @param {web3.PublicKey} programId - The program ID to use for PDA derivation
|
|
71
|
-
* @returns {web3.PublicKey} The derived PDA
|
|
72
|
-
* @private
|
|
73
|
-
*/
|
|
74
|
-
private createSwapPDA;
|
|
75
62
|
/**
|
|
76
63
|
* Initiates a swap for SPL tokens.
|
|
77
|
-
* @param {
|
|
64
|
+
* @param {Order} order - The matched order containing swap details
|
|
78
65
|
* @returns {Promise<AsyncResult<string, string>>} A promise that resolves to either:
|
|
79
66
|
* - Ok with the transaction ID on success
|
|
80
67
|
* - Err with an error message on failure
|
|
@@ -83,7 +70,7 @@ export declare class SolanaRelay implements ISolanaHTLC {
|
|
|
83
70
|
private initiateSplSwap;
|
|
84
71
|
/**
|
|
85
72
|
* Initiates a swap for native tokens (SOL).
|
|
86
|
-
* @param {
|
|
73
|
+
* @param {Order} order - The matched order containing swap details
|
|
87
74
|
* @returns {Promise<AsyncResult<string, string>>} A promise that resolves to either:
|
|
88
75
|
* - Ok with the transaction ID on success
|
|
89
76
|
* - Err with an error message on failure
|
|
@@ -93,21 +80,22 @@ export declare class SolanaRelay implements ISolanaHTLC {
|
|
|
93
80
|
/**
|
|
94
81
|
* Initiates a swap by creating a new swap account and locking funds.
|
|
95
82
|
* Automatically detects whether to use SPL or native token handling.
|
|
96
|
-
* @param {
|
|
83
|
+
* @param {Order} order - The matched order containing swap details
|
|
97
84
|
* @returns {Promise<AsyncResult<string, string>>} A promise that resolves to either:
|
|
98
85
|
* - Ok with the transaction ID on success
|
|
99
86
|
* - Err with an error message on failure
|
|
100
87
|
*/
|
|
101
|
-
initiate(order:
|
|
88
|
+
initiate(order: Order | SolanaOrderResponse): AsyncResult<string, string>;
|
|
102
89
|
/**
|
|
103
90
|
* Redeems a swap by providing the secret.
|
|
104
|
-
* @param {
|
|
91
|
+
* @param {Order} order - Matched order object containing swap details
|
|
105
92
|
* @param {string} secret - Secret key in hex format
|
|
106
93
|
* @returns {Promise<AsyncResult<string, string>>} A promise that resolves to either:
|
|
107
94
|
* - Ok with the transaction ID on success
|
|
108
95
|
* - Err with an error message on failure
|
|
109
96
|
*/
|
|
110
|
-
redeem(order:
|
|
97
|
+
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
98
|
+
private initiateWithCreateOrderResponse;
|
|
111
99
|
/**
|
|
112
100
|
* DO NOT CALL THIS FUNCTION. Refund is automatically taken care of by the relayer!
|
|
113
101
|
* This method exists only to satisfy the ISolanaHTLC interface but is not intended for direct use.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { web3, BN } from '@coral-xyz/anchor';
|
|
2
|
-
import {
|
|
2
|
+
import { Order } from '@gardenfi/orderbook';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A Swap configuration in Solana
|
|
@@ -20,9 +20,9 @@ export declare class SwapConfig {
|
|
|
20
20
|
constructor(swapId: string, redeemer: string, secretHash: string, amount: bigint, expiresIn: number);
|
|
21
21
|
/**
|
|
22
22
|
* Constructs a SwapConfig from a matched order object with Solana as a source swap
|
|
23
|
-
* @param order - The
|
|
23
|
+
* @param order - The Order with a Solana as source swap
|
|
24
24
|
*/
|
|
25
|
-
static from(order:
|
|
25
|
+
static from(order: Order): SwapConfig;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Checks whether given secret is a valid 32 byte hex string.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Order } from '@gardenfi/orderbook';
|
|
2
2
|
import { Account, CallData } from 'starknet';
|
|
3
3
|
import { AsyncResult, Network } from '@gardenfi/utils';
|
|
4
4
|
import { IStarknetHTLC } from '../starknetHTLC.types';
|
|
@@ -14,7 +14,7 @@ export declare class StarknetHTLC implements IStarknetHTLC {
|
|
|
14
14
|
* @param order Order to initiate HTLC for
|
|
15
15
|
* @returns Transaction ID
|
|
16
16
|
*/
|
|
17
|
-
initiate(order:
|
|
17
|
+
initiate(order: Order): AsyncResult<string, string>;
|
|
18
18
|
callData: CallData;
|
|
19
19
|
/**
|
|
20
20
|
* Redeems the HTLC
|
|
@@ -23,12 +23,12 @@ export declare class StarknetHTLC implements IStarknetHTLC {
|
|
|
23
23
|
* @param secret Secret to redeem HTLC with
|
|
24
24
|
* @returns Transaction ID
|
|
25
25
|
*/
|
|
26
|
-
redeem(order:
|
|
26
|
+
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
27
27
|
/**
|
|
28
28
|
* Refunds the HTLC
|
|
29
29
|
*
|
|
30
30
|
* @param order Order to refund HTLC for
|
|
31
31
|
* @returns Refund transaction ID
|
|
32
32
|
*/
|
|
33
|
-
refund(order:
|
|
33
|
+
refund(order: Order): AsyncResult<string, string>;
|
|
34
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AccountInterface } from 'starknet';
|
|
2
|
-
import {
|
|
3
|
-
import { AsyncResult, Network, Url } from '@gardenfi/utils';
|
|
2
|
+
import { Order, StarknetOrderResponse } from '@gardenfi/orderbook';
|
|
3
|
+
import { AsyncResult, IAuth, Network, Url } from '@gardenfi/utils';
|
|
4
4
|
import { IStarknetHTLC } from '../starknetHTLC.types';
|
|
5
5
|
|
|
6
6
|
export declare class StarknetRelay implements IStarknetHTLC {
|
|
@@ -8,11 +8,14 @@ export declare class StarknetRelay implements IStarknetHTLC {
|
|
|
8
8
|
private account;
|
|
9
9
|
private starknetProvider;
|
|
10
10
|
private chainId;
|
|
11
|
-
|
|
11
|
+
private auth;
|
|
12
|
+
constructor(relayerUrl: string | Url, account: AccountInterface, network: Network, auth: IAuth, nodeUrl?: string);
|
|
12
13
|
get htlcActorAddress(): string;
|
|
13
|
-
initiate(order:
|
|
14
|
+
initiate(order: Order | StarknetOrderResponse): AsyncResult<string, string>;
|
|
14
15
|
private approveAndInitiate;
|
|
15
16
|
private initiateRelay;
|
|
16
|
-
redeem(order:
|
|
17
|
+
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
18
|
+
executeApprovalTransaction(order: StarknetOrderResponse): AsyncResult<string, string>;
|
|
19
|
+
initiateWithCreateOrderResponse(order: StarknetOrderResponse): AsyncResult<string, string>;
|
|
17
20
|
refund(): AsyncResult<string, string>;
|
|
18
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Order, StarknetOrderResponse } from '@gardenfi/orderbook';
|
|
2
2
|
import { AsyncResult } from '@gardenfi/utils';
|
|
3
3
|
|
|
4
4
|
export interface IStarknetHTLC {
|
|
@@ -11,18 +11,18 @@ export interface IStarknetHTLC {
|
|
|
11
11
|
* @param order - The matched order.
|
|
12
12
|
* @returns A promise resolving to the transaction hash of the initiation.
|
|
13
13
|
*/
|
|
14
|
-
initiate(order:
|
|
14
|
+
initiate(order: Order | StarknetOrderResponse): AsyncResult<string, string>;
|
|
15
15
|
/**
|
|
16
16
|
* Redeems funds from the HTLC contract to the actor's address.
|
|
17
17
|
* @param order - The matched order.
|
|
18
18
|
* @param secret - The secret required to unlock the htlc.
|
|
19
19
|
* @returns A promise resolving to the transaction hash of the redemption.
|
|
20
20
|
*/
|
|
21
|
-
redeem(order:
|
|
21
|
+
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
22
22
|
/**
|
|
23
23
|
* Refunds funds from the HTLC contract back to the actor's address upon expiration.
|
|
24
24
|
* @param order - The matched order.
|
|
25
25
|
* @returns A promise resolving to the transaction hash of the refund.
|
|
26
26
|
*/
|
|
27
|
-
refund(order:
|
|
27
|
+
refund(order: Order): AsyncResult<string, string>;
|
|
28
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AsyncResult, Network } from '@gardenfi/utils';
|
|
1
|
+
import { Order } from '@gardenfi/orderbook';
|
|
2
|
+
import { AsyncResult, Url, Network } from '@gardenfi/utils';
|
|
3
3
|
import { ISuiHTLC } from '../suiHTLC.types';
|
|
4
4
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
5
5
|
import { WalletWithRequiredFeatures } from '@mysten/wallet-standard';
|
|
@@ -8,14 +8,15 @@ export declare class SuiHTLC implements ISuiHTLC {
|
|
|
8
8
|
private client;
|
|
9
9
|
private account;
|
|
10
10
|
private network;
|
|
11
|
-
|
|
11
|
+
private url;
|
|
12
|
+
constructor(account: WalletWithRequiredFeatures | Ed25519Keypair, network: Network, url: Url);
|
|
12
13
|
get htlcActorAddress(): string;
|
|
13
14
|
/**
|
|
14
15
|
* Initiates the HTLC
|
|
15
16
|
* @param order Order to initiate HTLC for
|
|
16
17
|
* @returns Transaction ID
|
|
17
18
|
*/
|
|
18
|
-
initiate(order:
|
|
19
|
+
initiate(order: Order): AsyncResult<string, string>;
|
|
19
20
|
/**
|
|
20
21
|
* Redeems the HTLC
|
|
21
22
|
*
|
|
@@ -23,12 +24,12 @@ export declare class SuiHTLC implements ISuiHTLC {
|
|
|
23
24
|
* @param secret Secret to redeem HTLC with
|
|
24
25
|
* @returns Transaction ID
|
|
25
26
|
*/
|
|
26
|
-
redeem(order:
|
|
27
|
+
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
27
28
|
/**
|
|
28
29
|
* Refunds the HTLC
|
|
29
30
|
*
|
|
30
31
|
* @param order Order to refund HTLC for
|
|
31
32
|
* @returns Refund transaction ID
|
|
32
33
|
*/
|
|
33
|
-
refund(order:
|
|
34
|
+
refund(order: Order): AsyncResult<string, string>;
|
|
34
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Order, SuiOrderResponse } from '@gardenfi/orderbook';
|
|
2
2
|
import { AsyncResult, Network, Url } from '@gardenfi/utils';
|
|
3
3
|
import { ISuiHTLC } from '../suiHTLC.types';
|
|
4
4
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
@@ -11,7 +11,8 @@ export declare class SuiRelay implements ISuiHTLC {
|
|
|
11
11
|
private network;
|
|
12
12
|
constructor(relayerUrl: string | Url, account: WalletWithRequiredFeatures | Ed25519Keypair, network: Network);
|
|
13
13
|
get htlcActorAddress(): string;
|
|
14
|
-
initiate(order:
|
|
15
|
-
redeem(order:
|
|
14
|
+
initiate(order: Order | SuiOrderResponse): AsyncResult<string, string>;
|
|
15
|
+
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
16
|
+
private initiateWithCreateOrderResponse;
|
|
16
17
|
refund(): AsyncResult<string, string>;
|
|
17
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Order, SuiOrderResponse } from '@gardenfi/orderbook';
|
|
2
2
|
import { AsyncResult } from '@gardenfi/utils';
|
|
3
3
|
|
|
4
4
|
export interface ISuiHTLC {
|
|
@@ -11,18 +11,18 @@ export interface ISuiHTLC {
|
|
|
11
11
|
* @param order - The matched order.
|
|
12
12
|
* @returns A promise resolving to the transaction hash of the initiation.
|
|
13
13
|
*/
|
|
14
|
-
initiate(order:
|
|
14
|
+
initiate(order: Order | SuiOrderResponse): AsyncResult<string, string>;
|
|
15
15
|
/**
|
|
16
16
|
* Redeems funds from the HTLC contract to the actor's address.
|
|
17
17
|
* @param order - The matched order.
|
|
18
18
|
* @param secret - The secret required to unlock the htlc.
|
|
19
19
|
* @returns A promise resolving to the transaction hash of the redemption.
|
|
20
20
|
*/
|
|
21
|
-
redeem(order:
|
|
21
|
+
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
22
22
|
/**
|
|
23
23
|
* Refunds funds from the HTLC contract back to the actor's address upon expiration.
|
|
24
24
|
* @param order - The matched order.
|
|
25
25
|
* @returns A promise resolving to the transaction hash of the refund.
|
|
26
26
|
*/
|
|
27
|
-
refund(order:
|
|
27
|
+
refund(order: Order): AsyncResult<string, string>;
|
|
28
28
|
}
|
|
@@ -7,6 +7,7 @@ export declare const botanixMainnet: viemChain;
|
|
|
7
7
|
export declare const hyperliquidTestnet: viemChain;
|
|
8
8
|
export declare const hyperliquid: viemChain;
|
|
9
9
|
export declare const evmToViemChainMap: Record<EvmChain, viemChain>;
|
|
10
|
+
export declare const getChainNameFromChainId: (chainId: number) => EvmChain | null;
|
|
10
11
|
/**
|
|
11
12
|
* Switches or adds a network to the wallet
|
|
12
13
|
* @param chain Garden supported chain
|
package/dist/src/lib/utils.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Environment, Err, Ok } from '@gardenfi/utils';
|
|
2
|
-
import { Chain } from '@gardenfi/orderbook';
|
|
1
|
+
import { AsyncResult, Environment, Err, Ok, Url, Network } from '@gardenfi/utils';
|
|
2
|
+
import { AffiliateFee, BlockchainType, Chain } from '@gardenfi/orderbook';
|
|
3
3
|
import { Signature } from 'starknet';
|
|
4
4
|
import { Api } from './constants';
|
|
5
|
-
import { ApiConfig } from './garden/garden.types';
|
|
5
|
+
import { ApiConfig, GardenHTLCModules } from './garden/garden.types';
|
|
6
6
|
import { BitcoinNetwork } from './bitcoin/provider/provider.interface';
|
|
7
7
|
import { IBaseWallet } from './bitcoin/wallet/baseWallet';
|
|
8
8
|
import { web3 } from '@coral-xyz/anchor';
|
|
9
9
|
|
|
10
10
|
export declare function resolveApiConfig(env: ApiConfig): {
|
|
11
11
|
api: Api;
|
|
12
|
-
|
|
12
|
+
network: Network;
|
|
13
13
|
};
|
|
14
14
|
export declare const computeSecret: (fromChain: Chain, toChain: Chain, wallets: Partial<Record<Chain, IBaseWallet>>, nonce: number) => Promise<string>;
|
|
15
15
|
export declare const isFromChainBitcoin: (chain: Chain) => chain is "bitcoin" | "bitcoin_testnet" | "bitcoin_regtest";
|
|
@@ -31,7 +31,8 @@ export declare const toXOnly: (pubKey: string) => string;
|
|
|
31
31
|
export declare const isValidBitcoinPubKey: (pubKey: string) => boolean;
|
|
32
32
|
export declare const constructOrderPair: (sourceChain: Chain, sourceAsset: string, destChain: Chain, destAsset: string) => string;
|
|
33
33
|
export declare function validateBTCAddress(address: string, networkType: Environment): boolean;
|
|
34
|
-
export declare
|
|
34
|
+
export declare function generateOutputs(output: Buffer, count: number): Buffer[];
|
|
35
|
+
export declare const getBitcoinNetworkFromEnvironment: (network: Network) => BitcoinNetwork;
|
|
35
36
|
export declare const isHexString: (value: string) => boolean;
|
|
36
37
|
export declare const formatStarknetSignature: (sig: Signature) => Err<string> | Ok<string[]>;
|
|
37
38
|
export declare function reversify(val: string): Buffer;
|
|
@@ -39,3 +40,23 @@ export declare function isErrorWithMessage(err: unknown): err is {
|
|
|
39
40
|
message: string;
|
|
40
41
|
};
|
|
41
42
|
export declare const waitForSolanaTxConfirmation: (connection: web3.Connection, txHash: string) => Promise<boolean>;
|
|
43
|
+
export declare const getAssetInfoFromOrder: (order: string, url: Url) => Promise<AsyncResult<{
|
|
44
|
+
htlcAddress: string;
|
|
45
|
+
tokenAddress: string;
|
|
46
|
+
}, string>>;
|
|
47
|
+
export declare const validateAmount: (amount: string) => Err<string> | Ok<BigNumber>;
|
|
48
|
+
export declare const withDefaultAffiliateFees: (list: AffiliateFee[] | undefined) => AffiliateFee[];
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param blockchainType
|
|
52
|
+
* @param htlcs
|
|
53
|
+
* @param addresses
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
export declare const getAddresses: (blockchainType: BlockchainType, htlcs: GardenHTLCModules, addresses?: Partial<Record<BlockchainType, string>>) => Promise<Err<string> | Ok<string>>;
|
|
57
|
+
/**
|
|
58
|
+
* Validates that HTLCs are available for the required blockchain types for swap initiation
|
|
59
|
+
* @param blockchainType The blockchain type to check
|
|
60
|
+
* @returns AsyncResult<void, string>
|
|
61
|
+
*/
|
|
62
|
+
export declare const validateHTLCForSwap: (blockchainType: BlockchainType, htlcs: GardenHTLCModules) => Promise<AsyncResult<void, string>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/core",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@coral-xyz/anchor": "^0.31.1",
|
|
31
|
-
"@gardenfi/orderbook": "
|
|
32
|
-
"@gardenfi/utils": "
|
|
31
|
+
"@gardenfi/orderbook": "workspace:*",
|
|
32
|
+
"@gardenfi/utils": "workspace:*",
|
|
33
33
|
"@mysten/signers": "^0.3.4",
|
|
34
34
|
"@mysten/sui": "^1.37.1",
|
|
35
35
|
"@mysten/wallet-standard": "^0.16.9",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"bip39": "^3.1.0",
|
|
40
40
|
"bitcoinjs-lib": "^6.1.5",
|
|
41
41
|
"ecpair": "^2.1.0",
|
|
42
|
+
"node-cache": "^5.1.2",
|
|
42
43
|
"starknet": "7.6.4",
|
|
43
44
|
"tiny-secp256k1": "^2.2.3",
|
|
44
45
|
"varuint-bitcoin": "^1.1.2",
|
|
@@ -52,4 +53,4 @@
|
|
|
52
53
|
"vitest": "^1.6.0"
|
|
53
54
|
},
|
|
54
55
|
"sideEffects": false
|
|
55
|
-
}
|
|
56
|
+
}
|