Skip to content

Commit

Permalink
feat: bump rdt, remove schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidsowardx committed May 8, 2024
1 parent b6e2b2a commit 6a8d69f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 667 deletions.
56 changes: 4 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"@mui/material": "^5.14.0",
"@noble/curves": "^1.4.0",
"@radixdlt/babylon-gateway-api-sdk": "^1.2.7",
"@radixdlt/connect-button": "^1.0.1",
"@radixdlt/radix-dapp-toolkit": "2.0.0-v2.7",
"@radixdlt/radix-dapp-toolkit": "2.0.0-v2.12",
"@radixdlt/radix-connect-webrtc": "^1.2.1",
"@stitches/react": "^1.2.8",
"@types/blake2b": "^2.1.0",
Expand Down
10 changes: 6 additions & 4 deletions src/chrome/content-script/content-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { logger } from 'utils/logger'
import { MessageLifeCycleEvent } from 'chrome/dapp/_types'
import { sendMessage } from 'chrome/helpers/send-message'
import { hasConnections } from 'chrome/helpers/get-connections'
import { WalletInteractionWithOrigin } from '@radixdlt/radix-dapp-toolkit'
import { ExtensionInteraction } from 'schemas'
import {
WalletInteractionWithOrigin,
ExtensionInteraction,
} from '@radixdlt/radix-dapp-toolkit'

const appLogger = logger.getSubLogger({ name: 'content-script' })

Expand Down Expand Up @@ -70,8 +72,8 @@ const handleExtensionInteraction = async (
})
break

case 'cancelInteraction':
sendMessage(createMessage.cancelInteraction(extensionInteraction))
case 'cancelWalletInteraction':
sendMessage(createMessage.cancelWalletInteraction(extensionInteraction))
break

case 'walletInteraction':
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/dapp/dapp-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { safeParse } from 'valibot'
import {
WalletInteractionWithOrigin,
WalletInteraction,
ExtensionInteraction,
} from '@radixdlt/radix-dapp-toolkit'
import { ExtensionInteraction } from 'schemas'

export type ChromeDAppClient = ReturnType<typeof ChromeDAppClient>
export const ChromeDAppClient = (logger: AppLogger) => {
Expand Down
14 changes: 8 additions & 6 deletions src/chrome/messages/create-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import {
} from './_types'
import { MessageLifeCycleEvent } from 'chrome/dapp/_types'
import { ILogObj, ILogObjMeta } from 'tslog/dist/types/interfaces'
import { WalletInteractionWithOrigin } from '@radixdlt/radix-dapp-toolkit'
import { Connections } from 'pairing/state/connections'
import { WalletPublicKey, SessionId } from 'chrome/offscreen/session-router'
import {
CancelInteractionExtensionInteraction,
WalletInteractionWithOrigin,
CancelWalletInteractionExtensionInteraction,
WalletInteractionExtensionInteraction,
} from 'schemas'
} from '@radixdlt/radix-dapp-toolkit'
import { Connections } from 'pairing/state/connections'
import { WalletPublicKey, SessionId } from 'chrome/offscreen/session-router'

export const createMessage = {
openParingPopup: () => ({
Expand All @@ -31,7 +31,9 @@ export const createMessage = {
source: 'contentScript',
interaction,
}),
cancelInteraction: (interaction: CancelInteractionExtensionInteraction) => ({
cancelWalletInteraction: (
interaction: CancelWalletInteractionExtensionInteraction,
) => ({
discriminator: messageDiscriminator.cancelWalletInteraction,
source: 'contentScript',
interaction,
Expand Down
6 changes: 4 additions & 2 deletions src/chrome/offscreen/wallet-connection/message-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { Queue } from 'queues/queue'
import { AppLogger, logger as appLogger } from 'utils/logger'
import { LedgerResponse, isLedgerRequest } from 'ledger/schemas'
import { sendMessage } from 'chrome/helpers/send-message'
import { WalletInteractionWithOrigin } from '@radixdlt/radix-dapp-toolkit'
import {
WalletInteractionWithOrigin,
WalletInteractionExtensionInteraction,
} from '@radixdlt/radix-dapp-toolkit'
import {
Message,
MessageHandler,
Expand All @@ -15,7 +18,6 @@ import {
} from 'chrome/messages/_types'
import { syncClient } from './sync-client'
import { SessionRouter } from '../session-router'
import { WalletInteractionExtensionInteraction } from 'schemas'

const isExtensionMessage = (message: Message): boolean =>
['accountList', 'linkClient'].includes(message.discriminator)
Expand Down
2 changes: 1 addition & 1 deletion src/pairing/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Pairing } from './pairing'
import { ConnectionStatus } from './components/connection-status'
import { PopupWindow } from 'components'
import { ThemeProvider, createTheme } from '@mui/material'
import '@radixdlt/connect-button'
import '@radixdlt/radix-dapp-toolkit/connect-button'

const theme = createTheme({
typography: {
Expand Down
Loading

0 comments on commit 6a8d69f

Please sign in to comment.