@keelcodes/sdk 2.6.0 → 2.7.0
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.
|
@@ -13,6 +13,22 @@ export declare function encodeKernelFactoryData(chainConfig: ChainAAConfig, owne
|
|
|
13
13
|
factory: Address;
|
|
14
14
|
factoryData: Hex;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* 构建「用户钱包直接部署智能账户」的普通交易(**不是** UserOp)。
|
|
18
|
+
*
|
|
19
|
+
* 产品上的「点击创建智能账户」应走这条:用户 EOA 直接发这笔交易调 factory,
|
|
20
|
+
* gas 从 EOA 自身 native 余额扣,不经过 EntryPoint / paymaster。部署完成后
|
|
21
|
+
* 账户已存在,后续 UserOp 不再携带 factory/factoryData;账户零 native 时的
|
|
22
|
+
* 首笔 `approve(paymaster, amount)` 才需要 voucher 垫付。
|
|
23
|
+
*
|
|
24
|
+
* 懒部署路径(把 factoryData 塞进首笔 UserOp,由 EntryPoint 统一收 gas)与之
|
|
25
|
+
* 地址一致(同 owner + salt),可随时切换。
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildCreateAccountTx(chainConfig: ChainAAConfig, owner: Address, salt?: bigint): {
|
|
28
|
+
to: Address;
|
|
29
|
+
data: Hex;
|
|
30
|
+
value: 0n;
|
|
31
|
+
};
|
|
16
32
|
/** 从 createAccount 编码中解包 (data, salt) —— 供 factory.getAddress 预测复用。 */
|
|
17
33
|
export declare function unpackFactoryData(factoryData: Hex): {
|
|
18
34
|
data: Hex;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.encodeKernelInitialize = encodeKernelInitialize;
|
|
21
21
|
exports.encodeKernelFactoryData = encodeKernelFactoryData;
|
|
22
|
+
exports.buildCreateAccountTx = buildCreateAccountTx;
|
|
22
23
|
exports.unpackFactoryData = unpackFactoryData;
|
|
23
24
|
exports.predictAccountAddress = predictAccountAddress;
|
|
24
25
|
const viem_1 = require("viem");
|
|
@@ -99,6 +100,21 @@ function encodeKernelFactoryData(chainConfig, owner, salt = 0n) {
|
|
|
99
100
|
}),
|
|
100
101
|
};
|
|
101
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* 构建「用户钱包直接部署智能账户」的普通交易(**不是** UserOp)。
|
|
105
|
+
*
|
|
106
|
+
* 产品上的「点击创建智能账户」应走这条:用户 EOA 直接发这笔交易调 factory,
|
|
107
|
+
* gas 从 EOA 自身 native 余额扣,不经过 EntryPoint / paymaster。部署完成后
|
|
108
|
+
* 账户已存在,后续 UserOp 不再携带 factory/factoryData;账户零 native 时的
|
|
109
|
+
* 首笔 `approve(paymaster, amount)` 才需要 voucher 垫付。
|
|
110
|
+
*
|
|
111
|
+
* 懒部署路径(把 factoryData 塞进首笔 UserOp,由 EntryPoint 统一收 gas)与之
|
|
112
|
+
* 地址一致(同 owner + salt),可随时切换。
|
|
113
|
+
*/
|
|
114
|
+
function buildCreateAccountTx(chainConfig, owner, salt = 0n) {
|
|
115
|
+
const { factory, factoryData } = encodeKernelFactoryData(chainConfig, owner, salt);
|
|
116
|
+
return { to: factory, data: factoryData, value: 0n };
|
|
117
|
+
}
|
|
102
118
|
/** 从 createAccount 编码中解包 (data, salt) —— 供 factory.getAddress 预测复用。 */
|
|
103
119
|
function unpackFactoryData(factoryData) {
|
|
104
120
|
const body = factoryData.slice(10);
|
|
@@ -117,6 +117,17 @@ export interface SolanaDexSwapParams {
|
|
|
117
117
|
swapInstructions?: DexInstruction[];
|
|
118
118
|
/** external 模式的地址查找表(`dexProvider` 会自动填充) */
|
|
119
119
|
addressLookupTableAddresses?: string[];
|
|
120
|
+
/**
|
|
121
|
+
* 代建 ATA 的租金付款人(2026-10-24)。给出后 relay 把内层 ATA create 的
|
|
122
|
+
* payer 从 vault 换成该地址,vault 无需持有 SOL。必须是本交易的签名者
|
|
123
|
+
* (通常就是 `feePayer`),否则交易签不出来。
|
|
124
|
+
*/
|
|
125
|
+
rentPayer?: string;
|
|
126
|
+
/**
|
|
127
|
+
* 同交易扣费(`AA_SOLANA_FEE_MODE=onchain`)的付费稳定币 mint。
|
|
128
|
+
* 缺省按 USDC → USDT → 输出币 自动选;指定后不使用其它币种。
|
|
129
|
+
*/
|
|
130
|
+
feeMint?: string;
|
|
120
131
|
}
|
|
121
132
|
export interface SolanaDexSwapResult {
|
|
122
133
|
chain: string;
|
package/package.json
CHANGED