Skip to content

Commit ad265e6

Browse files
committed
feat: change "reserve" with "approve" and update the ledger vault abi
1 parent c10e1c1 commit ad265e6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/config/abi/LedgerVault.json

+1-1
Large diffs are not rendered by default.

src/hooks/use-subscribe.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export const useSubscribe = (): UseSubscribeHook => {
4545
const sessionData = useSelector((state: any) => state.auth.session);
4646
const { bundlerClient, smartAccount } = useWeb3Session();
4747

48-
const transferToAccessAgreement = (approvalAmount: bigint): string => {
48+
const approveToAccessAgreement = (approvalAmount: bigint): string => {
4949
return encodeFunctionData({
5050
abi: LedgerVaultabi.abi,
51-
functionName: 'reserve',
51+
functionName: 'approve',
5252
args: [
5353
GLOBAL_CONSTANTS.ACCESS_WORKFLOW_ADDRESS,
5454
approvalAmount,
@@ -101,8 +101,8 @@ export const useSubscribe = (): UseSubscribeHook => {
101101
const parties = [sessionData?.profile?.ownedBy.address]; // The parties involved in the agreement (e.g., the user's address)
102102
const payload = '0x'; // Additional payload data if needed
103103

104-
// Prepare the transfer to access agreement
105-
const transferToAccessAgreementData = transferToAccessAgreement(approvalAmountInWei);
104+
// Prepare the approve to access agreement
105+
const approveToAccessAgreementData = approveToAccessAgreement(approvalAmountInWei);
106106

107107
// Prepare the access agreement data
108108
const registerAccessAgreementData = registerAccessAgreement(
@@ -117,7 +117,7 @@ export const useSubscribe = (): UseSubscribeHook => {
117117
{
118118
to: GLOBAL_CONSTANTS.LEDGER_VAULT_ADDRESS,
119119
value: 0,
120-
data: transferToAccessAgreementData,
120+
data: approveToAccessAgreementData,
121121
},
122122
{
123123
to: GLOBAL_CONSTANTS.ACCESS_WORKFLOW_ADDRESS,

0 commit comments

Comments
 (0)