@paxoslabs/amplify-sdk 0.2.0-beta.0 → 0.2.0-beta.2
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/CHANGELOG.md +2 -0
- package/README.md +18 -7
- package/dist/{chunk-TF3S7T6P.js → chunk-4ZYCWOFI.js} +8 -8
- package/dist/{chunk-TF3S7T6P.js.map → chunk-4ZYCWOFI.js.map} +1 -1
- package/dist/{chunk-EWJDKRSY.js → chunk-CK3BIPWI.js} +2 -2
- package/dist/{chunk-EWJDKRSY.js.map → chunk-CK3BIPWI.js.map} +1 -1
- package/dist/{chunk-4ORV7PFT.mjs → chunk-E3JM2RCC.mjs} +3 -3
- package/dist/{chunk-4ORV7PFT.mjs.map → chunk-E3JM2RCC.mjs.map} +1 -1
- package/dist/{chunk-SMIA4ULA.js → chunk-IJBG5TTI.js} +19 -19
- package/dist/{chunk-SMIA4ULA.js.map → chunk-IJBG5TTI.js.map} +1 -1
- package/dist/{chunk-YDMFT2R7.mjs → chunk-NZDHFDPQ.mjs} +2 -2
- package/dist/{chunk-YDMFT2R7.mjs.map → chunk-NZDHFDPQ.mjs.map} +1 -1
- package/dist/{chunk-WWTNCRXX.js → chunk-RSQQMUEQ.js} +4 -4
- package/dist/{chunk-WWTNCRXX.js.map → chunk-RSQQMUEQ.js.map} +1 -1
- package/dist/{chunk-UURNMLRT.mjs → chunk-RZN7S23Z.mjs} +3 -3
- package/dist/{chunk-UURNMLRT.mjs.map → chunk-RZN7S23Z.mjs.map} +1 -1
- package/dist/{chunk-Y3QNUDV6.mjs → chunk-VZ3D7CNR.mjs} +3 -3
- package/dist/{chunk-Y3QNUDV6.mjs.map → chunk-VZ3D7CNR.mjs.map} +1 -1
- package/dist/{chunk-LJPJWJ2Y.mjs → chunk-WDPR2NKT.mjs} +4 -4
- package/dist/{chunk-LJPJWJ2Y.mjs.map → chunk-WDPR2NKT.mjs.map} +1 -1
- package/dist/{chunk-76SRRIGW.js → chunk-ZRI7KBQ6.js} +8 -8
- package/dist/{chunk-76SRRIGW.js.map → chunk-ZRI7KBQ6.js.map} +1 -1
- package/dist/core.js +14 -14
- package/dist/core.mjs +4 -4
- package/dist/display.js +12 -12
- package/dist/display.mjs +4 -4
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +115 -115
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/utils.js +5 -5
- package/dist/utils.mjs +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
<!-- auto-changelog-above -->
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
## [0.1.1](///compare/v0.1.1-beta.1...v0.1.1) (2025-12-10)
|
|
12
|
+
|
|
11
13
|
## [0.1.1-beta.0](///compare/v0.1.1-alpha.5...v0.1.1-beta.0) (2025-12-10)
|
|
12
14
|
|
|
13
15
|
## [0.1.1-alpha.5](///compare/v0.1.1-alpha.4...v0.1.1-alpha.5) (2025-12-10)
|
package/README.md
CHANGED
|
@@ -63,22 +63,33 @@ const auth = await prepareDepositAuthorization({
|
|
|
63
63
|
chainId: 1,
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
+
// Shared deposit parameters
|
|
67
|
+
const depositParams = {
|
|
68
|
+
yieldType: "PRIME",
|
|
69
|
+
depositToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
70
|
+
depositAmount: "1000.0",
|
|
71
|
+
recipientAddress: userAddress,
|
|
72
|
+
chainId: 1,
|
|
73
|
+
};
|
|
74
|
+
|
|
66
75
|
// Handle based on authorization method
|
|
67
76
|
if (auth.method === DepositAuthMethod.PERMIT) {
|
|
77
|
+
// Token supports EIP-2612: sign permit and deposit in one transaction
|
|
68
78
|
const signature = await signTypedData(auth.permitData);
|
|
69
79
|
const tx = await prepareDeposit({
|
|
70
|
-
|
|
71
|
-
depositToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
72
|
-
depositAmount: "1000.0",
|
|
73
|
-
recipientAddress: userAddress,
|
|
74
|
-
chainId: 1,
|
|
80
|
+
...depositParams,
|
|
75
81
|
signature,
|
|
76
82
|
deadline: auth.permitData.message.deadline,
|
|
77
83
|
});
|
|
78
84
|
await writeContract(tx.txData);
|
|
79
85
|
} else if (auth.method === DepositAuthMethod.APPROVAL) {
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
// Token requires ERC20 approval: approve first, then deposit
|
|
87
|
+
await writeContract(auth.txData);
|
|
88
|
+
const tx = await prepareDeposit(depositParams);
|
|
89
|
+
await writeContract(tx.txData);
|
|
90
|
+
} else if (auth.method === DepositAuthMethod.ALREADY_APPROVED) {
|
|
91
|
+
// Sufficient allowance exists: proceed directly to deposit
|
|
92
|
+
const tx = await prepareDeposit(depositParams);
|
|
82
93
|
await writeContract(tx.txData);
|
|
83
94
|
}
|
|
84
95
|
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkRUIAH5HY_js = require('./chunk-RUIAH5HY.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkCK3BIPWI_js = require('./chunk-CK3BIPWI.js');
|
|
5
5
|
var viem = require('viem');
|
|
6
6
|
|
|
7
7
|
// src/abi/erc2612-abi.ts
|
|
@@ -57,9 +57,9 @@ var getClient = async (chainId) => {
|
|
|
57
57
|
throw new Error("Chain ID is required");
|
|
58
58
|
}
|
|
59
59
|
if (!clients.has(chainId)) {
|
|
60
|
-
const chain = await
|
|
60
|
+
const chain = await chunkCK3BIPWI_js.getChainFromConfig(
|
|
61
61
|
chunkRUIAH5HY_js.toChainId(chainId),
|
|
62
|
-
await
|
|
62
|
+
await chunkCK3BIPWI_js.fetchVaults()
|
|
63
63
|
);
|
|
64
64
|
const client2 = viem.createPublicClient({
|
|
65
65
|
chain,
|
|
@@ -193,7 +193,7 @@ var getTokenPermitInfoWithAllowance = async ({
|
|
|
193
193
|
versionResult
|
|
194
194
|
] = results;
|
|
195
195
|
if (decimalsResult.status === "failure") {
|
|
196
|
-
throw new
|
|
196
|
+
throw new chunkCK3BIPWI_js.APIError(
|
|
197
197
|
`Failed to read decimals from token ${tokenAddress}: ${decimalsResult.error?.message || "Unknown error"}`,
|
|
198
198
|
{
|
|
199
199
|
endpoint: "getTokenPermitInfoWithAllowance",
|
|
@@ -202,7 +202,7 @@ var getTokenPermitInfoWithAllowance = async ({
|
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
204
|
if (allowanceResult.status === "failure") {
|
|
205
|
-
throw new
|
|
205
|
+
throw new chunkCK3BIPWI_js.APIError(
|
|
206
206
|
`Failed to read allowance from token ${tokenAddress}: ${allowanceResult.error?.message || "Unknown error"}`,
|
|
207
207
|
{
|
|
208
208
|
endpoint: "getTokenPermitInfoWithAllowance",
|
|
@@ -211,7 +211,7 @@ var getTokenPermitInfoWithAllowance = async ({
|
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
213
|
if (nameResult.status === "failure") {
|
|
214
|
-
throw new
|
|
214
|
+
throw new chunkCK3BIPWI_js.APIError(
|
|
215
215
|
`Failed to read name from token ${tokenAddress}: ${nameResult.error?.message || "Unknown error"}`,
|
|
216
216
|
{
|
|
217
217
|
endpoint: "getTokenPermitInfoWithAllowance",
|
|
@@ -2199,5 +2199,5 @@ exports.getErc20Decimals = getErc20Decimals;
|
|
|
2199
2199
|
exports.getRateInQuoteAndSharesAndWantAssetDecimals = getRateInQuoteAndSharesAndWantAssetDecimals;
|
|
2200
2200
|
exports.getRateInQuoteWithAssetDecimals = getRateInQuoteWithAssetDecimals;
|
|
2201
2201
|
exports.getTokenPermitInfoWithAllowance = getTokenPermitInfoWithAllowance;
|
|
2202
|
-
//# sourceMappingURL=chunk-
|
|
2203
|
-
//# sourceMappingURL=chunk-
|
|
2202
|
+
//# sourceMappingURL=chunk-4ZYCWOFI.js.map
|
|
2203
|
+
//# sourceMappingURL=chunk-4ZYCWOFI.js.map
|