Skip to content

Commit

Permalink
Merge pull request #478 from WatchItDev/refactor/approve
Browse files Browse the repository at this point in the history
feat: change "reserve" with "approve" and update the ledger vault abi
  • Loading branch information
geolffreym authored Jan 22, 2025
2 parents 8354812 + ad265e6 commit ad74908
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# [2.2.0-beta.14](https://github.com/WatchItDev/watchit-app/compare/v2.2.0-beta.13...v2.2.0-beta.14) (2025-01-21)


### Bug Fixes

* update typo in Sentry DSN and adjust minor details ([9c83319](https://github.com/WatchItDev/watchit-app/commit/9c8331977a036e3a87ac587dc47972fda8486d56))


### Features

* add validation for email invitations and improve UX ([bc3f9ce](https://github.com/WatchItDev/watchit-app/commit/bc3f9cea2bf7ff6ab8cc2beb714299ccb70fee36))
* enhance avatar styling with font and background changes ([2a7ce4c](https://github.com/WatchItDev/watchit-app/commit/2a7ce4c918d666a19494ab2fb5bdf4acb34be848))
* **profile-header:** update social share hashtags on X ([f6e2c36](https://github.com/WatchItDev/watchit-app/commit/f6e2c36b2bed772d8eff5fb39df8c8c066052693))
* update verified badge color to gold ([428ae78](https://github.com/WatchItDev/watchit-app/commit/428ae78c6fe12b24f83d1d1467bb13bbb77368ab)), closes [#cca421](https://github.com/WatchItDev/watchit-app/issues/cca421)

# [2.2.0-beta.13](https://github.com/WatchItDev/watchit-app/compare/v2.2.0-beta.12...v2.2.0-beta.13) (2025-01-20)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "watchit",
"author": "Watchit",
"type": "module",
"version": "2.2.0-beta.13",
"version": "2.2.0-beta.14",
"description": "Open videos everywhere",
"email": "info@watchit.movie",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion src/config/abi/LedgerVault.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/hooks/use-subscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export const useSubscribe = (): UseSubscribeHook => {
const sessionData = useSelector((state: any) => state.auth.session);
const { bundlerClient, smartAccount } = useWeb3Session();

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

// Prepare the transfer to access agreement
const transferToAccessAgreementData = transferToAccessAgreement(approvalAmountInWei);
// Prepare the approve to access agreement
const approveToAccessAgreementData = approveToAccessAgreement(approvalAmountInWei);

// Prepare the access agreement data
const registerAccessAgreementData = registerAccessAgreement(
Expand All @@ -117,7 +117,7 @@ export const useSubscribe = (): UseSubscribeHook => {
{
to: GLOBAL_CONSTANTS.LEDGER_VAULT_ADDRESS,
value: 0,
data: transferToAccessAgreementData,
data: approveToAccessAgreementData,
},
{
to: GLOBAL_CONSTANTS.ACCESS_WORKFLOW_ADDRESS,
Expand Down

0 comments on commit ad74908

Please sign in to comment.