@1llet.xyz/erc4337-gasless-sdk 0.1.1 → 0.1.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/README.md +43 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,6 +114,48 @@ npm install
|
|
|
114
114
|
npm run build
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
##
|
|
117
|
+
## � API Reference
|
|
118
|
+
|
|
119
|
+
### Balances & Allowances
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
// Get Smart Account USDC Balance
|
|
123
|
+
const balance = await aa.getUsdcBalance();
|
|
124
|
+
|
|
125
|
+
// Get EOA (Wallet) USDC Balance
|
|
126
|
+
const eoaBalance = await aa.getEoaUsdcBalance();
|
|
127
|
+
|
|
128
|
+
// Check how much USDC the Smart Account is allowed to spend from EOA
|
|
129
|
+
const allowance = await aa.getAllowance();
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Account Management
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
// Check if the Smart Account is already deployed on-chain
|
|
136
|
+
const isDeployed = await aa.isAccountDeployed();
|
|
137
|
+
|
|
138
|
+
// Get the Counterfactual Address (deterministic address based on owner)
|
|
139
|
+
const address = await aa.getSmartAccountAddress(ownerAddress);
|
|
140
|
+
|
|
141
|
+
// Manually deploy the account (if you don't want to bundle it with a tx)
|
|
142
|
+
if (!isDeployed) {
|
|
143
|
+
const deployOp = await aa.buildDeployUserOperation();
|
|
144
|
+
const signed = await aa.signUserOperation(deployOp);
|
|
145
|
+
await aa.sendUserOperation(signed);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Utilities
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
// Get current Nonce
|
|
153
|
+
const nonce = await aa.getNonce();
|
|
154
|
+
|
|
155
|
+
// Get UserOp Hash (for manual signing or verification)
|
|
156
|
+
const hash = aa.getUserOpHash(userOp);
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## �📄 License
|
|
118
160
|
|
|
119
161
|
MIT
|