Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 4f1dd33

Browse files
committed
types(dataunion): Transfer amount to a specific member
Added transferToMemberInContract to dataunion Signed-off-by: AliReza Seyfpour <a.seyfpour@gmail.com>
1 parent f20a93c commit 4f1dd33

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/dataunion/DataUnion.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,21 @@ export class DataUnion {
467467
return tx.wait()
468468
}
469469

470+
/**
471+
* Transfer amount to specific member in DataunionSidechain
472+
* @param memberAddress - the other member who gets their tokens out of the Data Union
473+
* @param amountTokenWei - the amount that want to add to the member
474+
* @returns receipt once transfer transaction is confirmed
475+
*/
476+
async transferToMemberInContract(
477+
memberAddress: EthereumAddress,
478+
amountTokenWei: BigNumber|number|string
479+
): Promise<TransactionResponse> {
480+
const address = getAddress(memberAddress) // throws if bad address
481+
const duSidechain = await this.getContracts().getSidechainContract(this.contractAddress)
482+
return duSidechain.transferToMemberInContract(address, amountTokenWei)
483+
}
484+
470485
/**
471486
* Create a new DataUnionMainnet contract to mainnet with DataUnionFactoryMainnet
472487
* This triggers DataUnionSidechain contract creation in sidechain, over the bridge (AMB)

src/dataunion/abi.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ export const dataUnionSidechainABI = [{
125125
],
126126
anonymous: false,
127127
type: 'event'
128+
}, {
129+
name: 'transferToMemberInContract',
130+
inputs: [
131+
{ name: 'recipient', type: 'address', internalType: 'address' },
132+
{ name: 'amount', type: 'uint256', internalType: 'uint256' }
133+
],
134+
outputs: [],
135+
stateMutability: 'nonpayable',
136+
type: 'function'
128137
}]
129138

130139
// Only the part of ABI that is needed by deployment (and address resolution)

0 commit comments

Comments
 (0)