Skip to content

Commit 9266dbf

Browse files
fix: merge conflicts
Signed-off-by: jaime-iobermudez <jaime.bermudez@io.builders>
1 parent 1c6eab2 commit 9266dbf

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

sdk/src/core/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ export const GAS = {
345345
RECOVERY_ADDRESS: 7000000,
346346
ADD_AGENT: 7000000,
347347
REMOVE_AGENT: 7000000,
348+
REDEEM_AT_MATURITY_BY_PARTITION_GAS: 700000,
348349
} as const;
349350

350351
export const REDEEM_AT_MATURITY_BY_PARTITION_GAS = 700000;

sdk/src/port/out/hs/HederaTransactionAdapter.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,6 +3088,26 @@ export abstract class HederaTransactionAdapter extends TransactionAdapter {
30883088
);
30893089
}
30903090

3091+
async redeemAtMaturityByPartition(
3092+
security: EvmAddress,
3093+
partitionId: string,
3094+
sourceId: EvmAddress,
3095+
amount: BigDecimal,
3096+
securityId: ContractId | string,
3097+
): Promise<TransactionResponse> {
3098+
LogService.logTrace(
3099+
`Redeeming at maturity by partition to address ${security.toString()}`,
3100+
);
3101+
const contract = new Contract(security.toString(), Bond__factory.abi);
3102+
return this.executeWithArgs(
3103+
contract,
3104+
'redeemAtMaturityByPartition',
3105+
securityId,
3106+
GAS.REDEEM_AT_MATURITY_BY_PARTITION_GAS,
3107+
[sourceId.toString(), partitionId, amount.toBigNumber()],
3108+
);
3109+
}
3110+
30913111
// * Definition of the abstract methods
30923112
abstract signAndSendTransaction(
30933113
transaction: Transaction,

sdk/src/port/out/rpc/RPCTransactionAdapter.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,6 +2912,24 @@ export class RPCTransactionAdapter extends TransactionAdapter {
29122912
);
29132913
}
29142914

2915+
async redeemAtMaturityByPartition(
2916+
security: EvmAddress,
2917+
partitionId: string,
2918+
sourceId: EvmAddress,
2919+
amount: BigDecimal,
2920+
): Promise<TransactionResponse> {
2921+
LogService.logTrace(
2922+
`Redeeming at maturity by partition to address ${security.toString()}`,
2923+
);
2924+
2925+
return this.executeTransaction(
2926+
Bond__factory.connect(security.toString(), this.getSignerOrProvider()),
2927+
'redeemAtMaturityByPartition',
2928+
[sourceId.toString(), partitionId, amount.toBigNumber()],
2929+
GAS.REDEEM_AT_MATURITY_BY_PARTITION_GAS,
2930+
);
2931+
}
2932+
29152933
private async executeTransaction<T>(
29162934
factory: any,
29172935
method: string,

0 commit comments

Comments
 (0)