Skip to content

Commit

Permalink
Merge pull request #2686 from CityOfZion/CU-86drpnt0k
Browse files Browse the repository at this point in the history
CU-86drpnt0k - NEON2 - Implement changes on NWD to allow adding witne…
  • Loading branch information
melanke authored Apr 1, 2024
2 parents 2cb1ccd + 3fc7b25 commit 7362db4
Show file tree
Hide file tree
Showing 4 changed files with 446 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ApproveConnection = ({
const chain = convertChain(network)

try {
await approveProposal(proposal, { account: { address, chain } })
await approveProposal(proposal, { address, chain, blockchain: 'neo3' })

showSuccessNotification({
message: `You have accepted connection from ${
Expand Down
52 changes: 28 additions & 24 deletions app/util/walletConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Blockchain,
AbstractWalletConnectNeonAdapter,
WalletInfo,
TOptions,
TInitOptions,
} from '@cityofzion/wallet-connect-sdk-wallet-react'
import * as NeonJs from '@cityofzion/neon-js'
import { MAIN_NETWORK_ID } from '../core/constants'
Expand Down Expand Up @@ -162,7 +162,7 @@ export class WalletConnectNeonAdapter extends AbstractWalletConnectNeonAdapter {
}
}

export const walletConnectOptions: TOptions = {
export const walletConnectOptions: TInitOptions = {
clientOptions: {
metadata: {
name: 'Neon Wallet',
Expand All @@ -177,26 +177,30 @@ export const walletConnectOptions: TOptions = {
relayUrl: 'wss://relay.walletconnect.com',
logger: 'error',
},
methods: [
'invokeFunction',
'testInvoke',
'signMessage',
'verifyMessage',
'traverseIterator',
'getWalletInfo',
'getNetworkVersion',
'decrypt',
'encrypt',
'decryptFromArray',
'calculateFee',
'signTransaction',
],
autoAcceptMethods: [
'testInvoke',
'getWalletInfo',
'getNetworkVersion',
'traverseIterator',
'calculateFee',
],
adapter: new WalletConnectNeonAdapter(),
blockchains: {
neo3: {
methods: [
'invokeFunction',
'testInvoke',
'signMessage',
'verifyMessage',
'traverseIterator',
'getWalletInfo',
'getNetworkVersion',
'decrypt',
'encrypt',
'decryptFromArray',
'calculateFee',
'signTransaction',
],
autoAcceptMethods: [
'testInvoke',
'getWalletInfo',
'getNetworkVersion',
'traverseIterator',
'calculateFee',
],
adapter: new WalletConnectNeonAdapter(),
},
},
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"@cityofzion/neon-js-legacy": "npm:@cityofzion/[email protected]",
"@cityofzion/neon-js-legacy-latest": "npm:@cityofzion/[email protected]",
"@cityofzion/neon-ledger-next": "npm:@cityofzion/[email protected]",
"@cityofzion/wallet-connect-sdk-wallet-react": "^3.0.3",
"@cityofzion/wallet-connect-sdk-wallet-react": "4.0.1",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@formatjs/intl-pluralrules": "^1.5.2",
Expand Down Expand Up @@ -319,4 +319,4 @@
"setupTestFrameworkScriptFile": "<rootDir>/__tests__/setupTests.js",
"testURL": "http://localhost"
}
}
}
Loading

0 comments on commit 7362db4

Please sign in to comment.