anymal-protocol 1.0.119 → 1.0.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +0 -10
- package/dist/index.mjs +9 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1787,16 +1787,6 @@ async function waitForReceiptWithRetries(bundlerClient, hash, retries = 3, delay
|
|
|
1787
1787
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
1788
1788
|
async function processDirectPartialPayment(marketplaceContract, smartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) {
|
|
1789
1789
|
try {
|
|
1790
|
-
const publicClient = bundlerClient.client;
|
|
1791
|
-
const allowance = await publicClient.readContract({
|
|
1792
|
-
abi: import_viem2.erc20Abi,
|
|
1793
|
-
address: marketplaceContract,
|
|
1794
|
-
functionName: "allowance",
|
|
1795
|
-
args: [smartAccount.address, marketplaceContract]
|
|
1796
|
-
});
|
|
1797
|
-
if (allowance < amountInTokens) {
|
|
1798
|
-
return { success: false, message: "Insufficient allowance for direct partial payment." };
|
|
1799
|
-
}
|
|
1800
1790
|
const partialPayCalldata = (0, import_viem2.encodeFunctionData)({
|
|
1801
1791
|
abi: MARKETPLACE_ABI,
|
|
1802
1792
|
functionName: "partialPay",
|
package/dist/index.mjs
CHANGED
|
@@ -1668,7 +1668,7 @@ function useFetchAnymals() {
|
|
|
1668
1668
|
import { useCallback as useCallback17 } from "react";
|
|
1669
1669
|
|
|
1670
1670
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
1671
|
-
import { encodeFunctionData as encodeFunctionData2
|
|
1671
|
+
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
1672
1672
|
|
|
1673
1673
|
// src/helpers/SendUserOpWithRetries.tsx
|
|
1674
1674
|
async function sendUserOpWithRetries(bundlerClient, params, retries = 3, delay = 1e3) {
|
|
@@ -1717,16 +1717,6 @@ async function waitForReceiptWithRetries(bundlerClient, hash, retries = 3, delay
|
|
|
1717
1717
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
1718
1718
|
async function processDirectPartialPayment(marketplaceContract, smartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) {
|
|
1719
1719
|
try {
|
|
1720
|
-
const publicClient = bundlerClient.client;
|
|
1721
|
-
const allowance = await publicClient.readContract({
|
|
1722
|
-
abi: erc20Abi,
|
|
1723
|
-
address: marketplaceContract,
|
|
1724
|
-
functionName: "allowance",
|
|
1725
|
-
args: [smartAccount.address, marketplaceContract]
|
|
1726
|
-
});
|
|
1727
|
-
if (allowance < amountInTokens) {
|
|
1728
|
-
return { success: false, message: "Insufficient allowance for direct partial payment." };
|
|
1729
|
-
}
|
|
1730
1720
|
const partialPayCalldata = encodeFunctionData2({
|
|
1731
1721
|
abi: MARKETPLACE_ABI,
|
|
1732
1722
|
functionName: "partialPay",
|
|
@@ -1823,11 +1813,11 @@ function useProcessPartialKibblePayment() {
|
|
|
1823
1813
|
import { useCallback as useCallback18 } from "react";
|
|
1824
1814
|
|
|
1825
1815
|
// src/helpers/ProcessDirectKibbleApproval.tsx
|
|
1826
|
-
import { encodeFunctionData as encodeFunctionData3, erc20Abi
|
|
1816
|
+
import { encodeFunctionData as encodeFunctionData3, erc20Abi } from "viem";
|
|
1827
1817
|
async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, smartAccount, bundlerClient, approveAmount) {
|
|
1828
1818
|
try {
|
|
1829
1819
|
const approveCalldata = encodeFunctionData3({
|
|
1830
|
-
abi:
|
|
1820
|
+
abi: erc20Abi,
|
|
1831
1821
|
functionName: "approve",
|
|
1832
1822
|
args: [spenderAddress, approveAmount]
|
|
1833
1823
|
});
|
|
@@ -1973,10 +1963,10 @@ function useCreateOrganizationBase() {
|
|
|
1973
1963
|
import { useCallback as useCallback20 } from "react";
|
|
1974
1964
|
|
|
1975
1965
|
// src/helpers/ProcessOrgKibbleApproval.tsx
|
|
1976
|
-
import { encodeFunctionData as encodeFunctionData5, erc20Abi as
|
|
1966
|
+
import { encodeFunctionData as encodeFunctionData5, erc20Abi as erc20Abi3 } from "viem";
|
|
1977
1967
|
|
|
1978
1968
|
// src/helpers/WaitForAllowance.tsx
|
|
1979
|
-
import { erc20Abi as
|
|
1969
|
+
import { erc20Abi as erc20Abi2 } from "viem";
|
|
1980
1970
|
async function waitForAllowance(publicClient, tokenAddress, ownerAddress, spenderAddress, expectedAmount) {
|
|
1981
1971
|
const MAX_RETRIES = 10;
|
|
1982
1972
|
const RETRY_INTERVAL = 2e3;
|
|
@@ -1985,7 +1975,7 @@ async function waitForAllowance(publicClient, tokenAddress, ownerAddress, spende
|
|
|
1985
1975
|
try {
|
|
1986
1976
|
const currentAllowance = await publicClient.readContract({
|
|
1987
1977
|
address: tokenAddress,
|
|
1988
|
-
abi:
|
|
1978
|
+
abi: erc20Abi2,
|
|
1989
1979
|
functionName: "allowance",
|
|
1990
1980
|
args: [ownerAddress, spenderAddress]
|
|
1991
1981
|
});
|
|
@@ -2011,7 +2001,7 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
2011
2001
|
return { success: false, message: "Approval amount must be greater than zero." };
|
|
2012
2002
|
}
|
|
2013
2003
|
const approveCalldata = encodeFunctionData5({
|
|
2014
|
-
abi:
|
|
2004
|
+
abi: erc20Abi3,
|
|
2015
2005
|
functionName: "approve",
|
|
2016
2006
|
args: [partialPaymentModuleAddress, approveAmount]
|
|
2017
2007
|
});
|
|
@@ -2494,14 +2484,14 @@ function useCreateOrganizationAppData() {
|
|
|
2494
2484
|
|
|
2495
2485
|
// src/utils/balance/useFetchBalance.ts
|
|
2496
2486
|
import { useCallback as useCallback27 } from "react";
|
|
2497
|
-
import { erc20Abi as
|
|
2487
|
+
import { erc20Abi as erc20Abi4, getAddress } from "viem";
|
|
2498
2488
|
function useFetchBalance() {
|
|
2499
2489
|
return useCallback27(
|
|
2500
2490
|
async (publicClient, walletAddress, kibbleTokenAddress) => {
|
|
2501
2491
|
try {
|
|
2502
2492
|
const balance = await publicClient.readContract({
|
|
2503
2493
|
address: getAddress(kibbleTokenAddress),
|
|
2504
|
-
abi:
|
|
2494
|
+
abi: erc20Abi4,
|
|
2505
2495
|
functionName: "balanceOf",
|
|
2506
2496
|
args: [getAddress(walletAddress)]
|
|
2507
2497
|
});
|
package/package.json
CHANGED