@gardenfi/core 2.5.3 → 3.0.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-DGrkijK3.cjs} +1 -1
- package/dist/{ccip-Bg3f6Dwh.js → ccip-DoKK2Eev.js} +1 -1
- package/dist/index-BB1moYTm.cjs +106 -0
- package/dist/index-dcGJN5tW.js +33698 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +32 -39
- package/dist/src/index.d.ts +7 -12
- package/dist/src/lib/bitcoin/API.d.ts +3 -1
- package/dist/src/lib/bitcoin/bitcoinHtlc.d.ts +98 -0
- package/dist/src/lib/bitcoin/bitcoinhtlc.types.d.ts +53 -0
- package/dist/src/lib/bitcoin/provider/provider.d.ts +2 -1
- package/dist/src/lib/bitcoin/wallet/abstractWallet.d.ts +1 -1
- package/dist/src/lib/bitcoin/wallet/wallet.d.ts +1 -1
- package/dist/src/lib/bitcoin/wallet/wallet.interface.d.ts +1 -1
- package/dist/src/lib/constants.d.ts +4 -9
- package/dist/src/lib/evm/htlc/evmHTLC.d.ts +102 -102
- package/dist/src/lib/evm/htlc.types.d.ts +4 -4
- package/dist/src/lib/evm/relay/evmRelay.d.ts +9 -11
- package/dist/src/lib/evm/relay/htlcInitiate.d.ts +25 -0
- package/dist/src/lib/garden/cache/GardenCache.d.ts +45 -0
- package/dist/src/lib/garden/executor/executor.d.ts +26 -0
- package/dist/src/lib/garden/garden.d.ts +43 -52
- package/dist/src/lib/garden/garden.types.d.ts +70 -103
- package/dist/src/lib/garden/utils.d.ts +4 -0
- package/dist/src/lib/quote/quote.d.ts +8 -7
- package/dist/src/lib/quote/quote.types.d.ts +21 -13
- package/dist/src/lib/relayer/relayer.d.ts +9 -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 +28 -35
- package/dist/src/lib/solana/solanaTypes.d.ts +6 -6
- package/dist/src/lib/starknet/htlc/starknetHTLC.d.ts +4 -4
- package/dist/src/lib/starknet/relay/starknetRelay.d.ts +9 -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 +8 -5
- package/dist/src/lib/sui/suiHTLC.types.d.ts +4 -4
- package/dist/src/lib/switchOrAddNetwork.d.ts +5 -3
- package/dist/src/lib/utils.d.ts +38 -6
- package/package.json +4 -3
- 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/blockNumberFetcher/blockNumber.d.ts +0 -15
- package/dist/src/lib/evm/relay/evmRelay.types.d.ts +0 -26
- package/dist/src/lib/garden/cache/executorCache.d.ts +0 -14
- package/dist/src/lib/orderStatus/orderStatusParser.d.ts +0 -37
- package/dist/src/lib/orderStatus/status.d.ts +0 -130
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-BB1moYTm.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,41 +1,34 @@
|
|
|
1
|
-
import {
|
|
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-dcGJN5tW.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
m as
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
E as
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
q as parseAction,
|
|
35
|
-
G as parseActionFromStatus,
|
|
36
|
-
I as resolveApiConfig,
|
|
37
|
-
L as solanaProgramAddress,
|
|
38
|
-
M as switchOrAddNetwork,
|
|
39
|
-
b as toXOnly,
|
|
40
|
-
D as validateBTCAddress
|
|
3
|
+
s as API,
|
|
4
|
+
t as BitcoinNetwork,
|
|
5
|
+
n as BitcoinProvider,
|
|
6
|
+
r as BitcoinWallet,
|
|
7
|
+
o as DEFAULT_AFFILIATE_ASSET,
|
|
8
|
+
i as EvmRelay,
|
|
9
|
+
l as Garden,
|
|
10
|
+
A as Quote,
|
|
11
|
+
d as STARKNET_CONFIG,
|
|
12
|
+
c as SUI_CONFIG,
|
|
13
|
+
S as SecretManager,
|
|
14
|
+
T as SolanaHTLC,
|
|
15
|
+
k as SolanaRelay,
|
|
16
|
+
C as SolanaRelayerAddress,
|
|
17
|
+
h as StarknetHTLC,
|
|
18
|
+
p as StarknetRelay,
|
|
19
|
+
m as alpenTestnet,
|
|
20
|
+
y as botanixMainnet,
|
|
21
|
+
I as checkStarknetAlloance,
|
|
22
|
+
v as checkStarknetAllowanceAndApprove,
|
|
23
|
+
F as constructOrderPair,
|
|
24
|
+
N as evmToViemChainMap,
|
|
25
|
+
u as getChainNameFromChainId,
|
|
26
|
+
w as hyperliquid,
|
|
27
|
+
E as hyperliquidTestnet,
|
|
28
|
+
O as isStarknetAllowanceSufficient,
|
|
29
|
+
L as resolveApiConfig,
|
|
30
|
+
R as solanaProgramAddress,
|
|
31
|
+
f as switchOrAddNetwork,
|
|
32
|
+
g as toXOnly,
|
|
33
|
+
B as validateBTCAddress
|
|
41
34
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export { Garden } from './lib/garden/garden';
|
|
2
|
-
export type { IGardenJS, SwapParams, GardenEvents, IOrderExecutorCache, OrderCacheValue, EventCallback, OrderWithStatus, GardenCoreConfig, GardenWalletModules, GardenHTLCModules, GardenConfigWithWallets, GardenConfigWithHTLCs, } from './lib/garden/garden.types';
|
|
3
|
-
export { OrderActions } from './lib/garden/garden.types';
|
|
2
|
+
export type { IGardenJS, SwapParams, GardenEvents, IOrderExecutorCache, OrderCacheValue, EventCallback, OrderWithStatus, GardenCoreConfig, GardenWalletModules, GardenHTLCModules, GardenConfigWithWallets, GardenConfigWithHTLCs, ApiConfig, } from './lib/garden/garden.types';
|
|
4
3
|
export { EvmRelay } from './lib/evm/relay/evmRelay';
|
|
5
|
-
export type { IEVMRelay } from './lib/evm/relay/evmRelay.types';
|
|
6
4
|
export type { IEVMHTLC } from './lib/evm/htlc.types';
|
|
7
5
|
export { StarknetRelay } from './lib/starknet/relay/starknetRelay';
|
|
8
6
|
export type { IStarknetHTLC } from './lib/starknet/starknetHTLC.types';
|
|
@@ -10,19 +8,16 @@ export { StarknetHTLC } from './lib/starknet/htlc/starknetHTLC';
|
|
|
10
8
|
export { SolanaRelay } from './lib/solana/relayer/solanaRelay';
|
|
11
9
|
export type { ISolanaHTLC } from './lib/solana/htlc/ISolanaHTLC';
|
|
12
10
|
export { SolanaHTLC } from './lib/solana/htlc/solanaHTLC';
|
|
13
|
-
export { BlockNumberFetcher } from './lib/blockNumberFetcher/blockNumber';
|
|
14
|
-
export type { IBlockNumberFetcher } from './lib/blockNumberFetcher/blockNumber';
|
|
15
|
-
export { OrderStatus, SwapStatus } from './lib/orderStatus/status';
|
|
16
|
-
export { parseAction, ParseOrderStatus, ParseSwapStatus, isExpired, isOrderExpired, filterDeadlineExpiredOrders, parseActionFromStatus, } from './lib/orderStatus/orderStatusParser';
|
|
17
11
|
export { SecretManager } from './lib/secretManager/secretManager';
|
|
18
|
-
export type { ISecretManager, Secret, } from './lib/secretManager/secretManager.types';
|
|
12
|
+
export type { ISecretManager, Secret, SecretManagerEvents, } from './lib/secretManager/secretManager.types';
|
|
19
13
|
export { checkAllowanceAndApprove as checkStarknetAllowanceAndApprove, isAllowanceSufficient as isStarknetAllowanceSufficient, checkAllowance as checkStarknetAlloance, } from './lib/starknet/checkAllowanceAndApprove';
|
|
20
14
|
export { Quote } from './lib/quote/quote';
|
|
21
|
-
export type {
|
|
15
|
+
export type { StrategiesResponse, BaseQuoteParams, IQuote, QuoteOptions, QuoteParamsForAssets, QuoteParamsForOrderPair, QuoteResponse, Strategies, } from './lib/quote/quote.types';
|
|
22
16
|
export { constructOrderPair, validateBTCAddress, toXOnly, resolveApiConfig, } from './lib/utils';
|
|
23
|
-
export {
|
|
17
|
+
export { botanixMainnet, evmToViemChainMap, getChainNameFromChainId, hyperliquid, hyperliquidTestnet, alpenTestnet, switchOrAddNetwork, } from './lib/switchOrAddNetwork';
|
|
24
18
|
export { BitcoinNetwork } from './lib/bitcoin/provider/provider.interface';
|
|
25
19
|
export { BitcoinProvider } from './lib/bitcoin/provider/provider';
|
|
26
20
|
export { BitcoinWallet } from './lib/bitcoin/wallet/wallet';
|
|
27
|
-
export type { IBitcoinProvider } from './lib/bitcoin/provider/provider.interface';
|
|
28
|
-
export { API, STARKNET_CONFIG, SolanaRelayerAddress, solanaProgramAddress, } from './lib/constants';
|
|
21
|
+
export type { UrgencyToFeeRateKey, Urgency, IBitcoinProvider, FeeRates, BitcoinTxType, BitcoinTx, BitcoinUTXO, FeeRateKeys, } from './lib/bitcoin/provider/provider.interface';
|
|
22
|
+
export { DEFAULT_AFFILIATE_ASSET, API, STARKNET_CONFIG, SUI_CONFIG, SolanaRelayerAddress, solanaProgramAddress, } from './lib/constants';
|
|
23
|
+
export type { Api } from './lib/constants';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Network } from '@gardenfi/utils';
|
|
2
|
+
|
|
1
3
|
export declare const verifyAPIs: (APIs: string[]) => string[];
|
|
2
|
-
export declare const getAPIs: (network:
|
|
4
|
+
export declare const getAPIs: (network: Network) => string[];
|
|
3
5
|
export declare const RPC_URLS_TESTNET: string[];
|
|
4
6
|
export declare const RPC_URLS_MAINNET: string[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { IBitcoinProvider } from './provider/provider.interface';
|
|
2
|
+
import { IBitcoinWallet } from './wallet/wallet.interface';
|
|
3
|
+
import { IBitcoinHTLC } from './bitcoinhtlc.types';
|
|
4
|
+
import { BitcoinOrderResponse, Order } from '@gardenfi/orderbook';
|
|
5
|
+
import { AsyncResult, Network } from '@gardenfi/utils';
|
|
6
|
+
|
|
7
|
+
export declare enum Leaf {
|
|
8
|
+
REFUND = 0,
|
|
9
|
+
REDEEM = 1,
|
|
10
|
+
INSTANT_REFUND = 2
|
|
11
|
+
}
|
|
12
|
+
export type TxType = 'redeem' | 'refund' | 'instantRefund';
|
|
13
|
+
export type LeafScript = {
|
|
14
|
+
version: number;
|
|
15
|
+
output: Buffer;
|
|
16
|
+
};
|
|
17
|
+
export type LeafTree = LeafScript | [LeafScript, LeafScript];
|
|
18
|
+
export declare class BitcoinHTLC implements IBitcoinHTLC {
|
|
19
|
+
/**
|
|
20
|
+
* Signer of the HTLC can be either the initiator or the redeemer
|
|
21
|
+
*/
|
|
22
|
+
private signer;
|
|
23
|
+
private internalPubkey;
|
|
24
|
+
private network;
|
|
25
|
+
/**
|
|
26
|
+
* Note: redeemerAddress and initiatorAddress should be x-only public key without 02 or 03 prefix
|
|
27
|
+
*/
|
|
28
|
+
constructor(signer: IBitcoinWallet, network: Network);
|
|
29
|
+
/**
|
|
30
|
+
* Generates a taproot address for receiving the funds
|
|
31
|
+
* @param order The order object
|
|
32
|
+
* @param type The type of address to generate ('redeem' | 'refund' | 'instantRefund')
|
|
33
|
+
* - 'redeem': uses destination_swap parameters (default)
|
|
34
|
+
* - 'refund': uses source_swap parameters
|
|
35
|
+
* - 'instantRefund': uses source_swap parameters with redeemer
|
|
36
|
+
*/
|
|
37
|
+
address(order: Order, type: TxType): string;
|
|
38
|
+
private _buildRawTx;
|
|
39
|
+
/**
|
|
40
|
+
* prevout script for the BitcoinHTLC address
|
|
41
|
+
*/
|
|
42
|
+
private getOutputScript;
|
|
43
|
+
initiate(order: Order | BitcoinOrderResponse, fee?: number): AsyncResult<string, string>;
|
|
44
|
+
generateRedeemSACP(order: Order, secret: string, fee?: number): Promise<string>;
|
|
45
|
+
generateInstantRefundSACP(order: Order): Promise<string>;
|
|
46
|
+
generateInstantRefundSACPWithHash(hash: string[]): AsyncResult<string[], string>;
|
|
47
|
+
/**
|
|
48
|
+
* Instantly refunds the funds to the initiator given the counterparty's signatures and pubkey
|
|
49
|
+
*
|
|
50
|
+
* Note: If there are multiple UTXOs being spend, there should be a signature for each UTXO in counterPartySigs
|
|
51
|
+
*/
|
|
52
|
+
instantRefund(order: Order, counterPartySigs: {
|
|
53
|
+
utxo: string;
|
|
54
|
+
sig: string;
|
|
55
|
+
}[], fee?: number): Promise<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Reveals the secret and redeems the HTLC
|
|
58
|
+
*/
|
|
59
|
+
redeem(order: Order, secret: string, utxoHashes?: string[]): AsyncResult<string, string>;
|
|
60
|
+
getRedeemHex(order: Order, secret: string, utxoHashes?: string[]): AsyncResult<string, string>;
|
|
61
|
+
/**
|
|
62
|
+
* Refunds the funds back to the initiator if the expiry block height + 1 is reached
|
|
63
|
+
*/
|
|
64
|
+
refund(order: Order, fee?: number): AsyncResult<string, string>;
|
|
65
|
+
/**
|
|
66
|
+
* Given a list of UTXOs, checks if the HTLC can be refunded
|
|
67
|
+
*/
|
|
68
|
+
private canRefund;
|
|
69
|
+
/**
|
|
70
|
+
* Given a leaf, generates the control block necessary for spending the leaf
|
|
71
|
+
*/
|
|
72
|
+
private generateControlBlockFor;
|
|
73
|
+
/**
|
|
74
|
+
* Generates the hash of the leaf script
|
|
75
|
+
* @param leaf Use leaf enum or pass 0 for refund, 1 for redeem, 2 for instant refund
|
|
76
|
+
* @returns hash of the leaf script
|
|
77
|
+
*/
|
|
78
|
+
leafHash(leaf: Leaf, order: Order): Buffer;
|
|
79
|
+
private refundLeaf;
|
|
80
|
+
private redeemLeaf;
|
|
81
|
+
private instantRefundLeaf;
|
|
82
|
+
/**
|
|
83
|
+
* Generates leaves for a given action type (redeem, refund, instant refund)
|
|
84
|
+
* @param order The order object
|
|
85
|
+
* @param type 'redeem' | 'refund' | 'instantRefund'
|
|
86
|
+
* - 'redeem': uses destination_swap for all params
|
|
87
|
+
* - 'refund': uses source_swap for all params
|
|
88
|
+
* - 'instantRefund': uses source_swap, but redeem/instantRefund use .redeemer
|
|
89
|
+
*/
|
|
90
|
+
private generateLeaves;
|
|
91
|
+
/**
|
|
92
|
+
* Generates the merkle proof for the leaf script
|
|
93
|
+
*/
|
|
94
|
+
private generateMerkleProofFor;
|
|
95
|
+
getProvider(): Promise<IBitcoinProvider>;
|
|
96
|
+
get getPublicKey(): string;
|
|
97
|
+
get htlcActorAddress(): string;
|
|
98
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BitcoinOrderResponse, Order } from '@gardenfi/orderbook';
|
|
2
|
+
import { AsyncResult } from '@gardenfi/utils';
|
|
3
|
+
import { IBitcoinProvider } from './provider/provider.interface';
|
|
4
|
+
|
|
5
|
+
export interface IBitcoinHTLC {
|
|
6
|
+
/**
|
|
7
|
+
* Initiates the HTLC by sending funds to the HTLC contract.
|
|
8
|
+
* @param order - The matched order.
|
|
9
|
+
* @returns A promise resolving to the transaction hash of the initiation.
|
|
10
|
+
*/
|
|
11
|
+
initiate(order: Order | BitcoinOrderResponse, fee?: number): AsyncResult<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Redeems funds from the HTLC contract to the actor's address.
|
|
14
|
+
* @param order - The matched order.
|
|
15
|
+
* @param secret - The secret required to unlock the htlc.
|
|
16
|
+
* @returns A promise resolving to the transaction hash of the redemption.
|
|
17
|
+
*/
|
|
18
|
+
redeem(order: Order, secret: string): AsyncResult<string, string>;
|
|
19
|
+
/**
|
|
20
|
+
* Refunds funds from the HTLC contract back to the actor's address upon expiration.
|
|
21
|
+
* @param order - The matched order.
|
|
22
|
+
* @returns A promise resolving to the transaction hash of the refund.
|
|
23
|
+
*/
|
|
24
|
+
refund(order: Order): AsyncResult<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Generates the instant refund SACP with the hash of the refund transaction.
|
|
27
|
+
* @param hash - The hash of the refund transaction.
|
|
28
|
+
* @returns A promise resolving to the SACP.
|
|
29
|
+
*/
|
|
30
|
+
generateInstantRefundSACPWithHash(hash: string[]): AsyncResult<string[], string>;
|
|
31
|
+
/**
|
|
32
|
+
* Generates the redeem SACP with the secret.
|
|
33
|
+
* @param order - The matched order.
|
|
34
|
+
* @param secret - The secret required to unlock the htlc.
|
|
35
|
+
* @returns A promise resolving to the SACP.
|
|
36
|
+
*/
|
|
37
|
+
getRedeemHex(order: Order, secret: string, utxoHashes?: string[]): AsyncResult<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the provider of the wallet.
|
|
40
|
+
* @returns A promise resolving to the provider.
|
|
41
|
+
*/
|
|
42
|
+
getProvider(): Promise<IBitcoinProvider>;
|
|
43
|
+
/**
|
|
44
|
+
* Gets the public key of the wallet.
|
|
45
|
+
* @returns A promise resolving to the public key.
|
|
46
|
+
*/
|
|
47
|
+
get getPublicKey(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the HTLC actor address.
|
|
50
|
+
* This is the user's wallet address in the case of EVM.
|
|
51
|
+
*/
|
|
52
|
+
get htlcActorAddress(): string;
|
|
53
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Network } from '@gardenfi/utils';
|
|
1
2
|
import { BitcoinNetwork, BitcoinTx, BitcoinTxType, BitcoinUTXO, FeeRates, IBitcoinProvider, Urgency } from './provider.interface';
|
|
2
3
|
|
|
3
4
|
export declare class BitcoinProvider implements IBitcoinProvider {
|
|
@@ -5,7 +6,7 @@ export declare class BitcoinProvider implements IBitcoinProvider {
|
|
|
5
6
|
private readonly APIs;
|
|
6
7
|
private cacheTimeout;
|
|
7
8
|
private readonly utxosCache;
|
|
8
|
-
constructor(network:
|
|
9
|
+
constructor(network: Network, API?: string);
|
|
9
10
|
/**
|
|
10
11
|
* Gets the output index of the UTXO
|
|
11
12
|
*
|
|
@@ -11,7 +11,7 @@ export declare abstract class AbstractBitcoinWallet implements IBitcoinWallet {
|
|
|
11
11
|
abstract getAddress(): Promise<string>;
|
|
12
12
|
abstract getBalance(): Promise<number>;
|
|
13
13
|
abstract sign(hexString: string): Promise<string>;
|
|
14
|
-
abstract getPublicKey():
|
|
14
|
+
abstract getPublicKey(): string;
|
|
15
15
|
abstract getNetwork(): Promise<Network>;
|
|
16
16
|
abstract getProvider(): Promise<IBitcoinProvider>;
|
|
17
17
|
abstract send(toAddress: string, amt: number, fee?: number): Promise<string>;
|
|
@@ -90,7 +90,7 @@ export declare class BitcoinWallet extends AbstractBitcoinWallet {
|
|
|
90
90
|
getAddress(): Promise<string>;
|
|
91
91
|
getProvider(): Promise<IBitcoinProvider>;
|
|
92
92
|
getBalance(): Promise<number>;
|
|
93
|
-
getPublicKey():
|
|
93
|
+
getPublicKey(): string;
|
|
94
94
|
getNetwork(): Promise<networks.Network>;
|
|
95
95
|
static generateUnsignedPSBT(provider: IBitcoinProvider, network: networks.Network, fromAddress: string, toAddress: string, amt: number, fee?: number): Promise<{
|
|
96
96
|
txHex: string;
|
|
@@ -14,7 +14,7 @@ export interface IBitcoinWallet extends IBaseWallet {
|
|
|
14
14
|
/**
|
|
15
15
|
* @returns {Promise<string>} Public key of the wallet
|
|
16
16
|
*/
|
|
17
|
-
getPublicKey():
|
|
17
|
+
getPublicKey(): string;
|
|
18
18
|
/**
|
|
19
19
|
* @returns {Promise<Network>} Network of the wallet provided during initialization
|
|
20
20
|
*/
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import { ChainAsset } from '@gardenfi/orderbook';
|
|
1
2
|
import { Environment, Network } from '@gardenfi/utils';
|
|
2
3
|
|
|
3
4
|
export type Api = {
|
|
4
|
-
|
|
5
|
+
baseurl: string;
|
|
5
6
|
auth: string;
|
|
6
|
-
|
|
7
|
-
info: string;
|
|
8
|
-
evmRelay: string;
|
|
9
|
-
starknetRelay: string;
|
|
10
|
-
solanaRelay: string;
|
|
11
|
-
suiRelay: string;
|
|
7
|
+
relayer: string;
|
|
12
8
|
};
|
|
13
9
|
export declare const API: Record<Environment, Api>;
|
|
14
10
|
export declare const STARKNET_CONFIG: Record<Network, {
|
|
@@ -31,6 +27,5 @@ export declare const SUI_CONFIG: Record<Network, {
|
|
|
31
27
|
moduleName: string;
|
|
32
28
|
}>;
|
|
33
29
|
export declare const DEFAULT_AFFILIATE_ASSET: {
|
|
34
|
-
|
|
35
|
-
asset: "0xeae7721d779276eb0f5837e2fe260118724a2ba4";
|
|
30
|
+
asset: ChainAsset;
|
|
36
31
|
};
|