Skip to content

Commit

Permalink
refactor(abstract-eth): move methods to abstract-eth
Browse files Browse the repository at this point in the history
WIN-1012

BREAKING CHANGE: Type of nextContractSequenceId field in TransactionPrebuild
interface is changed from string to number in AbstractEthLikeCoin and AbstractEthLikeNewCoins classes.
getCustomChainName method is removed from Polygon class because a common
method getCustomChainCommon has been added to AbstractEthLikeNewCoins
class for all EthLike coins. replayProtectionOptions is not optional in buildTransaction method in AbstractEthLikeNewCoins
and needs to be passed to derive the Eth common object from the chainId.
signFinalPolygon method name from Polygon class is updated to signFinalEthLike so that
it can be used for other EthLike coins. getBaseFactor method in Eth
and Polygon class returns number instead of string just to align with
AbstractEthLikeCoin
Ticket: WIN-1012
  • Loading branch information
gianchandania committed Nov 9, 2023
1 parent 95b88f0 commit 3b72cb5
Show file tree
Hide file tree
Showing 21 changed files with 2,745 additions and 2,947 deletions.
15 changes: 10 additions & 5 deletions modules/abstract-eth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,18 @@
"@bitgo/sdk-core": "^8.26.0",
"@bitgo/statics": "^29.0.0",
"@bitgo/utxo-lib": "^9.16.0",
"bignumber.js": "^9.1.1",
"ethers": "^5.1.3",
"ethereumjs-util": "7.1.5",
"@ethereumjs/common": "^2.6.5",
"@ethereumjs/tx": "^3.3.0",
"ethereumjs-abi": "^0.6.5",
"bignumber.js": "^9.1.1",
"bn.js": "^5.2.1",
"debug": "^3.1.0"
"debug": "^3.1.0",
"ethereumjs-abi": "^0.6.5",
"ethereumjs-util": "7.1.5",
"ethers": "^5.1.3",
"lodash": "4.17.21",
"keccak": "^3.0.3",
"secp256k1": "5.0.0",
"@bitgo/sdk-lib-mpc": "^8.15.0",
"@metamask/eth-sig-util": "^5.0.2"
}
}
7 changes: 4 additions & 3 deletions modules/abstract-eth/src/abstractEthLikeCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import BigNumber from 'bignumber.js';

import { isValidEthAddress, KeyPair as EthKeyPair, TransactionBuilder } from './lib';
import { VerifyEthAddressOptions } from './abstractEthLikeNewCoins';

export interface EthSignTransactionOptions extends SignTransactionOptions {
txPrebuild: TransactionPrebuild;
Expand All @@ -36,12 +37,12 @@ export interface TxInfo {
}

interface TransactionPrebuild extends BaseTransactionPrebuild {
txHex: string;
txHex?: string;
txInfo: TxInfo;
feeInfo: EthTransactionFee;
source: string;
dataToSign: string;
nextContractSequenceId?: string;
nextContractSequenceId?: number;
expireTime?: number;
}

Expand Down Expand Up @@ -134,7 +135,7 @@ export abstract class AbstractEthLikeCoin extends BaseCoin {
return {};
}

async isWalletAddress(): Promise<boolean> {
async isWalletAddress(params: VerifyEthAddressOptions): Promise<boolean> {
throw new MethodNotImplementedError();
}

Expand Down
Loading

0 comments on commit 3b72cb5

Please sign in to comment.