@1llet.xyz/erc4337-gasless-sdk 0.1.4 → 0.1.6
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/README.md +15 -6
- package/package.json +1 -1
- package/src/index.ts +1 -0
package/README.md
CHANGED
|
@@ -138,12 +138,21 @@ const isDeployed = await aa.isAccountDeployed();
|
|
|
138
138
|
// Get the Counterfactual Address (deterministic address based on owner)
|
|
139
139
|
const address = await aa.getSmartAccountAddress(ownerAddress);
|
|
140
140
|
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
// Deploy the account (Abstracts build -> sign -> send -> wait)
|
|
142
|
+
// Returns the transaction receipt
|
|
143
|
+
const receipt = await aa.deployAccount();
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Simplified Approvals
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
// Approve a token for a spender (e.g. Smart Account)
|
|
150
|
+
// Automatically handles:
|
|
151
|
+
// 1. Checks if funding is needed (Gasless flow support)
|
|
152
|
+
// 2. Encodes function data
|
|
153
|
+
// 3. Sends transaction via Wallet
|
|
154
|
+
// Returns the txHash or "NOT_NEEDED"
|
|
155
|
+
const txHash = await aa.approveToken(usdcAddress, spenderAddress, amount);
|
|
147
156
|
```
|
|
148
157
|
|
|
149
158
|
### Utilities
|
package/package.json
CHANGED
package/src/index.ts
CHANGED