Skip to content

Commit

Permalink
Merge pull request #273 from omnisat/op_net
Browse files Browse the repository at this point in the history
OP_NET
  • Loading branch information
hathbanger authored Nov 18, 2024
2 parents 6003f12 + 50acfce commit b62dd84
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
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
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 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

0 comments on commit b62dd84

Please sign in to comment.