@@ -72,11 +72,8 @@ const popupText = document.getElementById('popup-text')
72
72
73
73
const provider = new ethers . providers . Web3Provider ( window . ethereum )
74
74
75
- const hubProvider = new ethers . providers . JsonRpcProvider ( 'http://localhost:8545' ) ;
76
75
const hubAddress = DeployInfo . hubAddress
77
-
78
- const hubContract = new ethers . Contract ( hubAbi , hubAddress , hubProvider )
79
-
76
+ const hubContract = new ethers . Contract ( hubAddress , hubAbi , provider )
80
77
81
78
let walletInfo = {
82
79
ownershipStatus : undefined ,
@@ -144,18 +141,18 @@ async function onClickSignTypedData() {
144
141
const heirAddress = document . getElementById ( 'heirAddress' )
145
142
const heir = provider . getSigner ( heirAddress . value )
146
143
147
- //todo - get public key from heir
148
- async function getPublicKeyFromHeir ( address ) {
149
- try {
150
- const publicKey = await hubContract . getPublicKeyHeir ( address )
151
- return publicKey
152
- } catch {
153
- console . error ( "Error getting public key:" , error )
154
- return null
155
- }
156
- }
157
-
158
- const publicKeyHeir = getPublicKeyFromHeir ( heirAddress . value )
144
+ // // todo - get public key from heir
145
+ // async function getPublicKeyFromHeir(address) {
146
+ // try {
147
+ // const publicKey = await hubContract.getPublicKeyHeir(address)
148
+ // return publicKey
149
+ // } catch {
150
+ // console.error("Error getting public key:", error)
151
+ // return null
152
+ // }
153
+ // }
154
+ //
155
+ // const publicKeyHeir = getPublicKeyFromHeir(heirAddress.value)
159
156
160
157
const im = {
161
158
types : {
@@ -194,6 +191,8 @@ async function sendIMToOracle() {
194
191
const url = "http://localhost:8080/"
195
192
const data = signTypedDataResult . innerHTML
196
193
194
+ // TODO encrypt the data before sending it to Oracle
195
+
197
196
const options = {
198
197
method : 'POST' ,
199
198
body : JSON . stringify ( JSON . parse ( data ) ) ,
@@ -216,6 +215,9 @@ async function sendIMToOracle() {
216
215
async function getIMFromOracle ( ) {
217
216
const response = await fetch ( 'http://localhost:8080' )
218
217
const data = await response . json ( )
218
+
219
+ //TODO decrypt the data from Oracle
220
+
219
221
signedTypedDataFromOwnerDiv . value = JSON . stringify ( data )
220
222
onChangeSignedTypedDataFromOwner ( )
221
223
}
@@ -580,8 +582,6 @@ const initialize = async () => {
580
582
updateButtons ( )
581
583
}
582
584
583
- getGreetingFromContractHub ( )
584
-
585
585
// assign events
586
586
connectWalletButton . onclick = onClickConnectWallet
587
587
disconnectWalletButton . onclick = onClickDisconnectWallet
0 commit comments