Skip to content

Commit a684214

Browse files
authored
feat: add Tempo networks in selector (#429)
1 parent bae190b commit a684214

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

src/components/connections/networks-helpers.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ const NETWORKS = [
8080
color: '#836ef9',
8181
category: 'main',
8282
},
83+
{
84+
name: 'Tempo Mainnet (Presto)',
85+
chainId: '0x1079',
86+
color: '#dcdcdc',
87+
category: 'main',
88+
},
8389

8490
// Test networks
8591
{
@@ -106,6 +112,12 @@ const NETWORKS = [
106112
color: '#ff6b35',
107113
category: 'test',
108114
},
115+
{
116+
name: 'Tempo Testnet (Moderato)',
117+
chainId: '0xa5bf',
118+
color: '#dcdcdc',
119+
category: 'test',
120+
},
109121
];
110122

111123
export function populateNetworkLists() {

src/components/tempo-transactions/tempo-transactions.js

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import globalContext from '../..';
33
// Tempo Transactions
44

55
// ERC20 TST token created and owned by shared account 0x13b7e6EBcd40777099E4c45d407745aB2de1D1F8
6-
const defaultErc20TokenAddress = '0x86fA047df5b69df0CBD6dF566F1468756dCF339D';
7-
const defaultChainId = '0x89'; // Forcing to Polygon PoS for now since EIP7702 not available on Tempo
8-
const defaultFeeToken = '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359'; // USDC Coin (PoS) for Polygon Mainnet testing
6+
const defaultErc20TokenAddress = '0x54a114fecE3dffd7c5D4089D0A43E01F0939464c';
7+
// pathUSD (default Tempo fee token
8+
const defaultFeeToken = '0x20c0000000000000000000000000000000000000';
99

1010
export function tempoTransactionsComponent(parentContainer) {
1111
parentContainer.insertAdjacentHTML(
@@ -18,16 +18,6 @@ export function tempoTransactionsComponent(parentContainer) {
1818
<h4>
1919
Tempo Transactions
2020
</h4>
21-
<div class="mb-3">
22-
<label for="tempoChainIdInput" class="form-label">Chain ID</label>
23-
<input
24-
type="text"
25-
class="form-control"
26-
id="tempoChainIdInput"
27-
value="${defaultChainId}"
28-
placeholder="${defaultChainId}"
29-
/>
30-
</div>
3121
3222
<div class="mb-3">
3323
<label for="tempoErc20TokenAddressInput" class="form-label">ERC20 Token Address</label>
@@ -57,7 +47,7 @@ export function tempoTransactionsComponent(parentContainer) {
5747
>
5848
Send Tempo (0x76) Batch Transaction
5949
</button>
60-
<p>Sends a minimalistic 0x76 batch with 2 ERC20 transfers on chain [chainId] (hex) for initial testing:</p>
50+
<p>Sends a minimalistic 0x76 batch with 2 ERC20 transfers for initial testing:</p>
6151
<ul>
6252
<li>0.01 [erc20Token] to 0x2367e6eca6e1fcc2d112133c896e3bddad375aff</li>
6353
<li>0.01 [erc20Token] to 0x1e3abc74428056924cEeE2F45f060879c3F063ed</li>
@@ -96,10 +86,9 @@ export function tempoTransactionsComponent(parentContainer) {
9686
const erc20TokenAddress = document.getElementById(
9787
'tempoErc20TokenAddressInput',
9888
).value;
99-
const chainId = document.getElementById('tempoChainIdInput').value;
10089
const feeToken = document.getElementById('tempoFeeTokenInput').value;
10190
// As sent by some Tempo example dapps
102-
const send = await globalContext.provider.request({
91+
const ethRequest = {
10392
method: 'eth_sendTransaction',
10493
params: [
10594
{
@@ -115,13 +104,13 @@ export function tempoTransactionsComponent(parentContainer) {
115104
value: '0x',
116105
},
117106
],
118-
chainId,
119107
feeToken,
120108
from,
121109
type: '0x76', // Tempo in-house tx type.
122110
},
123111
],
124-
});
112+
};
113+
const send = await globalContext.provider.request(ethRequest);
125114
sendTempoBatchTxResult.innerHTML = send;
126115
} catch (err) {
127116
console.error(err);

0 commit comments

Comments
 (0)