@btc-vision/transaction 1.0.80 → 1.0.81

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.
@@ -50,6 +50,7 @@ export interface Unisat {
50
50
  }): Promise<string>;
51
51
  requestAccounts(): Promise<string[]>;
52
52
  getNetwork(): Promise<UnisatNetwork>;
53
+ getChain(): UnisatChainType;
53
54
  getAccounts(): Promise<string[]>;
54
55
  switchNetwork(network: UnisatNetwork): Promise<void>;
55
56
  getPublicKey(): Promise<string>;
@@ -1 +1 @@
1
- export declare const version = "1.0.80";
1
+ export declare const version = "1.0.81";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.0.80';
1
+ export const version = '1.0.81';
@@ -50,6 +50,7 @@ export interface Unisat {
50
50
  }): Promise<string>;
51
51
  requestAccounts(): Promise<string[]>;
52
52
  getNetwork(): Promise<UnisatNetwork>;
53
+ getChain(): UnisatChainType;
53
54
  getAccounts(): Promise<string[]>;
54
55
  switchNetwork(network: UnisatNetwork): Promise<void>;
55
56
  getPublicKey(): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "author": "BlobMaster41",
5
5
  "description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
6
6
  "engines": {
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.0.80';
1
+ export const version = '1.0.81';
@@ -1,95 +1,97 @@
1
- import { Address } from '@btc-vision/bsi-binary';
2
- import { Web3Provider } from '../Web3Provider.js';
3
-
4
- export enum UnisatNetwork {
5
- testnet = 'testnet',
6
- mainnet = 'livenet',
7
- regtest = 'regtest',
8
- }
9
-
10
- export enum UnisatChainType {
11
- BITCOIN_MAINNET = 'BITCOIN_MAINNET',
12
- BITCOIN_TESTNET = 'BITCOIN_TESTNET',
13
- FRACTAL_BITCOIN_MAINNET = 'FRACTAL_BITCOIN_MAINNET',
14
- BITCOIN_REGTEST = 'BITCOIN_REGTEST'
15
- }
16
-
17
- export interface UnisatChainInfo {
18
- readonly enum: UnisatChainType;
19
- readonly name: string;
20
- readonly network: UnisatNetwork;
21
- }
22
-
23
- export interface Balance {
24
- readonly confirmed: number;
25
- readonly unconfirmed: number;
26
- readonly total: number;
27
- }
28
-
29
- export enum MessageType {
30
- ecdsa = 'ecdsa',
31
- bip322 = 'bip322-simple',
32
- }
33
-
34
- interface ToSignInputBase {
35
- readonly index: number;
36
- readonly sighashTypes?: number[];
37
- readonly disableTweakSigner?: boolean;
38
- }
39
-
40
- export interface ToSignInputPublicKey extends ToSignInputBase {
41
- readonly publicKey: string;
42
- }
43
-
44
- export interface ToSignInputAddress extends ToSignInputBase {
45
- readonly address: Address;
46
- }
47
-
48
- export type ToSignInput = ToSignInputPublicKey | ToSignInputAddress;
49
-
50
- export interface PsbtSignatureOptions {
51
- readonly autoFinalized?: boolean;
52
- readonly toSignInputs?: ToSignInput[];
53
- }
54
-
55
- export interface Unisat {
56
- web3?: Web3Provider;
57
-
58
- sendBitcoin(
59
- toAddress: Address,
60
- satoshis: number,
61
- options: { feeRate: number; memo?: string; memos?: string[] },
62
- ): Promise<string>;
63
-
64
- requestAccounts(): Promise<string[]>;
65
-
66
- getNetwork(): Promise<UnisatNetwork>;
67
-
68
- getAccounts(): Promise<string[]>;
69
-
70
- switchNetwork(network: UnisatNetwork): Promise<void>;
71
-
72
- getPublicKey(): Promise<string>;
73
-
74
- getBalance(): Promise<Balance>;
75
-
76
- signMessage(message: string, type?: MessageType): Promise<string>;
77
-
78
- pushTx(options: { rawtx: string }): Promise<string>;
79
-
80
- signPsbt(psbtHex: string, psbtOptions: PsbtSignatureOptions): Promise<string>;
81
-
82
- signPsbts(psbtHex: string[], psbtOptions: PsbtSignatureOptions): Promise<string[]>;
83
-
84
- pushPsbt(psbtHex: string): Promise<string>;
85
-
86
- on(event: 'accountsChanged', listener: (accounts: string[]) => void): void;
87
-
88
- on(event: 'networkChanged', listener: (network: UnisatNetwork) => void): void;
89
-
90
- on(event: 'chainChanged', listener: (network: UnisatNetwork) => void): void;
91
-
92
- removeListener(event: 'accountsChanged', listener: (accounts: string[]) => void): void;
93
-
94
- removeListener(event: 'networkChanged', listener: (network: UnisatNetwork) => void): void;
95
- }
1
+ import { Address } from '@btc-vision/bsi-binary';
2
+ import { Web3Provider } from '../Web3Provider.js';
3
+
4
+ export enum UnisatNetwork {
5
+ testnet = 'testnet',
6
+ mainnet = 'livenet',
7
+ regtest = 'regtest',
8
+ }
9
+
10
+ export enum UnisatChainType {
11
+ BITCOIN_MAINNET = 'BITCOIN_MAINNET',
12
+ BITCOIN_TESTNET = 'BITCOIN_TESTNET',
13
+ FRACTAL_BITCOIN_MAINNET = 'FRACTAL_BITCOIN_MAINNET',
14
+ BITCOIN_REGTEST = 'BITCOIN_REGTEST',
15
+ }
16
+
17
+ export interface UnisatChainInfo {
18
+ readonly enum: UnisatChainType;
19
+ readonly name: string;
20
+ readonly network: UnisatNetwork;
21
+ }
22
+
23
+ export interface Balance {
24
+ readonly confirmed: number;
25
+ readonly unconfirmed: number;
26
+ readonly total: number;
27
+ }
28
+
29
+ export enum MessageType {
30
+ ecdsa = 'ecdsa',
31
+ bip322 = 'bip322-simple',
32
+ }
33
+
34
+ interface ToSignInputBase {
35
+ readonly index: number;
36
+ readonly sighashTypes?: number[];
37
+ readonly disableTweakSigner?: boolean;
38
+ }
39
+
40
+ export interface ToSignInputPublicKey extends ToSignInputBase {
41
+ readonly publicKey: string;
42
+ }
43
+
44
+ export interface ToSignInputAddress extends ToSignInputBase {
45
+ readonly address: Address;
46
+ }
47
+
48
+ export type ToSignInput = ToSignInputPublicKey | ToSignInputAddress;
49
+
50
+ export interface PsbtSignatureOptions {
51
+ readonly autoFinalized?: boolean;
52
+ readonly toSignInputs?: ToSignInput[];
53
+ }
54
+
55
+ export interface Unisat {
56
+ web3?: Web3Provider;
57
+
58
+ sendBitcoin(
59
+ toAddress: Address,
60
+ satoshis: number,
61
+ options: { feeRate: number; memo?: string; memos?: string[] },
62
+ ): Promise<string>;
63
+
64
+ requestAccounts(): Promise<string[]>;
65
+
66
+ getNetwork(): Promise<UnisatNetwork>;
67
+
68
+ getChain(): UnisatChainType;
69
+
70
+ getAccounts(): Promise<string[]>;
71
+
72
+ switchNetwork(network: UnisatNetwork): Promise<void>;
73
+
74
+ getPublicKey(): Promise<string>;
75
+
76
+ getBalance(): Promise<Balance>;
77
+
78
+ signMessage(message: string, type?: MessageType): Promise<string>;
79
+
80
+ pushTx(options: { rawtx: string }): Promise<string>;
81
+
82
+ signPsbt(psbtHex: string, psbtOptions: PsbtSignatureOptions): Promise<string>;
83
+
84
+ signPsbts(psbtHex: string[], psbtOptions: PsbtSignatureOptions): Promise<string[]>;
85
+
86
+ pushPsbt(psbtHex: string): Promise<string>;
87
+
88
+ on(event: 'accountsChanged', listener: (accounts: string[]) => void): void;
89
+
90
+ on(event: 'networkChanged', listener: (network: UnisatNetwork) => void): void;
91
+
92
+ on(event: 'chainChanged', listener: (network: UnisatNetwork) => void): void;
93
+
94
+ removeListener(event: 'accountsChanged', listener: (accounts: string[]) => void): void;
95
+
96
+ removeListener(event: 'networkChanged', listener: (network: UnisatNetwork) => void): void;
97
+ }