Skip to content

Commit 81204f5

Browse files
fix: universal-provider-tezos: ghostnet
1 parent f4ba0dc commit 81204f5

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Diff for: dapps/universal-provider-tezos/src/App.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const projectId = import.meta.env.VITE_PROJECT_ID
2121

2222
const rpcMap = {
2323
'tezos:mainnet': 'https://rpc.tzbeta.net',
24-
'tezos:testnet': 'https://rpc.ghostnet.teztnets.com'
24+
'tezos:ghostnet': 'https://rpc.ghostnet.teztnets.com'
2525
}
2626

27-
const chains = ['tezos:mainnet', 'tezos:testnet']
27+
const chains = ['tezos:mainnet', 'tezos:ghostnet']
2828
const methods = ['tezos_getAccounts', 'tezos_sign', 'tezos_send']
2929

3030
const App = () => {
@@ -117,8 +117,8 @@ const App = () => {
117117
setIsConnected(true)
118118
console.log('Connected successfully. Provider', provider)
119119

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'])
122122

123123
await getBalance()
124124
}
@@ -150,32 +150,32 @@ const App = () => {
150150
let res = null
151151
switch (kind) {
152152
case SAMPLE_KINDS.GET_ACCOUNTS:
153-
res = await getAccounts(TezosChainData['testnet'].id, provider, address)
153+
res = await getAccounts(TezosChainData['ghostnet'].id, provider, address)
154154
break
155155
case SAMPLE_KINDS.SIGN:
156-
res = await signMessage(TezosChainData['testnet'].id, provider, address)
156+
res = await signMessage(TezosChainData['ghostnet'].id, provider, address)
157157
break
158158
case SAMPLE_KINDS.SEND_TRANSACTION:
159159
case SAMPLE_KINDS.SEND_DELEGATION:
160160
case SAMPLE_KINDS.SEND_UNDELEGATION:
161161
res = await sendTransaction(
162-
TezosChainData['testnet'].id,
162+
TezosChainData['ghostnet'].id,
163163
provider,
164164
address,
165165
SAMPLES[kind]
166166
)
167167
break
168168
case SAMPLE_KINDS.SEND_ORGINATION:
169169
res = await sendTransaction(
170-
TezosChainData['testnet'].id,
170+
TezosChainData['ghostnet'].id,
171171
provider,
172172
address,
173173
SAMPLES[kind]
174174
)
175175
console.log('TezosRpc origination result: ', res)
176176
for (let attempt = 0; attempt < 10; attempt++) {
177177
const contractAddressList = await apiGetContractAddress(
178-
TezosChainData['testnet'].id,
178+
TezosChainData['ghostnet'].id,
179179
res.hash
180180
)
181181
if (contractAddressList.length > 0) {
@@ -193,15 +193,15 @@ const App = () => {
193193
break
194194
case SAMPLE_KINDS.SEND_CONTRACT_CALL:
195195
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, {
197197
...SAMPLES[kind],
198198
destination: contractAddress
199199
})
200200
break
201201
case SAMPLE_KINDS.SEND_STAKE:
202202
case SAMPLE_KINDS.SEND_UNSTAKE:
203203
case SAMPLE_KINDS.SEND_FINALIZE:
204-
res = await sendTransaction(TezosChainData['testnet'].id, provider, address, {
204+
res = await sendTransaction(TezosChainData['ghostnet'].id, provider, address, {
205205
...SAMPLES[kind],
206206
destination: address
207207
})
@@ -223,7 +223,7 @@ const App = () => {
223223

224224
const getBalance = useCallback(async () => {
225225
if (address) {
226-
const balance = await apiGetTezosAccountBalance(address, 'testnet')
226+
const balance = await apiGetTezosAccountBalance(address, 'ghostnet')
227227
setBalance(formatTezosBalance(balance))
228228
}
229229
}, [address])

Diff for: dapps/universal-provider-tezos/src/utils/helpers.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export const TezosChainData: ChainsMap = {
4949
slip44: 1729,
5050
testnet: false
5151
},
52-
testnet: {
53-
name: 'Tezos Testnet',
54-
id: 'tezos:testnet',
52+
ghostnet: {
53+
name: 'Tezos Ghostnet',
54+
id: 'tezos:ghostnet',
5555
rpc: ['https://rpc.ghostnet.teztnets.com'],
5656
api: 'https://api.ghostnet.tzkt.io/v1',
5757
slip44: 1729,

0 commit comments

Comments
 (0)