Skip to content

Commit

Permalink
#NOISSUE - add support for custodial wallet proxy generation for BSC
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Sramko committed Oct 22, 2021
1 parent 0940a3f commit 9674e84
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.2",
"version": "1.29.3",
"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])
@IsIn([Currency.MATIC, Currency.CELO, Currency.BSC])
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 {celoBroadcast, polygonBroadcast} from '../blockchain';
import {bscBroadcast, celoBroadcast, polygonBroadcast} from '../blockchain';
import {get, validateBody} from '../connector/tatum';
import {CUSTODIAL_PROXY_ABI} from '../constants';
import {
Expand Down Expand Up @@ -123,6 +123,8 @@ const getCustodialFactoryContractAddress = (chain: Currency, testnet: boolean) =
return testnet ? '0x7f6ECaef0d01De5D464B8c1Ca968b102ABd40Ca1' : '0xb1462fE8E9Cf82c0296022Cca7bEfA3Fd4c12B34';
case Currency.MATIC:
return testnet ? '0x1C129AE4BF1e6E6C9A0E5e567b8e97E2d41A9265' : '0x3485fdba44736859267789ac9c248cc4c1443956';
case Currency.BSC:
return testnet ? '0x8a29493C84a820882d7c2B8af6aA88BF5adD4A08' : '0x3485fDBa44736859267789AC9C248Cc4c1443956';
default:
throw new Error('Unsupported chain.');
}
Expand Down Expand Up @@ -202,6 +204,8 @@ export const generateCustodialWalletBatch = async (testnet: boolean, body: Gener
return await celoBroadcast(txData, body.signatureId);
case Currency.MATIC:
return await polygonBroadcast(txData, body.signatureId);
case Currency.BSC:
return await bscBroadcast(txData, body.signatureId);
default:
throw new Error('Unsupported chain');
}
Expand Down

0 comments on commit 9674e84

Please sign in to comment.