Skip to content

Commit

Permalink
add ETH custodial wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Sramko committed Nov 4, 2021
1 parent 0d321bf commit f2ec524
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum",
"version": "1.29.7",
"version": "1.29.8",
"description": "Tatum API client allows browsers and Node.js clients to interact with Tatum API.",
"main": "dist/src/index.js",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
2 changes: 1 addition & 1 deletion src/model/request/GenerateCustodialAddressBatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {PrivateKeyOrSignatureId} from './PrivateKeyOrSignatureId';
export class GenerateCustodialAddressBatch extends PrivateKeyOrSignatureId {

@IsNotEmpty()
@IsIn([Currency.MATIC, Currency.CELO, Currency.BSC])
@IsIn([Currency.MATIC, Currency.CELO, Currency.BSC, Currency.ETH])
public chain: Currency;

@IsNumber()
Expand Down
6 changes: 5 additions & 1 deletion src/wallet/custodial.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BigNumber from 'bignumber.js';
import {bscBroadcast, celoBroadcast, polygonBroadcast} from '../blockchain';
import {bscBroadcast, celoBroadcast, ethBroadcast, polygonBroadcast} from '../blockchain';
import {get, validateBody} from '../connector/tatum';
import {CUSTODIAL_PROXY_ABI} from '../constants';
import {
Expand Down Expand Up @@ -121,6 +121,8 @@ const getCustodialFactoryContractAddress = (chain: Currency, testnet: boolean) =
switch (chain) {
case Currency.CELO:
return testnet ? '0x7f6ECaef0d01De5D464B8c1Ca968b102ABd40Ca1' : '0xb1462fE8E9Cf82c0296022Cca7bEfA3Fd4c12B34';
case Currency.ETH:
return testnet ? (process.env.TESTNET_TYPE === 'ethereum-rinkeby' ? '0x664F97470654e8f00E42433CFFC0d08a5f4f7BC7' : '0x9120093df23a6b1486ded257b1cd0ce651fe1323') : '0x183363CE6418Fad855255B6681711eD56b0C442A';
case Currency.MATIC:
return testnet ? '0x1C129AE4BF1e6E6C9A0E5e567b8e97E2d41A9265' : '0x3485fdba44736859267789ac9c248cc4c1443956';
case Currency.BSC:
Expand Down Expand Up @@ -202,6 +204,8 @@ export const generateCustodialWalletBatch = async (testnet: boolean, body: Gener
switch (body.chain) {
case Currency.CELO:
return await celoBroadcast(txData, body.signatureId);
case Currency.ETH:
return await ethBroadcast(txData, body.signatureId);
case Currency.MATIC:
return await polygonBroadcast(txData, body.signatureId);
case Currency.BSC:
Expand Down

0 comments on commit f2ec524

Please sign in to comment.