@omnisat/lasereyes 0.0.11 → 0.0.13

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/index.d.ts CHANGED
@@ -7,17 +7,25 @@ declare const UNISAT_MAINNET = "livenet";
7
7
  declare const UNISAT_TESTNET = "testnet";
8
8
  declare const XVERSE_MAINNET = "Mainnet";
9
9
  declare const XVERSE_TESTNET = "Testnet";
10
+ declare const OKX_MAINNET = "livenet";
11
+ declare const OKX_TESTNET = "testnet";
12
+ declare const WIZZ_MAINNET = "livenet";
13
+ declare const WIZZ_TESTNET = "testnet";
10
14
  declare const LEATHER_MAINNET = "mainnet";
11
15
  declare const LEATHER_TESTNET = "testnet";
12
16
  declare const MAINNET = "mainnet";
17
+ declare const SIGNET = "signet";
13
18
  declare const TESTNET = "testnet";
14
19
  declare const REGTEST = "regtest";
15
20
  declare const getXverseNetwork: (network: string) => "Mainnet" | "Testnet";
16
21
  declare const getLeatherNetwork: (network: string) => "testnet" | "mainnet";
17
22
  declare const getUnisatNetwork: (network: string) => "livenet" | "testnet";
23
+ declare const getWizzNetwork: (network: string) => "livenet" | "testnet";
18
24
  declare const getNetworkForUnisat: (network: string) => "testnet" | "mainnet";
19
25
  declare const getNetworkForXverse: (network: string) => "testnet" | "mainnet";
20
26
  declare const getNetworkForLeather: (network: string) => "testnet" | "mainnet";
27
+ declare const getNetworkForOkx: (network: string) => "testnet" | "mainnet";
28
+ declare const getNetworkForWizz: (network: string) => "testnet" | "mainnet";
21
29
  declare const MEMPOOL_SPACE_URL = "https://mempool.space";
22
30
  declare const MEMPOOL_SPACE_TESTNET_URL = "https://mempool.space/testnet";
23
31
  declare const getMempoolSpaceUrl: (network: string) => "https://mempool.space" | "https://mempool.space/testnet";
@@ -27,6 +35,9 @@ declare const UNISAT = "unisat";
27
35
  declare const XVERSE = "xverse";
28
36
  declare const PHANTOM = "phantom";
29
37
  declare const LEATHER = "leather";
38
+ declare const MAGIC_EDEN = "magic-eden";
39
+ declare const OKX = "okx";
40
+ declare const WIZZ = "wizz";
30
41
  declare const P2TR = "p2tr";
31
42
  declare const P2PKH = "p2pkh";
32
43
  declare const P2WPKH = "p2wpkh";
@@ -76,7 +87,13 @@ type LaserEyesContextType = {
76
87
  accounts: string[];
77
88
  hasUnisat: boolean;
78
89
  hasXverse: boolean;
79
- connect: (walletName: typeof UNISAT | typeof XVERSE) => Promise<void>;
90
+ hasOyl: boolean;
91
+ hasMagicEden: boolean;
92
+ hasOkx: boolean;
93
+ hasLeather: boolean;
94
+ hasPhantom: boolean;
95
+ hasWizz: boolean;
96
+ connect: (walletName: typeof UNISAT | typeof XVERSE | typeof MAGIC_EDEN) => Promise<void>;
80
97
  disconnect: () => void;
81
98
  requestAccounts: () => Promise<string[]>;
82
99
  getNetwork: () => Promise<string | undefined>;
@@ -96,6 +113,16 @@ type LaserEyesContextType = {
96
113
  type Config = {
97
114
  network: typeof MAINNET | typeof TESTNET | typeof REGTEST;
98
115
  };
116
+ interface BlockchainInfoUTXO {
117
+ tx_hash_big_endian: string;
118
+ tx_hash: string;
119
+ tx_output_n: number;
120
+ script: string;
121
+ value: number;
122
+ value_hex: string;
123
+ confirmations: number;
124
+ tx_index: number;
125
+ }
99
126
 
100
127
  declare const createConfig: (config: Config) => Config;
101
128
 
@@ -109,9 +136,16 @@ declare const getBitcoinNetwork: (network: typeof MAINNET | typeof TESTNET | typ
109
136
  declare const findOrdinalsAddress: (addresses: any) => any;
110
137
  declare const findPaymentAddress: (addresses: any) => any;
111
138
  declare const getBTCBalance: (address: string) => Promise<number>;
139
+ declare const getAddressUtxos: (address: string) => Promise<BlockchainInfoUTXO[]>;
112
140
  declare const satoshisToBTC: (satoshis: number) => string;
113
141
  declare const isBase64: (str: string) => boolean;
114
142
  declare const isHex: (str: string) => boolean;
115
143
  declare function getAddressType(address: string): "p2tr" | "p2pkh" | "p2wpkh" | "p2psh" | "p2wsh";
144
+ declare function estimateTxSize(taprootInputCount: number, nonTaprootInputCount: number, outputCount: number): number;
145
+ declare function createSendBtcPsbt(address: string, paymentAddress: string, recipientAddress: string, amount: number, paymentPublicKey: string, network: typeof MAINNET | typeof TESTNET, feeRate?: number): Promise<{
146
+ psbtBase64: string;
147
+ psbtHex: string;
148
+ }>;
149
+ declare function getRedeemScript(paymentPublicKey: string, network: typeof MAINNET | typeof TESTNET): Buffer | undefined;
116
150
 
117
- export { LEATHER, LEATHER_MAINNET, LEATHER_TESTNET, LaserEyesProvider, MAINNET, MEMPOOL_SPACE_TESTNET_URL, MEMPOOL_SPACE_URL, OYL, P2PKH, P2PSH, P2SH, P2TR, P2WPKH, P2WSH, PHANTOM, REGTEST, TESTNET, UNISAT, UNISAT_MAINNET, UNISAT_TESTNET, WALLETS, XVERSE, XVERSE_MAINNET, XVERSE_NETWORK, XVERSE_TESTNET, createConfig, findOrdinalsAddress, findPaymentAddress, getAddressType, getBTCBalance, getBitcoinNetwork, getLeatherNetwork, getMempoolSpaceUrl, getNetworkForLeather, getNetworkForUnisat, getNetworkForXverse, getUnisatNetwork, getXverseNetwork, isBase64, isHex, satoshisToBTC, useLaserEyes };
151
+ export { LEATHER, LEATHER_MAINNET, LEATHER_TESTNET, LaserEyesProvider, MAGIC_EDEN, MAINNET, MEMPOOL_SPACE_TESTNET_URL, MEMPOOL_SPACE_URL, OKX, OKX_MAINNET, OKX_TESTNET, OYL, P2PKH, P2PSH, P2SH, P2TR, P2WPKH, P2WSH, PHANTOM, REGTEST, SIGNET, TESTNET, UNISAT, UNISAT_MAINNET, UNISAT_TESTNET, WALLETS, WIZZ, WIZZ_MAINNET, WIZZ_TESTNET, XVERSE, XVERSE_MAINNET, XVERSE_NETWORK, XVERSE_TESTNET, createConfig, createSendBtcPsbt, estimateTxSize, findOrdinalsAddress, findPaymentAddress, getAddressType, getAddressUtxos, getBTCBalance, getBitcoinNetwork, getLeatherNetwork, getMempoolSpaceUrl, getNetworkForLeather, getNetworkForOkx, getNetworkForUnisat, getNetworkForWizz, getNetworkForXverse, getRedeemScript, getUnisatNetwork, getWizzNetwork, getXverseNetwork, isBase64, isHex, satoshisToBTC, useLaserEyes };