@omnisat/lasereyes 0.0.42 → 0.0.44

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
@@ -4,9 +4,12 @@ import { ReactNode } from 'react';
4
4
  import * as bitcoin from 'bitcoinjs-lib';
5
5
 
6
6
  declare const XVERSE_NETWORK: "Mainnet" | "Testnet";
7
- declare const UNISAT_MAINNET = "livenet";
8
- declare const UNISAT_TESTNET = "testnet";
9
- declare const UNISAT_FRACTAL_TESTNET = "unknown";
7
+ declare const UNISAT_MAINNET = "BITCOIN_MAINNET";
8
+ declare const UNISAT_TESTNET = "BITCOIN_TESTNET";
9
+ declare const UNISAT_TESTNET4 = "BITCOIN_TESTNET4";
10
+ declare const UNISAT_SIGNET = "BITCOIN_SIGNET";
11
+ declare const UNISAT_FRACTAL_MAINNET = "FRACTAL_BITCOIN_MAINNET";
12
+ declare const UNISAT_FRACTAL_TESTNET = "FRACTAL_BITCOIN_TESTNET";
10
13
  declare const OP_WALLET_MAINNET = "livenet";
11
14
  declare const OP_WALLET_TESTNET = "testnet";
12
15
  declare const XVERSE_MAINNET = "Mainnet";
@@ -16,22 +19,26 @@ declare const OKX_MAINNET = "livenet";
16
19
  declare const OKX_TESTNET = "testnet";
17
20
  declare const WIZZ_MAINNET = "livenet";
18
21
  declare const WIZZ_TESTNET = "testnet";
22
+ declare const WIZZ_TESTNET4 = "testnet4";
23
+ declare const WIZZ_SIGNET = "signet";
19
24
  declare const LEATHER_MAINNET = "mainnet";
20
25
  declare const LEATHER_TESTNET = "testnet";
21
26
  declare const MAINNET = "mainnet";
22
27
  declare const SIGNET = "signet";
23
28
  declare const TESTNET = "testnet";
29
+ declare const TESTNET4 = "testnet4";
30
+ declare const FRACTAL_MAINNET = "fractal_mainnet";
24
31
  declare const FRACTAL_TESTNET = "fractal_testnet";
25
32
  declare const REGTEST = "regtest";
26
33
  declare const getXverseNetwork: (network: string) => "Mainnet" | "Testnet" | "Signet";
27
34
  declare const getLeatherNetwork: (network: string) => "testnet" | "mainnet";
28
- declare const getUnisatNetwork: (network: string) => "livenet" | "testnet" | "unknown";
29
- declare const getWizzNetwork: (network: string) => "livenet" | "testnet";
30
- declare const getNetworkForUnisat: (network: string) => "testnet" | "mainnet" | "fractal_testnet";
35
+ declare const getUnisatNetwork: (network: string) => "BITCOIN_MAINNET" | "BITCOIN_TESTNET" | "BITCOIN_TESTNET4" | "BITCOIN_SIGNET" | "FRACTAL_BITCOIN_MAINNET" | "FRACTAL_BITCOIN_TESTNET";
36
+ declare const getWizzNetwork: (network: string) => "livenet" | "testnet" | "testnet4" | "signet";
37
+ declare const getNetworkForUnisat: (network: string) => "testnet" | "testnet4" | "signet" | "mainnet" | "fractal_mainnet" | "fractal_testnet";
31
38
  declare const getNetworkForXverse: (network: string) => "testnet" | "mainnet";
32
39
  declare const getNetworkForLeather: (network: string) => "testnet" | "mainnet";
33
40
  declare const getNetworkForOkx: (network: string) => "testnet" | "mainnet";
34
- declare const getNetworkForWizz: (network: string) => "testnet" | "mainnet";
41
+ declare const getNetworkForWizz: (network: string) => "testnet" | "testnet4" | "signet" | "mainnet";
35
42
  declare const MEMPOOL_SPACE_URL = "https://mempool.space";
36
43
  declare const MEMPOOL_SPACE_TESTNET_URL = "https://mempool.space/testnet";
37
44
  declare const MEMPOOL_SPACE_SIGNET_URL = "https://mempool.space/signet";
@@ -89,7 +96,7 @@ type LaserEyesContextType = {
89
96
  paymentAddress: string;
90
97
  paymentPublicKey: string;
91
98
  balance: number | undefined;
92
- network: typeof MAINNET | typeof TESTNET | typeof SIGNET | typeof FRACTAL_TESTNET;
99
+ network: typeof MAINNET | typeof TESTNET | typeof TESTNET4 | typeof SIGNET | typeof FRACTAL_MAINNET | typeof FRACTAL_TESTNET;
93
100
  library: any;
94
101
  provider: any;
95
102
  accounts: string[];
@@ -105,7 +112,7 @@ type LaserEyesContextType = {
105
112
  disconnect: () => void;
106
113
  requestAccounts: () => Promise<string[]>;
107
114
  getNetwork: () => Promise<string | undefined>;
108
- switchNetwork: (network: typeof MAINNET | typeof TESTNET | typeof SIGNET | typeof FRACTAL_TESTNET) => Promise<void>;
115
+ switchNetwork: (network: typeof MAINNET | typeof TESTNET | typeof TESTNET4 | typeof SIGNET | typeof FRACTAL_MAINNET | typeof FRACTAL_TESTNET) => Promise<void>;
109
116
  getPublicKey: () => Promise<string>;
110
117
  getBalance: () => Promise<string>;
111
118
  getInscriptions: () => Promise<any[]>;
@@ -119,8 +126,19 @@ type LaserEyesContextType = {
119
126
  pushPsbt: (tx: string) => Promise<string | undefined>;
120
127
  };
121
128
  type Config = {
122
- network: typeof MAINNET | typeof TESTNET | typeof SIGNET | typeof FRACTAL_TESTNET;
129
+ network: typeof MAINNET | typeof TESTNET | typeof TESTNET4 | typeof SIGNET | typeof FRACTAL_MAINNET | typeof FRACTAL_TESTNET;
123
130
  };
131
+ interface MempoolUtxo {
132
+ txid: string;
133
+ vout: number;
134
+ status: {
135
+ confirmed: boolean;
136
+ block_height: number;
137
+ block_hash: string;
138
+ block_time: number;
139
+ };
140
+ value: number;
141
+ }
124
142
  interface CommitPsbtResponse {
125
143
  inscriberAddress: string;
126
144
  psbtHex: string;
@@ -136,27 +154,21 @@ declare const LaserEyesProvider: ({ children, config, }: {
136
154
  children: ReactNode;
137
155
  config?: Config | undefined;
138
156
  }) => react_jsx_runtime.JSX.Element;
139
- interface DeScribeCreateResponse {
140
- inscriberAddress: string;
141
- psbtHex: string;
142
- psbtBase64: string;
143
- feeRate: number;
144
- totalFees: number;
145
- }
146
157
 
147
- declare const getBitcoinNetwork: (network: typeof MAINNET | typeof TESTNET | typeof SIGNET | typeof REGTEST | typeof FRACTAL_TESTNET) => bitcoin.networks.Network;
158
+ declare const getBitcoinNetwork: (network: typeof MAINNET | typeof TESTNET | typeof TESTNET4 | typeof SIGNET | typeof FRACTAL_MAINNET | typeof FRACTAL_TESTNET) => bitcoin.networks.Network;
148
159
  declare const findOrdinalsAddress: (addresses: any) => any;
149
160
  declare const findPaymentAddress: (addresses: any) => any;
150
- declare const getBTCBalance: (address: string) => Promise<number>;
161
+ declare const getBTCBalance: (address: string, network: typeof MAINNET | typeof TESTNET | typeof TESTNET4 | typeof SIGNET | typeof FRACTAL_MAINNET | typeof FRACTAL_TESTNET) => Promise<number>;
151
162
  declare const satoshisToBTC: (satoshis: number) => string;
152
163
  declare const isBase64: (str: string) => boolean;
153
164
  declare const isHex: (str: string) => boolean;
154
165
  declare function estimateTxSize(taprootInputCount: number, nonTaprootInputCount: number, outputCount: number): number;
155
- declare function createSendBtcPsbt(address: string, paymentAddress: string, recipientAddress: string, amount: number, paymentPublicKey: string, network: typeof MAINNET | typeof TESTNET, feeRate?: number): Promise<{
166
+ declare function getAddressUtxos(address: string, network: typeof MAINNET | typeof TESTNET | typeof TESTNET4 | typeof SIGNET | typeof FRACTAL_MAINNET | typeof FRACTAL_TESTNET): Promise<MempoolUtxo[]>;
167
+ declare function createSendBtcPsbt(address: string, paymentAddress: string, recipientAddress: string, amount: number, paymentPublicKey: string, network: typeof MAINNET | typeof TESTNET | typeof TESTNET4 | typeof SIGNET | typeof FRACTAL_MAINNET | typeof FRACTAL_TESTNET, feeRate?: number): Promise<{
156
168
  psbtBase64: string;
157
169
  psbtHex: string;
158
170
  }>;
159
- declare function getRedeemScript(paymentPublicKey: string, network: typeof MAINNET | typeof TESTNET): Buffer | undefined;
171
+ declare function getRedeemScript(paymentPublicKey: string, network: typeof MAINNET | typeof TESTNET | typeof TESTNET4 | typeof SIGNET | typeof FRACTAL_MAINNET | typeof FRACTAL_TESTNET): Buffer | undefined;
160
172
  declare function delay(ms: number): Promise<unknown>;
161
173
 
162
174
  declare const useInscriber: ({ inscribeApiUrl, }: {
@@ -244,4 +256,4 @@ declare const WalletIcon: ({ size, className, variant, walletName, }: {
244
256
  walletName: typeof XVERSE | typeof WIZZ | typeof LEATHER | typeof MAGIC_EDEN | typeof OKX | typeof PHANTOM | typeof UNISAT | typeof OYL;
245
257
  }) => react_jsx_runtime.JSX.Element;
246
258
 
247
- export { DeScribeCreateResponse, FRACTAL_TESTNET, LEATHER, LEATHER_MAINNET, LEATHER_TESTNET, LaserEyesProvider, LeatherLogo, MAGIC_EDEN, MAINNET, MEMPOOL_SPACE_SIGNET_URL, MEMPOOL_SPACE_TESTNET_URL, MEMPOOL_SPACE_URL, MagicEdenLogo, OKX, OKX_MAINNET, OKX_TESTNET, OP_WALLET_MAINNET, OP_WALLET_TESTNET, OYL, OkxLogo, OylLogo, P2PKH, P2PSH, P2SH, P2TR, P2WPKH, P2WSH, PHANTOM, PhantomLogo, REGTEST, SIGNET, TESTNET, UNISAT, UNISAT_FRACTAL_TESTNET, UNISAT_MAINNET, UNISAT_TESTNET, UnisatLogo, WALLETS, WIZZ, WIZZ_MAINNET, WIZZ_TESTNET, WalletIcon, WizzLogo, XVERSE, XVERSE_MAINNET, XVERSE_NETWORK, XVERSE_SIGNET, XVERSE_TESTNET, XverseLogo, createConfig, createSendBtcPsbt, delay, estimateTxSize, findOrdinalsAddress, findPaymentAddress, getBTCBalance, getBitcoinNetwork, getLeatherNetwork, getMempoolSpaceUrl, getNetworkForLeather, getNetworkForOkx, getNetworkForUnisat, getNetworkForWizz, getNetworkForXverse, getRedeemScript, getUnisatNetwork, getWizzNetwork, getXverseNetwork, isBase64, isHex, satoshisToBTC, useInscriber, useLaserEyes };
259
+ export { FRACTAL_MAINNET, FRACTAL_TESTNET, LEATHER, LEATHER_MAINNET, LEATHER_TESTNET, LaserEyesProvider, LeatherLogo, MAGIC_EDEN, MAINNET, MEMPOOL_SPACE_SIGNET_URL, MEMPOOL_SPACE_TESTNET_URL, MEMPOOL_SPACE_URL, MagicEdenLogo, OKX, OKX_MAINNET, OKX_TESTNET, OP_WALLET_MAINNET, OP_WALLET_TESTNET, OYL, OkxLogo, OylLogo, P2PKH, P2PSH, P2SH, P2TR, P2WPKH, P2WSH, PHANTOM, PhantomLogo, REGTEST, SIGNET, TESTNET, TESTNET4, UNISAT, UNISAT_FRACTAL_MAINNET, UNISAT_FRACTAL_TESTNET, UNISAT_MAINNET, UNISAT_SIGNET, UNISAT_TESTNET, UNISAT_TESTNET4, UnisatLogo, WALLETS, WIZZ, WIZZ_MAINNET, WIZZ_SIGNET, WIZZ_TESTNET, WIZZ_TESTNET4, WalletIcon, WizzLogo, XVERSE, XVERSE_MAINNET, XVERSE_NETWORK, XVERSE_SIGNET, XVERSE_TESTNET, XverseLogo, createConfig, createSendBtcPsbt, delay, estimateTxSize, findOrdinalsAddress, findPaymentAddress, getAddressUtxos, getBTCBalance, getBitcoinNetwork, getLeatherNetwork, getMempoolSpaceUrl, getNetworkForLeather, getNetworkForOkx, getNetworkForUnisat, getNetworkForWizz, getNetworkForXverse, getRedeemScript, getUnisatNetwork, getWizzNetwork, getXverseNetwork, isBase64, isHex, satoshisToBTC, useInscriber, useLaserEyes };