@@ -21,10 +21,10 @@ const projectId = import.meta.env.VITE_PROJECT_ID
21
21
22
22
const rpcMap = {
23
23
'tezos:mainnet' : 'https://rpc.tzbeta.net' ,
24
- 'tezos:testnet ' : 'https://rpc.ghostnet.teztnets.com'
24
+ 'tezos:ghostnet ' : 'https://rpc.ghostnet.teztnets.com'
25
25
}
26
26
27
- const chains = [ 'tezos:mainnet' , 'tezos:testnet ' ]
27
+ const chains = [ 'tezos:mainnet' , 'tezos:ghostnet ' ]
28
28
const methods = [ 'tezos_getAccounts' , 'tezos_sign' , 'tezos_send' ]
29
29
30
30
const App = ( ) => {
@@ -117,8 +117,8 @@ const App = () => {
117
117
setIsConnected ( true )
118
118
console . log ( 'Connected successfully. Provider' , provider )
119
119
120
- const chainId = await getChainId ( 'tezos:testnet ' )
121
- provider . setDefaultChain ( chainId , rpcMap [ 'tezos:testnet ' ] )
120
+ const chainId = await getChainId ( 'tezos:ghostnet ' )
121
+ provider . setDefaultChain ( chainId , rpcMap [ 'tezos:ghostnet ' ] )
122
122
123
123
await getBalance ( )
124
124
}
@@ -150,32 +150,32 @@ const App = () => {
150
150
let res = null
151
151
switch ( kind ) {
152
152
case SAMPLE_KINDS . GET_ACCOUNTS :
153
- res = await getAccounts ( TezosChainData [ 'testnet ' ] . id , provider , address )
153
+ res = await getAccounts ( TezosChainData [ 'ghostnet ' ] . id , provider , address )
154
154
break
155
155
case SAMPLE_KINDS . SIGN :
156
- res = await signMessage ( TezosChainData [ 'testnet ' ] . id , provider , address )
156
+ res = await signMessage ( TezosChainData [ 'ghostnet ' ] . id , provider , address )
157
157
break
158
158
case SAMPLE_KINDS . SEND_TRANSACTION :
159
159
case SAMPLE_KINDS . SEND_DELEGATION :
160
160
case SAMPLE_KINDS . SEND_UNDELEGATION :
161
161
res = await sendTransaction (
162
- TezosChainData [ 'testnet ' ] . id ,
162
+ TezosChainData [ 'ghostnet ' ] . id ,
163
163
provider ,
164
164
address ,
165
165
SAMPLES [ kind ]
166
166
)
167
167
break
168
168
case SAMPLE_KINDS . SEND_ORGINATION :
169
169
res = await sendTransaction (
170
- TezosChainData [ 'testnet ' ] . id ,
170
+ TezosChainData [ 'ghostnet ' ] . id ,
171
171
provider ,
172
172
address ,
173
173
SAMPLES [ kind ]
174
174
)
175
175
console . log ( 'TezosRpc origination result: ' , res )
176
176
for ( let attempt = 0 ; attempt < 10 ; attempt ++ ) {
177
177
const contractAddressList = await apiGetContractAddress (
178
- TezosChainData [ 'testnet ' ] . id ,
178
+ TezosChainData [ 'ghostnet ' ] . id ,
179
179
res . hash
180
180
)
181
181
if ( contractAddressList . length > 0 ) {
@@ -193,15 +193,15 @@ const App = () => {
193
193
break
194
194
case SAMPLE_KINDS . SEND_CONTRACT_CALL :
195
195
case SAMPLE_KINDS . SEND_INCREASE_PAID_STORAGE :
196
- res = await sendTransaction ( TezosChainData [ 'testnet ' ] . id , provider , address , {
196
+ res = await sendTransaction ( TezosChainData [ 'ghostnet ' ] . id , provider , address , {
197
197
...SAMPLES [ kind ] ,
198
198
destination : contractAddress
199
199
} )
200
200
break
201
201
case SAMPLE_KINDS . SEND_STAKE :
202
202
case SAMPLE_KINDS . SEND_UNSTAKE :
203
203
case SAMPLE_KINDS . SEND_FINALIZE :
204
- res = await sendTransaction ( TezosChainData [ 'testnet ' ] . id , provider , address , {
204
+ res = await sendTransaction ( TezosChainData [ 'ghostnet ' ] . id , provider , address , {
205
205
...SAMPLES [ kind ] ,
206
206
destination : address
207
207
} )
@@ -223,7 +223,7 @@ const App = () => {
223
223
224
224
const getBalance = useCallback ( async ( ) => {
225
225
if ( address ) {
226
- const balance = await apiGetTezosAccountBalance ( address , 'testnet ' )
226
+ const balance = await apiGetTezosAccountBalance ( address , 'ghostnet ' )
227
227
setBalance ( formatTezosBalance ( balance ) )
228
228
}
229
229
} , [ address ] )
0 commit comments