four-flap-meme-sdk 1.5.39 → 1.5.40
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/xlayer/bundle.js +6 -7
- package/dist/xlayer/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/xlayer/bundle.js
CHANGED
|
@@ -1420,16 +1420,15 @@ export class BundleExecutor {
|
|
|
1420
1420
|
* ```
|
|
1421
1421
|
*/
|
|
1422
1422
|
async bundlePreApprove(params) {
|
|
1423
|
-
const { tokenAddress, privateKeys, spender = FLAP_PORTAL, signOnly = false, config } = params;
|
|
1423
|
+
const { tokenAddress, privateKeys, spender = FLAP_PORTAL, signOnly = false, config, payerPrivateKey } = params;
|
|
1424
1424
|
const sharedProvider = this.aaManager.getProvider();
|
|
1425
1425
|
const wallets = privateKeys.map((pk) => new Wallet(pk, sharedProvider));
|
|
1426
|
-
|
|
1426
|
+
// 如果提供了 payerPrivateKey,使用它作为 bundlerSigner(特别是 signOnly 模式下,payer 可能是单独的账号)
|
|
1427
|
+
// 否则默认使用第一个 owner
|
|
1428
|
+
const bundlerSigner = payerPrivateKey
|
|
1429
|
+
? new Wallet(payerPrivateKey, sharedProvider)
|
|
1430
|
+
: wallets[0];
|
|
1427
1431
|
const beneficiary = bundlerSigner.address;
|
|
1428
|
-
console.log('=== XLayer Bundle Pre-Approve ===');
|
|
1429
|
-
console.log('token:', tokenAddress);
|
|
1430
|
-
console.log('spender:', spender);
|
|
1431
|
-
console.log('owners:', wallets.length);
|
|
1432
|
-
console.log('signOnly:', signOnly);
|
|
1433
1432
|
// 1. 批量获取账户信息
|
|
1434
1433
|
const accountInfos = await this.aaManager.getMultipleAccountInfo(wallets.map((w) => w.address));
|
|
1435
1434
|
const senders = accountInfos.map((ai) => ai.sender);
|
package/dist/xlayer/types.d.ts
CHANGED