@morpho-org/consumer-sdk 0.1.0 → 0.1.1
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.
|
@@ -49,6 +49,7 @@ const getRequirements = async (viemClient, params) => {
|
|
|
49
49
|
chainId,
|
|
50
50
|
permit2,
|
|
51
51
|
args: { amount },
|
|
52
|
+
allowancesGeneralAdapter: erc20Allowances["bundler3.generalAdapter1"],
|
|
52
53
|
allowancesPermit2: erc20Allowances.permit2,
|
|
53
54
|
allowanceGeneralAdapterPermit2: permit2BundlerAllowance.amount,
|
|
54
55
|
allowanceGeneralAdapterExpiration: permit2BundlerAllowance.expiration,
|
|
@@ -15,6 +15,7 @@ import type { ERC20ApprovalAction, Requirement, Transaction } from "../../types"
|
|
|
15
15
|
* @param params.permit2 - Permit2 contract address.
|
|
16
16
|
* @param params.args - Object with:
|
|
17
17
|
* @param params.args.amount - Required token amount.
|
|
18
|
+
* @param params.allowancesGeneralAdapter - Allowance for general adapter from permit2 contract.
|
|
18
19
|
* @param params.allowancesPermit2 - Allowance for permit2.
|
|
19
20
|
* @param params.allowanceGeneralAdapterPermit2 - Allowance for general adapter from permit2 contract.
|
|
20
21
|
* @param params.allowanceGeneralAdapterExpiration - Expiration for general adapter from permit2 contract.
|
|
@@ -29,6 +30,7 @@ export declare const getRequirementsPermit2: (params: {
|
|
|
29
30
|
amount: bigint;
|
|
30
31
|
};
|
|
31
32
|
allowancesPermit2: bigint;
|
|
33
|
+
allowancesGeneralAdapter: bigint;
|
|
32
34
|
allowanceGeneralAdapterPermit2: bigint;
|
|
33
35
|
allowanceGeneralAdapterExpiration: bigint;
|
|
34
36
|
nonce: bigint;
|
|
@@ -20,6 +20,7 @@ const getRequirementsApproval_1 = require("./getRequirementsApproval");
|
|
|
20
20
|
* @param params.permit2 - Permit2 contract address.
|
|
21
21
|
* @param params.args - Object with:
|
|
22
22
|
* @param params.args.amount - Required token amount.
|
|
23
|
+
* @param params.allowancesGeneralAdapter - Allowance for general adapter from permit2 contract.
|
|
23
24
|
* @param params.allowancesPermit2 - Allowance for permit2.
|
|
24
25
|
* @param params.allowanceGeneralAdapterPermit2 - Allowance for general adapter from permit2 contract.
|
|
25
26
|
* @param params.allowanceGeneralAdapterExpiration - Expiration for general adapter from permit2 contract.
|
|
@@ -27,7 +28,10 @@ const getRequirementsApproval_1 = require("./getRequirementsApproval");
|
|
|
27
28
|
* @returns An array of approval transaction or requirement signatures objects.
|
|
28
29
|
*/
|
|
29
30
|
const getRequirementsPermit2 = (params) => {
|
|
30
|
-
const { address, chainId, permit2, args: { amount }, allowancesPermit2, allowanceGeneralAdapterPermit2, allowanceGeneralAdapterExpiration, nonce, } = params;
|
|
31
|
+
const { address, chainId, permit2, args: { amount }, allowancesPermit2, allowancesGeneralAdapter, allowanceGeneralAdapterPermit2, allowanceGeneralAdapterExpiration, nonce, } = params;
|
|
32
|
+
if (allowancesGeneralAdapter >= amount) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
31
35
|
const requirements = [];
|
|
32
36
|
const approvalRequirements = (0, getRequirementsApproval_1.getRequirementsApproval)({
|
|
33
37
|
address,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morpho-org/consumer-sdk",
|
|
3
3
|
"description": "Abstraction layer for Morpho's complexity.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"author": "Morpho Association <contact@morpho.org>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Foulks-Plb <https://x.com/FoulkPlb>"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@biomejs/biome": "2.3.3",
|
|
22
22
|
"@changesets/cli": "^2.29.8",
|
|
23
|
-
"@morpho-org/test": "2.6.
|
|
23
|
+
"@morpho-org/test": "2.6.4",
|
|
24
24
|
"@types/node": "^24.9.1",
|
|
25
25
|
"@vitest/coverage-v8": "3.2.4",
|
|
26
26
|
"@vitest/ui": "3.2.4",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@morpho-org/blue-sdk": "5.
|
|
38
|
-
"@morpho-org/blue-sdk-viem": "4.1.
|
|
39
|
-
"@morpho-org/bundler-sdk-viem": "4.1.
|
|
40
|
-
"@morpho-org/morpho-ts": "^2.4.
|
|
41
|
-
"@morpho-org/simulation-sdk": "3.2.
|
|
37
|
+
"@morpho-org/blue-sdk": "^5.9.1",
|
|
38
|
+
"@morpho-org/blue-sdk-viem": "^4.1.4",
|
|
39
|
+
"@morpho-org/bundler-sdk-viem": "^4.1.3",
|
|
40
|
+
"@morpho-org/morpho-ts": "^2.4.6",
|
|
41
|
+
"@morpho-org/simulation-sdk": "^3.2.3",
|
|
42
42
|
"zod": "^4.1.12"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|