Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #274

Merged
merged 6 commits into from
Nov 18, 2024
Merged

Dev #274

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/demo.lasereyes.build/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ const App = ({ setNetwork }: { setNetwork: (n: NetworkType) => void }) => {
const [signedPsbt, setSignedPsbt] = useState<
| string
| {
signedPsbtHex: string
signedPsbtBase64: string
}
signedPsbtHex: string
signedPsbtBase64: string
}
| undefined
>()
type colorsType =
Expand Down
24 changes: 12 additions & 12 deletions apps/demo.lasereyes.build/components/WalletCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ const WalletCard = ({
setSignedPsbt: (
psbt:
| {
signedPsbtHex: string
signedPsbtBase64: string
txId?: string
}
signedPsbtHex: string
signedPsbtBase64: string
txId?: string
}
| undefined
) => void
}) => {
Expand Down Expand Up @@ -140,12 +140,12 @@ const WalletCard = ({
paymentAddress,
paymentPublicKey,
network as
| typeof MAINNET
| typeof TESTNET
| typeof TESTNET4
| typeof SIGNET
| typeof FRACTAL_MAINNET
| typeof FRACTAL_TESTNET
| typeof MAINNET
| typeof TESTNET
| typeof TESTNET4
| typeof SIGNET
| typeof FRACTAL_MAINNET
| typeof FRACTAL_TESTNET
)
.then((psbt) => {
if (psbt && psbt.toHex() !== unsigned) {
Expand Down Expand Up @@ -423,8 +423,8 @@ const WalletCard = ({
<Badge
variant={isConnected ? 'success' : 'outline'}
className={cn(
'text-gray-500 border-gray-500',
isConnected ? 'text-white ' : ''
'text-gray-500 border-gray-600',
isConnected ? 'text-gray-900 border-gray-900' : ''
)}
>
{isConnected ? 'connected' : 'disconnected'}
Expand Down
2 changes: 1 addition & 1 deletion packages/lasereyes-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@omnisat/lasereyes-core",
"private": false,
"version": "0.0.47",
"version": "0.0.48-rc.1",
"type": "module",
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/lasereyes-core/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
LEATHER,
MAGIC_EDEN,
OKX,
// OP_NET,
OP_NET,
ORANGE,
OYL,
PHANTOM,
Expand All @@ -28,7 +28,7 @@ import OrangeProvider from './providers/orange'
import OkxProvider from './providers/okx'
import MagicEdenProvider from './providers/magic-eden'
import PhantomProvider from './providers/phantom'
// import OpNetProvider from './providers/op-net'
import OpNetProvider from './providers/op-net'

export class LaserEyesClient {
readonly $store: MapStore<LaserEyesStoreType>
Expand All @@ -52,7 +52,7 @@ export class LaserEyesClient {
[LEATHER]: new LeatherProvider(stores, this, config),
[MAGIC_EDEN]: new MagicEdenProvider(stores, this, config),
[OKX]: new OkxProvider(stores, this, config),
// [OP_NET]: new OpNetProvider(stores, this, config),
[OP_NET]: new OpNetProvider(stores, this, config),
[ORANGE]: new OrangeProvider(stores, this, config),
[OYL]: new OylProvider(stores, this, config),
[PHANTOM]: new PhantomProvider(stores, this, config),
Expand Down
15 changes: 5 additions & 10 deletions packages/lasereyes-core/src/client/providers/op-net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as bitcoin from 'bitcoinjs-lib'
import { WalletProvider } from '.'
import { getNetworkForUnisat, getUnisatNetwork } from '../../constants/networks'
import { NetworkType, ProviderType } from '../../types'
import { getBTCBalance } from '../../lib/helpers'
import { OP_NET } from '../../constants/wallets'
import { listenKeys } from 'nanostores'

Expand Down Expand Up @@ -106,10 +105,7 @@ export default class OpNetProvider extends WalletProvider {
this.switchNetwork(network)
}
})
// TODO: Confirm if this is necessary and why
getBTCBalance(opNetAccounts[0], this.network).then((totalBalance) => {
this.$store.setKey('balance', totalBalance)
})

this.$store.setKey('connected', true)
}

Expand Down Expand Up @@ -143,10 +139,10 @@ export default class OpNetProvider extends WalletProvider {
broadcast?: boolean | undefined
): Promise<
| {
signedPsbtHex: string | undefined
signedPsbtBase64: string | undefined
txId?: string | undefined
}
signedPsbtHex: string | undefined
signedPsbtBase64: string | undefined
txId?: string | undefined
}
| undefined
> {
const signedPsbt = await this.library?.signPsbt(psbtHex, {
Expand Down Expand Up @@ -192,6 +188,5 @@ export default class OpNetProvider extends WalletProvider {
const wantedNetwork = getUnisatNetwork(network)
await this.library?.switchChain(wantedNetwork)
this.$network.set(network)
await this.getBalance()
}
}
7 changes: 6 additions & 1 deletion packages/lasereyes-core/src/constants/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ enum ProviderEnumMap {
LEATHER = 'leather',
MAGIC_EDEN = 'magic-eden',
OKX = 'okx',
WIZZ = 'wizz',
OP_NET = 'op_net',
ORANGE = 'orange',
OYL = 'oyl',
PHANTOM = 'phantom',
UNISAT = 'unisat',
WIZZ = 'wizz',
XVERSE = 'xverse',
}

Expand All @@ -50,6 +51,10 @@ export const SUPPORTED_WALLETS: WalletInfo = {
name: ProviderEnumMap.OKX,
url: 'https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge',
},
[ProviderEnumMap.OP_NET]: {
name: ProviderEnumMap.OP_NET,
url: 'https://opnet.org/',
},
[ProviderEnumMap.ORANGE]: {
name: ProviderEnumMap.ORANGE,
url: 'https://www.orangewallet.com/',
Expand Down
2 changes: 1 addition & 1 deletion packages/lasereyes-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@omnisat/lasereyes-react",
"private": false,
"version": "0.0.42",
"version": "0.0.43-rc.0",
"type": "module",
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/lasereyes-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@omnisat/lasereyes-vue",
"private": false,
"version": "0.0.8",
"version": "0.0.9-rc.0",
"type": "module",
"files": [
"dist"
Expand Down
4 changes: 2 additions & 2 deletions packages/lasereyes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"url": "https://github.com/omnisat/lasereyes-mono.git"
},
"private": false,
"version": "0.0.125",
"version": "0.0.126-rc.1",
"type": "module",
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
Expand Down Expand Up @@ -56,4 +56,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion scripts/generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a passive aggressive release note generator. Create detailed, sometimes hilarious release notes based on the git diff provided. Always ensure you are informative and helpful. On a humor scale of 1-10, you're a 3, but you don't share it very often.. YOU MUST BE INFORMATIVE, please. remember these are release notes. Don't mention anything about the lock file or about anything ot her then the main version changes."},
{"role": "system", "content": "You are a passive aggressive release note generator. Create detailed, sometimes hilarious release notes based on the git diff provided. Always ensure you are informative and helpful. On a humor scale of 1-10, you're a 3, but you don't share it very often. All versions will be in rc form, patch them. so any version you see that's 0.0.43-rc, should be converted to 0.0.43. YOU MUST BE INFORMATIVE, please. remember these are release notes. Don't mention anything about the lock file or about anything ot her then the main version changes."},
{"role": "user", "content": f"Version: {version}\n{diff_content}"}
]
)
Expand Down
Loading