Skip to content

Commit e824c8f

Browse files
authored
give native token instead of wrapped native token (#771)
1 parent 5ea41d9 commit e824c8f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

connect/src/protocols/tokenBridge/tokenTransfer.ts

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import type {
2222
import {
2323
TokenBridge,
2424
UniversalAddress,
25+
canonicalAddress,
2526
deserialize,
2627
isNative,
2728
isTokenId,
@@ -559,6 +560,10 @@ export namespace TokenTransfer {
559560
lookup.chain,
560561
lookup.address as UniversalAddress,
561562
);
563+
const destWrappedNative = await dstTb.getWrappedNative();
564+
if (canonicalAddress({ chain: dstChain.chain, address: destWrappedNative }) === canonicalAddress({ chain: dstChain.chain, address: nativeAddress })) {
565+
return { chain: dstChain.chain, address: 'native' }
566+
}
562567
return { chain: dstChain.chain, address: nativeAddress };
563568
}
564569

0 commit comments

Comments
 (0)