Skip to content

Commit e347663

Browse files
committed
gas fallbacks, change icon, fixes
1 parent c3354e0 commit e347663

File tree

6 files changed

+129
-22
lines changed

6 files changed

+129
-22
lines changed

sdk/src/config/TESTNET.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ const TESTNET_CONFIG: WormholeConfig = {
392392
klaytn: 'https://rpc.ankr.com/klaytn_testnet',
393393
sepolia: 'https://rpc.ankr.com/eth_sepolia',
394394
arbitrum_sepolia: 'https://sepolia-rollup.arbitrum.io/rpc',
395-
base_sepolia: 'https://sepolia.base.org',
395+
base_sepolia: 'https://base-sepolia-rpc.publicnode.com',
396396
optimism_sepolia: 'https://sepolia.optimism.io',
397397
},
398398
rest: {

wormhole-connect/src/config/testnet/gasEstimates.ts

+35
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ export const TESTNET_GAS_ESTIMATES: GasEstimates = {
114114
sendToken: 15000,
115115
claim: 25000,
116116
},
117+
[Route.NttManual]: {
118+
sendToken: 15000,
119+
claim: 25000,
120+
},
121+
[Route.NttRelay]: {
122+
sendToken: 15000,
123+
},
117124
},
118125
sui: {
119126
[Route.Bridge]: {
@@ -244,27 +251,55 @@ export const TESTNET_GAS_ESTIMATES: GasEstimates = {
244251
sendToken: 150000,
245252
claim: 200000,
246253
},
254+
[Route.NttManual]: {
255+
sendToken: 10000000,
256+
claim: 15000000,
257+
},
258+
[Route.NttRelay]: {
259+
sendToken: 15000000,
260+
},
247261
},
248262
arbitrum_sepolia: {
249263
[Route.Bridge]: {
250264
sendNative: 100000,
251265
sendToken: 150000,
252266
claim: 200000,
253267
},
268+
[Route.NttManual]: {
269+
sendToken: 200000,
270+
claim: 250000,
271+
},
272+
[Route.NttRelay]: {
273+
sendToken: 450000,
274+
},
254275
},
255276
base_sepolia: {
256277
[Route.Bridge]: {
257278
sendNative: 100000,
258279
sendToken: 150000,
259280
claim: 200000,
260281
},
282+
[Route.NttManual]: {
283+
sendToken: 200000,
284+
claim: 250000,
285+
},
286+
[Route.NttRelay]: {
287+
sendToken: 450000,
288+
},
261289
},
262290
optimism_sepolia: {
263291
[Route.Bridge]: {
264292
sendNative: 100000,
265293
sendToken: 150000,
266294
claim: 200000,
267295
},
296+
[Route.NttManual]: {
297+
sendToken: 200000,
298+
claim: 250000,
299+
},
300+
[Route.NttRelay]: {
301+
sendToken: 450000,
302+
},
268303
},
269304
injective: {
270305
[Route.Bridge]: {

wormhole-connect/src/icons/Tokens/NTT.tsx

+74-12
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,81 @@ import React from 'react';
22

33
function NTT() {
44
return (
5-
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
6-
<circle cx="50" cy="50" r="40" fill="magenta" />
7-
<text
8-
x="50"
9-
y="50"
10-
textAnchor="middle"
11-
fill="white"
12-
fontSize="32"
13-
fontWeight="bold"
14-
dominantBaseline="middle"
5+
<svg
6+
viewBox="316.829 225.555 66.146 48.89"
7+
xmlns="http://www.w3.org/2000/svg"
8+
>
9+
<defs>
10+
<filter
11+
id="filter0_f_4160_67832"
12+
x="36.0726"
13+
y="19.3241"
14+
width="12.6301"
15+
height="12.6306"
16+
filterUnits="userSpaceOnUse"
17+
colorInterpolationFilters="sRGB"
18+
>
19+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
20+
<feBlend
21+
mode="normal"
22+
in="SourceGraphic"
23+
in2="BackgroundImageFix"
24+
result="shape"
25+
/>
26+
<feGaussianBlur
27+
stdDeviation="1.18048"
28+
result="effect1_foregroundBlur_4160_67832"
29+
/>
30+
</filter>
31+
<linearGradient
32+
id="paint0_linear_4160_67832"
33+
x1="76.3139"
34+
y1="25.3915"
35+
x2="10.1678"
36+
y2="25.3915"
37+
gradientUnits="userSpaceOnUse"
38+
gradientTransform="matrix(1, 0, 0, 1, 307.155052, 224.001474)"
39+
>
40+
<stop stopColor="white" stopOpacity="0" />
41+
<stop offset="0.5142" stopColor="white" />
42+
<stop offset="1" stopColor="white" stopOpacity="0" />
43+
</linearGradient>
44+
<linearGradient
45+
id="paint1_linear_4160_67832"
46+
x1="42.748"
47+
y1="1.55322"
48+
x2="42.748"
49+
y2="50.4438"
50+
gradientUnits="userSpaceOnUse"
51+
gradientTransform="matrix(1, 0, 0, 1, 307.155052, 224.001474)"
52+
>
53+
<stop stopColor="white" />
54+
<stop offset="0.4519" stopColor="white" stopOpacity="0" />
55+
<stop offset="0.5397" stopColor="white" stopOpacity="0" />
56+
<stop offset="1" stopColor="white" />
57+
</linearGradient>
58+
</defs>
59+
<g
60+
filter="url(#filter0_f_4160_67832)"
61+
transform="matrix(1, 0, 0, 1, 307.15521240234375, 224.00100708007812)"
1562
>
16-
NTT
17-
</text>
63+
<path
64+
d="M42.3874 29.5938C40.2035 29.5938 38.433 27.8234 38.433 25.6394C38.433 23.4555 40.2035 21.6851 42.3874 21.6851C44.5714 21.6851 46.3418 23.4555 46.3418 25.6394C46.3418 27.8234 44.5714 29.5938 42.3874 29.5938Z"
65+
fill="white"
66+
/>
67+
</g>
68+
<path
69+
fillRule="evenodd"
70+
clipRule="evenodd"
71+
d="M 316.829 249.281 L 382.975 249.281 L 382.975 250.719 L 316.829 250.719 L 316.829 249.281 Z"
72+
fill="url(#paint0_linear_4160_67832)"
73+
/>
74+
<path
75+
fillRule="evenodd"
76+
clipRule="evenodd"
77+
d="M 349.903 273.007 C 362.609 273.007 372.91 262.707 372.91 250 C 372.91 237.293 362.609 226.993 349.903 226.993 C 337.196 226.993 326.896 237.293 326.896 250 C 326.896 262.707 337.196 273.007 349.903 273.007 Z M 349.903 274.445 C 363.404 274.445 374.348 263.501 374.348 250 C 374.348 236.499 363.404 225.555 349.903 225.555 C 336.402 225.555 325.458 236.499 325.458 250 C 325.458 263.501 336.402 274.445 349.903 274.445 Z"
78+
fill="url(#paint1_linear_4160_67832)"
79+
/>
1880
</svg>
1981
);
2082
}

wormhole-connect/src/routes/ntt/nttRelay.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class NttRelay extends NttBase {
6363
]).then((results) => results.some((r) => r));
6464
}
6565
if (wh.toChainName(sourceChain) === 'solana') {
66-
if (!nttConfig.solanaQuoter) throw new Error('no solana quoter');
66+
if (!nttConfig.solanaQuoter) return false;
6767
const quoter = new NttQuoter(nttConfig.solanaQuoter);
6868
return await quoter.isRelayEnabled(destChain);
6969
}

wormhole-connect/src/routes/ntt/platforms/evm/nttManager.ts

+15-5
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,17 @@ export class NttManagerEvm {
5454
destChain: ChainName | ChainId,
5555
wormholeTransceiver: string,
5656
): Promise<string> {
57-
const endpointIxs = [
57+
// TODO: when this change is deployed, change to encodeTransceiverInstructions
58+
// https://github.com/wormhole-foundation/example-native-token-transfers/pull/286
59+
// const transceiverIxs = encodeTransceiverInstructions([
60+
// {
61+
// index: 0,
62+
// payload: encodeWormholeTransceiverInstruction({
63+
// shouldSkipRelayerSend,
64+
// }),
65+
// },
66+
// ]);
67+
const transceiverIxs = [
5868
{
5969
index: 0,
6070
payload: encodeWormholeTransceiverInstruction({
@@ -64,7 +74,7 @@ export class NttManagerEvm {
6474
];
6575
const [, deliveryPrice] = await this.nttManager.quoteDeliveryPrice(
6676
wh.toChainId(destChain),
67-
endpointIxs,
77+
transceiverIxs,
6878
[wormholeTransceiver],
6979
);
7080
return deliveryPrice.toString();
@@ -90,7 +100,7 @@ export class NttManagerEvm {
90100
),
91101
)
92102
: undefined;
93-
const endpointIxs = encodeTransceiverInstructions([
103+
const transceiverIxs = encodeTransceiverInstructions([
94104
{
95105
index: 0,
96106
payload: encodeWormholeTransceiverInstruction({
@@ -105,7 +115,7 @@ export class NttManagerEvm {
105115
wh.toChainId(toChain),
106116
wh.formatAddress(recipient, toChain),
107117
false, // revert instead of getting outbound queued
108-
endpointIxs,
118+
transceiverIxs,
109119
{ value: deliveryPrice },
110120
);
111121
const context = wh.getContext(this.chain) as EthContext<WormholeContext>;
@@ -195,7 +205,7 @@ export class NttManagerEvm {
195205
eventFilter,
196206
currentBlock - chainConfig.maxBlockSearch,
197207
);
198-
return events ? events[0].transactionHash : undefined;
208+
return events?.[0]?.transactionHash || undefined;
199209
}
200210

201211
throwParsedError(e: any): never {

wormhole-connect/src/routes/ntt/platforms/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { isEvmChain, wh } from 'utils/sdk';
33
import { NttManagerEvm } from './evm';
44
import { NttManagerSolana } from './solana';
55
import { WormholeTransceiver } from './evm';
6-
// import { NttQuoter } from './solana/nttQuoter';
6+
import { NttQuoter } from './solana/nttQuoter';
77

88
export const getNttManager = (
99
chain: ChainName | ChainId,
@@ -31,8 +31,8 @@ export const isRelayingEnabled = async (
3131
]).then((results) => results.some((r) => r));
3232
}
3333
if (wh.toChainName(chain) === 'solana') {
34-
// const quoter = new NttQuoter(address);
35-
// return await quoter.isRelayingEnabled(destChain);
34+
const quoter = new NttQuoter(address);
35+
return await quoter.isRelayEnabled(destChain);
3636
}
3737
throw new Error(`Unsupported chain: ${chain}`);
3838
};

0 commit comments

Comments
 (0)