Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Base to THORChain swaps #4209

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/THORChain/Swap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ TWCoinType chainCoinType(Chain chain) {
return TWCoinTypeCosmos;
case Chain::BSC:
return TWCoinTypeSmartChain;
case Chain::BASE:
return TWCoinTypeBase;
case Chain::THOR:
default:
return TWCoinTypeTHORChain;
Expand All @@ -89,6 +91,8 @@ std::string chainName(Chain chain) {
return "LTC";
case Chain::ATOM:
return "GAIA";
case Chain::BASE:
return "BASE";
case Chain::THOR:
default:
return "THOR";
Expand Down Expand Up @@ -128,6 +132,7 @@ SwapBundled SwapBuilder::build(bool shortened) {
case Chain::ETH:
case Chain::AVAX:
case Chain::BSC:
case Chain::BASE:
return buildEth(fromAmountNum, memo);
}
default:
Expand Down
1 change: 1 addition & 0 deletions src/THORChain/Swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum Chain {
ATOM = 7,
AVAX = 8,
BSC = 9,
BASE = 10,
};

using SwapErrorCode = int;
Expand Down
3 changes: 2 additions & 1 deletion src/THORChain/TWSwap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ TWData* _Nonnull TWTHORChainSwapBuildSwap(TWData* _Nonnull input) {

case THORChainSwap::Proto::ETH:
case THORChainSwap::Proto::BSC:
case THORChainSwap::Proto::AVAX: {
case THORChainSwap::Proto::AVAX:
case THORChainSwap::Proto::BASE: {
Ethereum::Proto::SigningInput ethInput;
if (!ethInput.ParseFromArray(txInput.data(), static_cast<int>(txInput.size()))) {
outputProto.mutable_error()->set_code(THORChainSwap::Proto::ErrorCode::Error_Input_proto_deserialization);
Expand Down
1 change: 1 addition & 0 deletions src/proto/THORChainSwap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum Chain {
ATOM = 7;
AVAX = 8;
BSC = 9;
BASE = 10;
}

// Predefined error codes
Expand Down