@btc-vision/walletconnect 1.0.0 → 1.0.2
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/browser/WalletConnection.d.ts +2 -2
- package/browser/WalletProvider.d.ts +2 -2
- package/browser/index.js +1 -1
- package/browser/index.js.LICENSE.txt +2 -2
- package/build/WalletConnection.d.ts +2 -2
- package/build/WalletProvider.d.ts +2 -2
- package/package.json +21 -21
- package/src/WalletConnection.ts +3 -3
- package/src/WalletProvider.tsx +3 -3
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
|
7
|
-
* react-jsx-runtime.production.
|
|
7
|
+
* react-jsx-runtime.production.js
|
|
8
8
|
*
|
|
9
|
-
* Copyright (c)
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Network } from '@btc-vision/bitcoin';
|
|
2
2
|
import { Address, Unisat, UnisatSigner } from '@btc-vision/transaction';
|
|
3
|
-
import {
|
|
3
|
+
import { AbstractRpcProvider } from 'opnet';
|
|
4
4
|
export declare enum SupportedWallets {
|
|
5
5
|
OP_WALLET = "op_wallet"
|
|
6
6
|
}
|
|
@@ -12,6 +12,6 @@ export declare class WalletConnection {
|
|
|
12
12
|
disconnect(): void;
|
|
13
13
|
getAddress(): Promise<Address>;
|
|
14
14
|
getNetwork(): Promise<Network>;
|
|
15
|
-
getProvider(): Promise<
|
|
15
|
+
getProvider(): Promise<AbstractRpcProvider>;
|
|
16
16
|
}
|
|
17
17
|
export default WalletConnection;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Network } from '@btc-vision/bitcoin';
|
|
2
2
|
import { Address } from '@btc-vision/transaction';
|
|
3
|
-
import {
|
|
3
|
+
import { AbstractRpcProvider } from 'opnet';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Signers, SupportedWallets } from './WalletConnection';
|
|
6
6
|
interface WalletContextType {
|
|
@@ -9,7 +9,7 @@ interface WalletContextType {
|
|
|
9
9
|
address: Address | null;
|
|
10
10
|
signer: Signers | null;
|
|
11
11
|
network: Network | null;
|
|
12
|
-
provider:
|
|
12
|
+
provider: AbstractRpcProvider | null;
|
|
13
13
|
isConnected: boolean;
|
|
14
14
|
}
|
|
15
15
|
export declare const WalletProvider: React.FC<{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btc-vision/walletconnect",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"author": "impredmet",
|
|
6
6
|
"description": "OPNet Wallet Connect library allows you to connect to any WalletConnect compatible wallet.",
|
|
7
7
|
"engines": {
|
|
@@ -67,60 +67,60 @@
|
|
|
67
67
|
"react-dom": "^18"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@babel/core": "^7.26.
|
|
70
|
+
"@babel/core": "^7.26.7",
|
|
71
71
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
72
72
|
"@babel/plugin-transform-runtime": "^7.25.9",
|
|
73
|
-
"@babel/preset-env": "^7.26.
|
|
73
|
+
"@babel/preset-env": "^7.26.7",
|
|
74
74
|
"@babel/preset-flow": "^7.25.9",
|
|
75
|
-
"@babel/preset-react": "^7.
|
|
75
|
+
"@babel/preset-react": "^7.26.3",
|
|
76
76
|
"@babel/preset-typescript": "^7.26.0",
|
|
77
|
-
"@types/node": "^22.
|
|
78
|
-
"@types/react": "^
|
|
77
|
+
"@types/node": "^22.13.0",
|
|
78
|
+
"@types/react": "^19.0.8",
|
|
79
79
|
"@types/sha.js": "^2.4.4",
|
|
80
|
-
"eslint": "^9.
|
|
80
|
+
"eslint": "^9.19.0",
|
|
81
81
|
"gulp": "^5.0.0",
|
|
82
82
|
"gulp-cached": "^1.1.1",
|
|
83
83
|
"gulp-typescript": "^6.0.0-alpha.1",
|
|
84
84
|
"https-browserify": "^1.0.0",
|
|
85
85
|
"os-browserify": "^0.3.0",
|
|
86
|
-
"prettier": "^3.
|
|
87
|
-
"react": "^
|
|
88
|
-
"react-dom": "^
|
|
86
|
+
"prettier": "^3.4.2",
|
|
87
|
+
"react": "^19.0.0",
|
|
88
|
+
"react-dom": "^19.0.0",
|
|
89
89
|
"stream-browserify": "^3.0.0",
|
|
90
90
|
"stream-http": "^3.2.0",
|
|
91
91
|
"typedoc": "^0.27.6",
|
|
92
|
-
"typescript-eslint": "^8.
|
|
92
|
+
"typescript-eslint": "^8.22.0",
|
|
93
93
|
"webpack-cli": "^6.0.1"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
96
|
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
97
|
-
"@bitcoinerlab/secp256k1": "^1.
|
|
97
|
+
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
98
98
|
"@btc-vision/bitcoin": "^6.3.6",
|
|
99
|
-
"@btc-vision/bitcoin-rpc": "^1.0.
|
|
99
|
+
"@btc-vision/bitcoin-rpc": "^1.0.1",
|
|
100
100
|
"@btc-vision/logger": "^1.0.6",
|
|
101
101
|
"@btc-vision/transaction": "^1.2.10",
|
|
102
|
-
"@eslint/js": "^9.
|
|
103
|
-
"@noble/secp256k1": "^2.
|
|
102
|
+
"@eslint/js": "^9.19.0",
|
|
103
|
+
"@noble/secp256k1": "^2.2.3",
|
|
104
104
|
"assert": "^2.1.0",
|
|
105
105
|
"babel-loader": "^9.2.1",
|
|
106
|
-
"babel-plugin-transform-import-meta": "^2.2
|
|
106
|
+
"babel-plugin-transform-import-meta": "^2.3.2",
|
|
107
107
|
"babel-preset-react": "^6.24.1",
|
|
108
108
|
"babelify": "^10.0.0",
|
|
109
109
|
"bech32": "^2.0.0",
|
|
110
|
-
"bip174": "^
|
|
110
|
+
"bip174": "^3.0.0-rc.1",
|
|
111
111
|
"bip32": "^5.0.0-rc.0",
|
|
112
112
|
"browserify-zlib": "^0.2.0",
|
|
113
113
|
"buffer": "^6.0.3",
|
|
114
|
-
"ecpair": "^
|
|
114
|
+
"ecpair": "^3.0.0-rc.0",
|
|
115
115
|
"gulp-clean": "^0.4.0",
|
|
116
116
|
"gulp-eslint-new": "^2.4.0",
|
|
117
117
|
"gulp-logger-new": "^1.0.1",
|
|
118
|
-
"opnet": "^1.2.
|
|
118
|
+
"opnet": "^1.2.24",
|
|
119
119
|
"process": "^0.11.10",
|
|
120
120
|
"sha.js": "^2.4.11",
|
|
121
|
-
"ts-loader": "^9.5.
|
|
121
|
+
"ts-loader": "^9.5.2",
|
|
122
122
|
"ts-node": "^10.9.2",
|
|
123
|
-
"typescript": "^5.7.
|
|
123
|
+
"typescript": "^5.7.3",
|
|
124
124
|
"webpack": "^5.97.1"
|
|
125
125
|
}
|
|
126
126
|
}
|
package/src/WalletConnection.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Network, networks } from '@btc-vision/bitcoin';
|
|
2
2
|
import { Address, Unisat, UnisatChainType, UnisatSigner } from '@btc-vision/transaction';
|
|
3
|
-
import { JSONRpcProvider } from 'opnet';
|
|
3
|
+
import { AbstractRpcProvider, JSONRpcProvider } from 'opnet';
|
|
4
4
|
|
|
5
5
|
export enum SupportedWallets {
|
|
6
6
|
OP_WALLET = 'op_wallet',
|
|
@@ -98,9 +98,9 @@ export class WalletConnection {
|
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* @description Get the provider of the connected wallet
|
|
101
|
-
* @returns {Promise<
|
|
101
|
+
* @returns {Promise<AbstractRpcProvider>}
|
|
102
102
|
*/
|
|
103
|
-
public async getProvider(): Promise<
|
|
103
|
+
public async getProvider(): Promise<AbstractRpcProvider> {
|
|
104
104
|
if (!this.signer) throw new Error('Wallet not connected');
|
|
105
105
|
|
|
106
106
|
if (this.signer instanceof UnisatSigner) {
|
package/src/WalletProvider.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Network } from '@btc-vision/bitcoin';
|
|
2
2
|
import { Address, UnisatSigner } from '@btc-vision/transaction';
|
|
3
|
-
import {
|
|
3
|
+
import { AbstractRpcProvider } from 'opnet';
|
|
4
4
|
import React, { createContext, useCallback, useContext, useEffect, useState } from 'react';
|
|
5
5
|
import WalletConnection, { Signers, SupportedWallets } from './WalletConnection';
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ interface WalletContextType {
|
|
|
10
10
|
address: Address | null;
|
|
11
11
|
signer: Signers | null;
|
|
12
12
|
network: Network | null;
|
|
13
|
-
provider:
|
|
13
|
+
provider: AbstractRpcProvider | null;
|
|
14
14
|
isConnected: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -21,7 +21,7 @@ export const WalletProvider: React.FC<{ children: React.ReactNode }> = ({ childr
|
|
|
21
21
|
const [address, setAddress] = useState<Address | null>(null);
|
|
22
22
|
const [signer, setSigner] = useState<Signers | null>(null);
|
|
23
23
|
const [network, setNetwork] = useState<Network | null>(null);
|
|
24
|
-
const [provider, setProvider] = useState<
|
|
24
|
+
const [provider, setProvider] = useState<AbstractRpcProvider | null>(null);
|
|
25
25
|
const [isConnected, setIsConnected] = useState(false);
|
|
26
26
|
|
|
27
27
|
useEffect(() => {
|