@gardenfi/core 3.1.3-beta.2 → 3.1.3-beta.20
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-fFmTEKgV.js → ccip-Cok4USeJ.js} +1 -1
- package/dist/{ccip-CoK_g_s0.cjs → ccip-DkEfWv-9.cjs} +1 -1
- package/dist/index-BVbFl7I1.cjs +105 -0
- package/dist/{index-BgO5SheZ.js → index-Dpu0liry.js} +14962 -13156
- package/dist/index.cjs +1 -1
- package/dist/index.js +26 -23
- package/dist/src/index.d.ts +2 -2
- package/dist/src/lib/bitcoin/API.d.ts +1 -0
- package/dist/src/lib/evm/abi/coreWriter.d.ts +24 -0
- package/dist/src/lib/evm/relay/coreWrite.d.ts +9 -0
- package/dist/src/lib/evm/relay/evmRelay.d.ts +2 -2
- package/dist/src/lib/garden/garden.types.d.ts +5 -0
- package/dist/src/lib/quote/quote.types.d.ts +4 -0
- package/dist/src/lib/switchOrAddNetwork.d.ts +4 -1
- package/dist/src/lib/utils.d.ts +2 -0
- package/package.json +5 -3
- package/dist/index-CJMkaKG-.cjs +0 -104
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-BVbFl7I1.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.OrderCreationStatus=e.OrderCreationStatus;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.TRON_CONFIG=e.TRON_CONFIG;exports.XRPL_CONFIG=e.XRPL_CONFIG;exports.XrplRelay=e.XrplRelay;exports.alpenTestnet=e.alpenTestnet;exports.arcTestnet=e.arcTestnet;exports.botanixMainnet=e.botanixMainnet;exports.checkStarknetAlloance=e.checkAllowance;exports.checkStarknetAllowanceAndApprove=e.checkAllowanceAndApprove;exports.evmToViemChainMap=e.evmToViemChainMap;exports.getChainNameFromChainId=e.getChainNameFromChainId;exports.hyperevm=e.hyperevm;exports.hyperliquidTestnet=e.hyperliquidTestnet;exports.isStarknetAllowanceSufficient=e.isAllowanceSufficient;exports.megaethMainnet=e.megaethMainnet;exports.resolveApiConfig=e.resolveApiConfig;exports.solanaProgramAddress=e.solanaProgramAddress;exports.switchOrAddNetwork=e.switchOrAddNetwork;exports.toXOnly=e.toXOnly;exports.validateBTCAddress=e.validateBTCAddress;exports.validateLTCAddress=e.validateLTCAddress;exports.validateLightningAddress=e.validateLightningAddress;exports.validateSparkAddress=e.validateSparkAddress;
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as s, K as t, L as n, M as r, N as i, E as l, G as o, Y as d, Q as A, P as S, R as T, m as c, k as C, j as h, V as k, h as p, S as v, T as m, U as I, X as N, D as y, I as F, x as O, p as R, n as L, y as g, z as w, A as E, C as G, o as _, F as u, r as M, W as P, J as f, t as B, v as X, q as x, w as U, u as q } from "./index-Dpu0liry.js";
|
|
2
2
|
export {
|
|
3
3
|
s as API,
|
|
4
4
|
t as BitcoinNetwork,
|
|
5
5
|
n as BitcoinProvider,
|
|
6
6
|
r as BitcoinWallet,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
i as DEFAULT_AFFILIATE_ASSET,
|
|
8
|
+
l as EvmRelay,
|
|
9
|
+
o as Garden,
|
|
10
10
|
d as OrderCreationStatus,
|
|
11
11
|
A as Quote,
|
|
12
12
|
S as STARKNET_CONFIG,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
T as SUI_CONFIG,
|
|
14
|
+
c as SecretManager,
|
|
15
|
+
C as SolanaHTLC,
|
|
16
16
|
h as SolanaRelay,
|
|
17
17
|
k as SolanaRelayerAddress,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
p as StarknetHTLC,
|
|
19
|
+
v as StarknetRelay,
|
|
20
|
+
m as TRON_CONFIG,
|
|
21
|
+
I as XRPL_CONFIG,
|
|
22
|
+
N as XrplRelay,
|
|
23
23
|
y as alpenTestnet,
|
|
24
|
-
F as
|
|
25
|
-
O as
|
|
26
|
-
R as
|
|
27
|
-
L as
|
|
24
|
+
F as arcTestnet,
|
|
25
|
+
O as botanixMainnet,
|
|
26
|
+
R as checkStarknetAlloance,
|
|
27
|
+
L as checkStarknetAllowanceAndApprove,
|
|
28
|
+
g as evmToViemChainMap,
|
|
28
29
|
w as getChainNameFromChainId,
|
|
29
30
|
E as hyperevm,
|
|
30
31
|
G as hyperliquidTestnet,
|
|
31
32
|
_ as isStarknetAllowanceSufficient,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
u as megaethMainnet,
|
|
34
|
+
M as resolveApiConfig,
|
|
35
|
+
P as solanaProgramAddress,
|
|
36
|
+
f as switchOrAddNetwork,
|
|
37
|
+
B as toXOnly,
|
|
38
|
+
X as validateBTCAddress,
|
|
39
|
+
x as validateLTCAddress,
|
|
40
|
+
U as validateLightningAddress,
|
|
41
|
+
q as validateSparkAddress
|
|
39
42
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export type { ISecretManager, Secret, SecretManagerEvents, } from './lib/secretM
|
|
|
15
15
|
export { checkAllowanceAndApprove as checkStarknetAllowanceAndApprove, isAllowanceSufficient as isStarknetAllowanceSufficient, checkAllowance as checkStarknetAlloance, } from './lib/starknet/checkAllowanceAndApprove';
|
|
16
16
|
export { Quote } from './lib/quote/quote';
|
|
17
17
|
export type { StrategiesResponse, BaseQuoteParams, IQuote, QuoteOptions, QuoteParamsForAssets, QuoteParamsForOrderPair, QuoteResponse, Strategies, } from './lib/quote/quote.types';
|
|
18
|
-
export { validateBTCAddress, toXOnly, resolveApiConfig, validateLTCAddress, } from './lib/utils';
|
|
19
|
-
export { botanixMainnet, evmToViemChainMap, getChainNameFromChainId, hyperevm, hyperliquidTestnet, alpenTestnet, megaethMainnet, switchOrAddNetwork, } from './lib/switchOrAddNetwork';
|
|
18
|
+
export { validateBTCAddress, toXOnly, resolveApiConfig, validateLTCAddress, validateSparkAddress, validateLightningAddress, } from './lib/utils';
|
|
19
|
+
export { botanixMainnet, evmToViemChainMap, getChainNameFromChainId, hyperevm, hyperliquidTestnet, alpenTestnet, megaethMainnet, arcTestnet, switchOrAddNetwork, } from './lib/switchOrAddNetwork';
|
|
20
20
|
export { BitcoinNetwork } from './lib/bitcoin/provider/provider.interface';
|
|
21
21
|
export { BitcoinProvider } from './lib/bitcoin/provider/provider';
|
|
22
22
|
export { BitcoinWallet } from './lib/bitcoin/wallet/wallet';
|
|
@@ -4,3 +4,4 @@ export declare const verifyAPIs: (APIs: string[]) => string[];
|
|
|
4
4
|
export declare const getAPIs: (network: Network) => string[];
|
|
5
5
|
export declare const RPC_URLS_TESTNET: string[];
|
|
6
6
|
export declare const RPC_URLS_MAINNET: string[];
|
|
7
|
+
export declare const RPC_URLS_LOCALNET: string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const CoreWriterAbi: ({
|
|
2
|
+
anonymous: boolean;
|
|
3
|
+
inputs: {
|
|
4
|
+
indexed: boolean;
|
|
5
|
+
internalType: string;
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}[];
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
outputs?: undefined;
|
|
12
|
+
stateMutability?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
inputs: {
|
|
15
|
+
internalType: string;
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}[];
|
|
19
|
+
name: string;
|
|
20
|
+
outputs: never[];
|
|
21
|
+
stateMutability: string;
|
|
22
|
+
type: string;
|
|
23
|
+
anonymous?: undefined;
|
|
24
|
+
})[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WalletClient } from 'viem';
|
|
2
|
+
import { AsyncResult } from '@gardenfi/utils';
|
|
3
|
+
|
|
4
|
+
export declare const executeHyperCoreToEvmBridge: (wallet: WalletClient, bridgeTx: {
|
|
5
|
+
to: string;
|
|
6
|
+
value: string;
|
|
7
|
+
data: string;
|
|
8
|
+
gas_limit: string;
|
|
9
|
+
}) => AsyncResult<string, string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncResult, IAuth, Url } from '@gardenfi/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { EvmOrderResponseWithCoreTransfer, Order } from '@gardenfi/orderbook';
|
|
3
3
|
import { WalletClient } from 'viem';
|
|
4
4
|
|
|
5
5
|
export declare class EvmRelay {
|
|
@@ -9,7 +9,7 @@ export declare class EvmRelay {
|
|
|
9
9
|
private relayer;
|
|
10
10
|
constructor(url: string | Url, wallet: WalletClient, auth: IAuth);
|
|
11
11
|
get htlcActorAddress(): `0x${string}`;
|
|
12
|
-
initiate(order: Order |
|
|
12
|
+
initiate(order: Order | EvmOrderResponseWithCoreTransfer): AsyncResult<string, string>;
|
|
13
13
|
private initiateFromAPI;
|
|
14
14
|
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
15
15
|
refund(): AsyncResult<string, string>;
|
|
@@ -42,6 +42,10 @@ export type SwapParams = {
|
|
|
42
42
|
* Solver ID for the order.
|
|
43
43
|
*/
|
|
44
44
|
solverId: string;
|
|
45
|
+
/**
|
|
46
|
+
* Quote ID from the solver quote. Present when a v2 solver quotes the order.
|
|
47
|
+
*/
|
|
48
|
+
quoteId?: string;
|
|
45
49
|
/**
|
|
46
50
|
* Slippage for the order.
|
|
47
51
|
*/
|
|
@@ -149,6 +153,7 @@ export type GardenHTLCModules = {
|
|
|
149
153
|
litecoin?: IBitcoinHTLC;
|
|
150
154
|
alpen_signet?: IBitcoinHTLC;
|
|
151
155
|
spark?: IBitcoinHTLC;
|
|
156
|
+
lightning?: IBitcoinHTLC;
|
|
152
157
|
};
|
|
153
158
|
export type GardenWalletModules = {
|
|
154
159
|
evm?: WalletClient;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Chain as viemChain } from 'viem/chains';
|
|
1
|
+
import { arcTestnet, Chain as viemChain } from 'viem/chains';
|
|
2
2
|
import { EVMChains } from '@gardenfi/orderbook';
|
|
3
3
|
import { WalletClient } from 'viem';
|
|
4
4
|
import { AsyncResult } from '@gardenfi/utils';
|
|
5
5
|
|
|
6
|
+
export { arcTestnet };
|
|
6
7
|
export declare const botanixMainnet: viemChain;
|
|
8
|
+
export declare const robinhoodTestnet: viemChain;
|
|
9
|
+
export declare const robinhood: viemChain;
|
|
7
10
|
export declare const hyperliquidTestnet: viemChain;
|
|
8
11
|
export declare const hyperevm: viemChain;
|
|
9
12
|
export declare const alpenTestnet: viemChain;
|
package/dist/src/lib/utils.d.ts
CHANGED
|
@@ -35,7 +35,9 @@ export declare function sortLeaves(leaf1: Buffer, leaf2: Buffer): Buffer<ArrayBu
|
|
|
35
35
|
export declare const toXOnly: (pubKey: string) => string;
|
|
36
36
|
export declare const isValidBitcoinPubKey: (pubKey: string) => boolean;
|
|
37
37
|
export declare function validateBTCAddress(address: string, networkType: Environment): boolean;
|
|
38
|
+
export declare function validateSparkAddress(address: string, networkType: Environment): boolean;
|
|
38
39
|
export declare function validateLTCAddress(address: string, networkType: Environment): boolean;
|
|
40
|
+
export declare function validateLightningAddress(address: string, networkType: Environment): boolean;
|
|
39
41
|
export declare function generateOutputs(output: Buffer, count: number): Buffer[];
|
|
40
42
|
export declare const getBitcoinNetworkFromEnvironment: (network: Network) => BitcoinNetwork;
|
|
41
43
|
export declare const getBitcoinNetworkFromNetwork: (network: Network) => bitcoin.networks.Network;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/core",
|
|
3
|
-
"version": "3.1.3-beta.
|
|
3
|
+
"version": "3.1.3-beta.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
"registry": "https://registry.npmjs.org/"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@buildonspark/spark-sdk": "^0.6.3",
|
|
30
31
|
"@coral-xyz/anchor": "^0.31.1",
|
|
31
32
|
"@crossmarkio/sdk": "^0.4.0",
|
|
32
|
-
"@gardenfi/orderbook": "3.1.3-beta.
|
|
33
|
-
"@gardenfi/utils": "3.1.1",
|
|
33
|
+
"@gardenfi/orderbook": "3.1.3-beta.20",
|
|
34
|
+
"@gardenfi/utils": "3.1.1-beta.18",
|
|
34
35
|
"@mysten/signers": "^0.3.4",
|
|
35
36
|
"@mysten/sui": "^1.37.1",
|
|
36
37
|
"@mysten/wallet-standard": "^0.16.9",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"bip39": "^3.1.0",
|
|
42
43
|
"bitcoinjs-lib": "^6.1.5",
|
|
43
44
|
"bitcore-lib-ltc": "^10.10.5",
|
|
45
|
+
"bech32": "^2.0.0",
|
|
44
46
|
"ecpair": "^2.1.0",
|
|
45
47
|
"node-cache": "^5.1.2",
|
|
46
48
|
"starknet": "8.0.0",
|