@gardenfi/core 3.0.7-beta.1 → 3.0.7
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-C8VlkDwe.cjs → ccip-D_7TxSBL.cjs} +1 -1
- package/dist/{ccip-jpK2iyjO.js → ccip-DuJNhB3j.js} +1 -1
- package/dist/{index-SDqBa2QJ.cjs → index-BPpJbLfH.cjs} +47 -47
- package/dist/{index-Bs4peea5.js → index-iviEKv0P.js} +5539 -5769
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/src/lib/constants.d.ts +0 -1
- package/dist/src/lib/garden/executor/executor.d.ts +0 -1
- package/dist/src/lib/garden/garden.d.ts +0 -1
- package/dist/src/lib/garden/garden.types.d.ts +0 -5
- package/dist/src/lib/utils.d.ts +2 -3
- package/package.json +2 -4
- package/dist/src/lib/tron/abi/tronHtlcABI.d.ts +0 -46
- package/dist/src/lib/tron/relayer/tronRelay.d.ts +0 -32
- package/dist/src/lib/tron/tronHTLC.types.d.ts +0 -28
- package/dist/src/lib/tron/utils.d.ts +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BPpJbLfH.cjs");exports.API=e.API;exports.BitcoinNetwork=e.BitcoinNetwork;exports.BitcoinProvider=e.BitcoinProvider;exports.BitcoinWallet=e.BitcoinWallet;exports.DEFAULT_AFFILIATE_ASSET=e.DEFAULT_AFFILIATE_ASSET;exports.EvmRelay=e.EvmRelay;exports.Garden=e.Garden;exports.Quote=e.Quote;exports.STARKNET_CONFIG=e.STARKNET_CONFIG;exports.SUI_CONFIG=e.SUI_CONFIG;exports.SecretManager=e.SecretManager;exports.SolanaHTLC=e.SolanaHTLC;exports.SolanaRelay=e.SolanaRelay;exports.SolanaRelayerAddress=e.SolanaRelayerAddress;exports.StarknetHTLC=e.StarknetHTLC;exports.StarknetRelay=e.StarknetRelay;exports.alpenTestnet=e.alpenTestnet;exports.botanixMainnet=e.botanixMainnet;exports.checkStarknetAlloance=e.checkAllowance;exports.checkStarknetAllowanceAndApprove=e.checkAllowanceAndApprove;exports.constructOrderPair=e.constructOrderPair;exports.evmToViemChainMap=e.evmToViemChainMap;exports.getChainNameFromChainId=e.getChainNameFromChainId;exports.hyperliquid=e.hyperliquid;exports.hyperliquidTestnet=e.hyperliquidTestnet;exports.isStarknetAllowanceSufficient=e.isAllowanceSufficient;exports.resolveApiConfig=e.resolveApiConfig;exports.solanaProgramAddress=e.solanaProgramAddress;exports.switchOrAddNetwork=e.switchOrAddNetwork;exports.toXOnly=e.toXOnly;exports.validateBTCAddress=e.validateBTCAddress;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as s, D as t, F as n, I as r, J as o, E as i, G as l, Q as A, L as d, M as c, m as S, k as T, j as k, N as C, h, S as p, A as m, u as y, p as I, n as v, q as F, w as N, x as u, y as w, z as E, o as O, r as L, O as R, C as f, t as g, v as B } from "./index-
|
|
1
|
+
import { K as s, D as t, F as n, I as r, J as o, E as i, G as l, Q as A, L as d, M as c, m as S, k as T, j as k, N as C, h, S as p, A as m, u as y, p as I, n as v, q as F, w as N, x as u, y as w, z as E, o as O, r as L, O as R, C as f, t as g, v as B } from "./index-iviEKv0P.js";
|
|
2
2
|
export {
|
|
3
3
|
s as API,
|
|
4
4
|
t as BitcoinNetwork,
|
|
@@ -37,7 +37,6 @@ export declare class Garden extends Orderbook implements IGardenJS {
|
|
|
37
37
|
readonly solana: import('../..').ISolanaHTLC | undefined;
|
|
38
38
|
readonly sui: import('../sui/suiHTLC.types').ISuiHTLC | undefined;
|
|
39
39
|
readonly bitcoin: import('../bitcoin/bitcoinhtlc.types').IBitcoinHTLC | undefined;
|
|
40
|
-
readonly tron: import('../tron/tronHTLC.types').ITronHTLC | undefined;
|
|
41
40
|
};
|
|
42
41
|
get quote(): IQuote;
|
|
43
42
|
get secretManager(): ISecretManager;
|
|
@@ -14,9 +14,6 @@ import { ISuiHTLC } from '../sui/suiHTLC.types';
|
|
|
14
14
|
import { WalletWithRequiredFeatures } from '@mysten/wallet-standard';
|
|
15
15
|
import { IBitcoinHTLC } from '../bitcoin/bitcoinhtlc.types';
|
|
16
16
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
17
|
-
import { ITronHTLC } from '../tron/tronHTLC.types';
|
|
18
|
-
import { Adapter } from '@tronweb3/tronwallet-abstract-adapter';
|
|
19
|
-
import { TronWeb } from 'tronweb';
|
|
20
17
|
|
|
21
18
|
export type SwapParams = {
|
|
22
19
|
/**
|
|
@@ -147,7 +144,6 @@ export type GardenHTLCModules = {
|
|
|
147
144
|
solana?: ISolanaHTLC;
|
|
148
145
|
sui?: ISuiHTLC;
|
|
149
146
|
bitcoin?: IBitcoinHTLC;
|
|
150
|
-
tron?: ITronHTLC;
|
|
151
147
|
};
|
|
152
148
|
export type GardenWalletModules = {
|
|
153
149
|
evm?: WalletClient;
|
|
@@ -155,7 +151,6 @@ export type GardenWalletModules = {
|
|
|
155
151
|
solana?: AnchorProvider;
|
|
156
152
|
sui?: WalletWithRequiredFeatures | Ed25519Keypair;
|
|
157
153
|
bitcoin?: IBitcoinWallet;
|
|
158
|
-
tron?: TronWeb | Adapter;
|
|
159
154
|
};
|
|
160
155
|
export type GardenConfigWithWallets = GardenCoreConfig & {
|
|
161
156
|
wallets?: GardenWalletModules;
|
package/dist/src/lib/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AsyncResult, Environment, Err, Ok, Url, Network
|
|
2
|
-
import { BlockchainType, Chain
|
|
1
|
+
import { AsyncResult, Environment, Err, Ok, Url, Network } from '@gardenfi/utils';
|
|
2
|
+
import { BlockchainType, Chain } from '@gardenfi/orderbook';
|
|
3
3
|
import { WalletClient } from 'viem';
|
|
4
4
|
import { Signature } from 'starknet';
|
|
5
5
|
import { Api } from './constants';
|
|
@@ -67,7 +67,6 @@ export declare const getAddresses: (blockchainType: BlockchainType, htlcs: Garde
|
|
|
67
67
|
* @returns AsyncResult<void, string>
|
|
68
68
|
*/
|
|
69
69
|
export declare const validateHTLCForSwap: (blockchainType: BlockchainType, htlcs: GardenHTLCModules) => Promise<AsyncResult<void, string>>;
|
|
70
|
-
export declare function redeemOrderThroughRelayer(order: Order, secret: string, auth: IAuth, url: Url): Promise<AsyncResult<string, string>>;
|
|
71
70
|
export declare const isAlreadyInitiatedError: (error: unknown) => boolean;
|
|
72
71
|
export declare const executeWithRelayerRetries: ({ attempt, wallet, maxAttempts, baseDelayMs, }: ExecuteWithRelayerRetriesArgs) => Promise<string | null>;
|
|
73
72
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/core",
|
|
3
|
-
"version": "3.0.7
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
@@ -28,13 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@coral-xyz/anchor": "^0.31.1",
|
|
31
|
-
"@gardenfi/orderbook": "3.0.5
|
|
31
|
+
"@gardenfi/orderbook": "3.0.5",
|
|
32
32
|
"@gardenfi/utils": "3.0.0",
|
|
33
33
|
"@mysten/signers": "^0.3.4",
|
|
34
34
|
"@mysten/sui": "^1.37.1",
|
|
35
35
|
"@mysten/wallet-standard": "^0.16.9",
|
|
36
36
|
"@solana/spl-token": "^0.4.13",
|
|
37
|
-
"@tronweb3/tronwallet-abstract-adapter": "^1.1.9",
|
|
38
37
|
"bignumber.js": "^9.1.2",
|
|
39
38
|
"bip32": "^4.0.0",
|
|
40
39
|
"bip39": "^3.1.0",
|
|
@@ -43,7 +42,6 @@
|
|
|
43
42
|
"node-cache": "^5.1.2",
|
|
44
43
|
"starknet": "7.6.4",
|
|
45
44
|
"tiny-secp256k1": "^2.2.3",
|
|
46
|
-
"tronweb": "^6.0.4",
|
|
47
45
|
"varuint-bitcoin": "^1.1.2",
|
|
48
46
|
"yup": "^1.4.0"
|
|
49
47
|
},
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export declare const tronHtlcAbi: ({
|
|
2
|
-
inputs: never[];
|
|
3
|
-
stateMutability: string;
|
|
4
|
-
type: string;
|
|
5
|
-
name?: undefined;
|
|
6
|
-
anonymous?: undefined;
|
|
7
|
-
outputs?: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
inputs: {
|
|
10
|
-
internalType: string;
|
|
11
|
-
name: string;
|
|
12
|
-
type: string;
|
|
13
|
-
}[];
|
|
14
|
-
name: string;
|
|
15
|
-
type: string;
|
|
16
|
-
stateMutability?: undefined;
|
|
17
|
-
anonymous?: undefined;
|
|
18
|
-
outputs?: undefined;
|
|
19
|
-
} | {
|
|
20
|
-
anonymous: boolean;
|
|
21
|
-
inputs: {
|
|
22
|
-
indexed: boolean;
|
|
23
|
-
internalType: string;
|
|
24
|
-
name: string;
|
|
25
|
-
type: string;
|
|
26
|
-
}[];
|
|
27
|
-
name: string;
|
|
28
|
-
type: string;
|
|
29
|
-
stateMutability?: undefined;
|
|
30
|
-
outputs?: undefined;
|
|
31
|
-
} | {
|
|
32
|
-
inputs: {
|
|
33
|
-
internalType: string;
|
|
34
|
-
name: string;
|
|
35
|
-
type: string;
|
|
36
|
-
}[];
|
|
37
|
-
name: string;
|
|
38
|
-
outputs: {
|
|
39
|
-
internalType: string;
|
|
40
|
-
name: string;
|
|
41
|
-
type: string;
|
|
42
|
-
}[];
|
|
43
|
-
stateMutability: string;
|
|
44
|
-
type: string;
|
|
45
|
-
anonymous?: undefined;
|
|
46
|
-
})[];
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Order, EvmOrderResponse } from '@gardenfi/orderbook';
|
|
2
|
-
import { AsyncResult, IAuth, Network, Url } from '@gardenfi/utils';
|
|
3
|
-
import { ITronHTLC } from '../tronHTLC.types';
|
|
4
|
-
import { TronWeb } from 'tronweb';
|
|
5
|
-
import { Adapter } from '@tronweb3/tronwallet-abstract-adapter';
|
|
6
|
-
|
|
7
|
-
export declare class TronRelay implements ITronHTLC {
|
|
8
|
-
private url;
|
|
9
|
-
private auth;
|
|
10
|
-
private tronweb;
|
|
11
|
-
private wallet;
|
|
12
|
-
private relayer;
|
|
13
|
-
constructor(relayerUrl: string | Url, network: Network, auth: IAuth, wallet: TronWeb | Adapter);
|
|
14
|
-
get htlcActorAddress(): string;
|
|
15
|
-
initiate(order: Order | EvmOrderResponse): AsyncResult<string, string>;
|
|
16
|
-
private initiateDirectContractCall;
|
|
17
|
-
private executeApprovalTransaction;
|
|
18
|
-
/**
|
|
19
|
-
* Unified method to execute contract calls with signing and broadcasting
|
|
20
|
-
*/
|
|
21
|
-
private executeContractCall;
|
|
22
|
-
/**
|
|
23
|
-
* Unified signing method
|
|
24
|
-
*/
|
|
25
|
-
private signTransaction;
|
|
26
|
-
/**
|
|
27
|
-
* Wait for transaction confirmation on-chain
|
|
28
|
-
*/
|
|
29
|
-
private waitForTransactionConfirmation;
|
|
30
|
-
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
31
|
-
refund(): AsyncResult<string, string>;
|
|
32
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Order, EvmOrderResponse } from '@gardenfi/orderbook';
|
|
2
|
-
import { AsyncResult } from '@gardenfi/utils';
|
|
3
|
-
|
|
4
|
-
export interface ITronHTLC {
|
|
5
|
-
/**
|
|
6
|
-
* The address of the HTLC actor.
|
|
7
|
-
*/
|
|
8
|
-
get htlcActorAddress(): string;
|
|
9
|
-
/**
|
|
10
|
-
* Initiates the HTLC by sending funds to the HTLC contract.
|
|
11
|
-
* @param order - The matched order.
|
|
12
|
-
* @returns A promise resolving to the transaction hash of the initiation.
|
|
13
|
-
*/
|
|
14
|
-
initiate(order: Order | EvmOrderResponse): AsyncResult<string, string>;
|
|
15
|
-
/**
|
|
16
|
-
* Redeems funds from the HTLC contract to the actor's address.
|
|
17
|
-
* @param order - The matched order.
|
|
18
|
-
* @param secret - The secret required to unlock the htlc.
|
|
19
|
-
* @returns A promise resolving to the transaction hash of the redemption.
|
|
20
|
-
*/
|
|
21
|
-
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
22
|
-
/**
|
|
23
|
-
* Refunds funds from the HTLC contract back to the actor's address upon expiration.
|
|
24
|
-
* @param order - The matched order.
|
|
25
|
-
* @returns A promise resolving to the transaction hash of the refund.
|
|
26
|
-
*/
|
|
27
|
-
refund(order: Order): AsyncResult<string, string>;
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toBytes32Hex(value: string): string;
|