@funkit/core 0.8.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.
- package/README.md +110 -0
- package/dist/fetch-polyfill.d.ts +1 -0
- package/dist/fetch-polyfill.js +35 -0
- package/dist/fetch-polyfill.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/src/abis/ApproveAndExec.json +1 -0
- package/dist/src/abis/ApproveAndSwap.json +1 -0
- package/dist/src/abis/ERC20.json +1 -0
- package/dist/src/abis/ERC721.json +1 -0
- package/dist/src/abis/EntryPoint.json +1 -0
- package/dist/src/abis/EstimationPaymaster.json +1 -0
- package/dist/src/abis/FeePercentOracle.json +1 -0
- package/dist/src/abis/FunWallet.json +1 -0
- package/dist/src/abis/FunWalletFactory.json +1 -0
- package/dist/src/abis/GaslessPaymaster.json +1 -0
- package/dist/src/abis/LidoWithdrawQueue.json +1 -0
- package/dist/src/abis/RoleBasedAccessControl.json +1 -0
- package/dist/src/abis/TestNFT.json +1 -0
- package/dist/src/abis/TokenPaymaster.json +1 -0
- package/dist/src/abis/TokenPriceOracle.json +1 -0
- package/dist/src/abis/UniswapV2Factory.json +1 -0
- package/dist/src/abis/UniswapV2Router02.json +1 -0
- package/dist/src/abis/UniswapV3LimitOrder.json +1 -0
- package/dist/src/abis/UserAuthentication.json +1 -0
- package/dist/src/abis/univ3factory.json +1 -0
- package/dist/src/abis/univ3quoter.json +1 -0
- package/dist/src/abis/univ3router.json +1 -0
- package/dist/src/actions/AccessControl.d.ts +9 -0
- package/dist/src/actions/AccessControl.js +88 -0
- package/dist/src/actions/AccessControl.js.map +1 -0
- package/dist/src/actions/BatchActions.d.ts +3 -0
- package/dist/src/actions/BatchActions.js +12 -0
- package/dist/src/actions/BatchActions.js.map +1 -0
- package/dist/src/actions/FirstClassActions.d.ts +161 -0
- package/dist/src/actions/FirstClassActions.js +347 -0
- package/dist/src/actions/FirstClassActions.js.map +1 -0
- package/dist/src/actions/Group.d.ts +6 -0
- package/dist/src/actions/Group.js +44 -0
- package/dist/src/actions/Group.js.map +1 -0
- package/dist/src/actions/LimitOrder.d.ts +4 -0
- package/dist/src/actions/LimitOrder.js +45 -0
- package/dist/src/actions/LimitOrder.js.map +1 -0
- package/dist/src/actions/Stake.d.ts +8 -0
- package/dist/src/actions/Stake.js +124 -0
- package/dist/src/actions/Stake.js.map +1 -0
- package/dist/src/actions/Swap.d.ts +9 -0
- package/dist/src/actions/Swap.js +169 -0
- package/dist/src/actions/Swap.js.map +1 -0
- package/dist/src/actions/Token.d.ts +12 -0
- package/dist/src/actions/Token.js +102 -0
- package/dist/src/actions/Token.js.map +1 -0
- package/dist/src/actions/index.d.ts +7 -0
- package/dist/src/actions/index.js +24 -0
- package/dist/src/actions/index.js.map +1 -0
- package/dist/src/actions/types.d.ts +117 -0
- package/dist/src/actions/types.js +11 -0
- package/dist/src/actions/types.js.map +1 -0
- package/dist/src/apis/AccessControlApis.d.ts +5 -0
- package/dist/src/apis/AccessControlApis.js +22 -0
- package/dist/src/apis/AccessControlApis.js.map +1 -0
- package/dist/src/apis/AssetApis.d.ts +79 -0
- package/dist/src/apis/AssetApis.js +100 -0
- package/dist/src/apis/AssetApis.js.map +1 -0
- package/dist/src/apis/ContractApis.d.ts +1 -0
- package/dist/src/apis/ContractApis.js +11 -0
- package/dist/src/apis/ContractApis.js.map +1 -0
- package/dist/src/apis/GroupApis.d.ts +8 -0
- package/dist/src/apis/GroupApis.js +45 -0
- package/dist/src/apis/GroupApis.js.map +1 -0
- package/dist/src/apis/InfoApis.d.ts +6 -0
- package/dist/src/apis/InfoApis.js +59 -0
- package/dist/src/apis/InfoApis.js.map +1 -0
- package/dist/src/apis/ListenerApis.d.ts +3 -0
- package/dist/src/apis/ListenerApis.js +36 -0
- package/dist/src/apis/ListenerApis.js.map +1 -0
- package/dist/src/apis/NFTApis.d.ts +22 -0
- package/dist/src/apis/NFTApis.js +34 -0
- package/dist/src/apis/NFTApis.js.map +1 -0
- package/dist/src/apis/OnOffRampApis.d.ts +2 -0
- package/dist/src/apis/OnOffRampApis.js +23 -0
- package/dist/src/apis/OnOffRampApis.js.map +1 -0
- package/dist/src/apis/OnOffRampUtils.d.ts +2 -0
- package/dist/src/apis/OnOffRampUtils.js +23 -0
- package/dist/src/apis/OnOffRampUtils.js.map +1 -0
- package/dist/src/apis/OperationApis.d.ts +14 -0
- package/dist/src/apis/OperationApis.js +77 -0
- package/dist/src/apis/OperationApis.js.map +1 -0
- package/dist/src/apis/PaymasterApis.d.ts +15 -0
- package/dist/src/apis/PaymasterApis.js +89 -0
- package/dist/src/apis/PaymasterApis.js.map +1 -0
- package/dist/src/apis/UserApis.d.ts +12 -0
- package/dist/src/apis/UserApis.js +77 -0
- package/dist/src/apis/UserApis.js.map +1 -0
- package/dist/src/apis/index.d.ts +10 -0
- package/dist/src/apis/index.js +27 -0
- package/dist/src/apis/index.js.map +1 -0
- package/dist/src/apis/types.d.ts +49 -0
- package/dist/src/apis/types.js +3 -0
- package/dist/src/apis/types.js.map +1 -0
- package/dist/src/auth/Auth.d.ts +81 -0
- package/dist/src/auth/Auth.js +317 -0
- package/dist/src/auth/Auth.js.map +1 -0
- package/dist/src/auth/SessionKeyAuth.d.ts +19 -0
- package/dist/src/auth/SessionKeyAuth.js +118 -0
- package/dist/src/auth/SessionKeyAuth.js.map +1 -0
- package/dist/src/auth/index.d.ts +2 -0
- package/dist/src/auth/index.js +19 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/src/auth/types.d.ts +20 -0
- package/dist/src/auth/types.js +3 -0
- package/dist/src/auth/types.js.map +1 -0
- package/dist/src/common/constants.d.ts +1072 -0
- package/dist/src/common/constants.js +153 -0
- package/dist/src/common/constants.js.map +1 -0
- package/dist/src/common/index.d.ts +2 -0
- package/dist/src/common/index.js +19 -0
- package/dist/src/common/index.js.map +1 -0
- package/dist/src/common/types.d.ts +32 -0
- package/dist/src/common/types.js +3 -0
- package/dist/src/common/types.js.map +1 -0
- package/dist/src/config/Config.d.ts +3 -0
- package/dist/src/config/Config.js +46 -0
- package/dist/src/config/Config.js.map +1 -0
- package/dist/src/config/index.d.ts +2 -0
- package/dist/src/config/index.js +19 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/types.d.ts +21 -0
- package/dist/src/config/types.js +3 -0
- package/dist/src/config/types.js.map +1 -0
- package/dist/src/data/Chain.d.ts +29 -0
- package/dist/src/data/Chain.js +174 -0
- package/dist/src/data/Chain.js.map +1 -0
- package/dist/src/data/NFT.d.ts +24 -0
- package/dist/src/data/NFT.js +104 -0
- package/dist/src/data/NFT.js.map +1 -0
- package/dist/src/data/Operation.d.ts +33 -0
- package/dist/src/data/Operation.js +68 -0
- package/dist/src/data/Operation.js.map +1 -0
- package/dist/src/data/SolidityData.d.ts +8 -0
- package/dist/src/data/SolidityData.js +72 -0
- package/dist/src/data/SolidityData.js.map +1 -0
- package/dist/src/data/Token.d.ts +26 -0
- package/dist/src/data/Token.js +122 -0
- package/dist/src/data/Token.js.map +1 -0
- package/dist/src/data/index.d.ts +6 -0
- package/dist/src/data/index.js +23 -0
- package/dist/src/data/index.js.map +1 -0
- package/dist/src/data/types.d.ts +112 -0
- package/dist/src/data/types.js +25 -0
- package/dist/src/data/types.js.map +1 -0
- package/dist/src/errors/BaseError.d.ts +9 -0
- package/dist/src/errors/BaseError.js +23 -0
- package/dist/src/errors/BaseError.js.map +1 -0
- package/dist/src/errors/ClientError.d.ts +22 -0
- package/dist/src/errors/ClientError.js +75 -0
- package/dist/src/errors/ClientError.js.map +1 -0
- package/dist/src/errors/ServerError.d.ts +7 -0
- package/dist/src/errors/ServerError.js +18 -0
- package/dist/src/errors/ServerError.js.map +1 -0
- package/dist/src/errors/index.d.ts +4 -0
- package/dist/src/errors/index.js +21 -0
- package/dist/src/errors/index.js.map +1 -0
- package/dist/src/errors/types.d.ts +54 -0
- package/dist/src/errors/types.js +45 -0
- package/dist/src/errors/types.js.map +1 -0
- package/dist/src/sponsors/GaslessSponsor.d.ts +19 -0
- package/dist/src/sponsors/GaslessSponsor.js +91 -0
- package/dist/src/sponsors/GaslessSponsor.js.map +1 -0
- package/dist/src/sponsors/Sponsor.d.ts +31 -0
- package/dist/src/sponsors/Sponsor.js +94 -0
- package/dist/src/sponsors/Sponsor.js.map +1 -0
- package/dist/src/sponsors/TokenSponsor.d.ts +40 -0
- package/dist/src/sponsors/TokenSponsor.js +271 -0
- package/dist/src/sponsors/TokenSponsor.js.map +1 -0
- package/dist/src/sponsors/index.d.ts +3 -0
- package/dist/src/sponsors/index.js +20 -0
- package/dist/src/sponsors/index.js.map +1 -0
- package/dist/src/sponsors/types.d.ts +9 -0
- package/dist/src/sponsors/types.js +10 -0
- package/dist/src/sponsors/types.js.map +1 -0
- package/dist/src/utils/ApiUtils.d.ts +19 -0
- package/dist/src/utils/ApiUtils.js +97 -0
- package/dist/src/utils/ApiUtils.js.map +1 -0
- package/dist/src/utils/AuthUtils.d.ts +4 -0
- package/dist/src/utils/AuthUtils.js +54 -0
- package/dist/src/utils/AuthUtils.js.map +1 -0
- package/dist/src/utils/ChainUtils.d.ts +12 -0
- package/dist/src/utils/ChainUtils.js +89 -0
- package/dist/src/utils/ChainUtils.js.map +1 -0
- package/dist/src/utils/MerkleUtils.d.ts +18 -0
- package/dist/src/utils/MerkleUtils.js +96 -0
- package/dist/src/utils/MerkleUtils.js.map +1 -0
- package/dist/src/utils/PaymasterUtils.d.ts +3 -0
- package/dist/src/utils/PaymasterUtils.js +17 -0
- package/dist/src/utils/PaymasterUtils.js.map +1 -0
- package/dist/src/utils/SwapUtils.d.ts +35 -0
- package/dist/src/utils/SwapUtils.js +193 -0
- package/dist/src/utils/SwapUtils.js.map +1 -0
- package/dist/src/utils/TypeUtils.d.ts +1 -0
- package/dist/src/utils/TypeUtils.js +13 -0
- package/dist/src/utils/TypeUtils.js.map +1 -0
- package/dist/src/utils/UserOpUtils.d.ts +12 -0
- package/dist/src/utils/UserOpUtils.js +166 -0
- package/dist/src/utils/UserOpUtils.js.map +1 -0
- package/dist/src/utils/ViemUtils.d.ts +9 -0
- package/dist/src/utils/ViemUtils.js +30 -0
- package/dist/src/utils/ViemUtils.js.map +1 -0
- package/dist/src/utils/WalletUtils.d.ts +11 -0
- package/dist/src/utils/WalletUtils.js +61 -0
- package/dist/src/utils/WalletUtils.js.map +1 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/index.js +24 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/viem/ContractInterface.d.ts +19 -0
- package/dist/src/viem/ContractInterface.js +88 -0
- package/dist/src/viem/ContractInterface.js.map +1 -0
- package/dist/src/viem/Converter.d.ts +1770 -0
- package/dist/src/viem/Converter.js +50 -0
- package/dist/src/viem/Converter.js.map +1 -0
- package/dist/src/viem/index.d.ts +2 -0
- package/dist/src/viem/index.js +19 -0
- package/dist/src/viem/index.js.map +1 -0
- package/dist/src/wallet/FunWallet.d.ts +185 -0
- package/dist/src/wallet/FunWallet.js +720 -0
- package/dist/src/wallet/FunWallet.js.map +1 -0
- package/dist/src/wallet/index.d.ts +2 -0
- package/dist/src/wallet/index.js +19 -0
- package/dist/src/wallet/index.js.map +1 -0
- package/dist/src/wallet/types.d.ts +13 -0
- package/dist/src/wallet/types.js +3 -0
- package/dist/src/wallet/types.js.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Auth = void 0;
|
|
27
|
+
const viem_1 = require("viem");
|
|
28
|
+
const accounts_1 = require("viem/accounts");
|
|
29
|
+
const chains = __importStar(require("viem/chains"));
|
|
30
|
+
const UserApis_1 = require("../apis/UserApis");
|
|
31
|
+
const common_1 = require("../common");
|
|
32
|
+
const data_1 = require("../data");
|
|
33
|
+
const errors_1 = require("../errors");
|
|
34
|
+
const utils_1 = require("../utils");
|
|
35
|
+
const TypeUtils_1 = require("../utils/TypeUtils");
|
|
36
|
+
const viem_2 = require("../viem");
|
|
37
|
+
const gasSpecificChain = {
|
|
38
|
+
"137": {
|
|
39
|
+
gasStationUrl: "https://gasstation.polygon.technology/v2",
|
|
40
|
+
backupPriorityFee: "1000",
|
|
41
|
+
backupFee: "200" // 200 gwei
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const preProcessesChains = {};
|
|
45
|
+
for (const key in chains) {
|
|
46
|
+
const chain = chains[key];
|
|
47
|
+
preProcessesChains[chain.id] = key;
|
|
48
|
+
}
|
|
49
|
+
preProcessesChains["36865"] = "funtestnet";
|
|
50
|
+
chains["funtestnet"] = {
|
|
51
|
+
id: 36865,
|
|
52
|
+
name: "Fun Testnet",
|
|
53
|
+
network: "tenderly",
|
|
54
|
+
nativeCurrency: { name: "ethereum", symbol: "ETH", decimals: 18 },
|
|
55
|
+
rpcUrls: { default: { http: [Array] }, public: { http: [Array] } }
|
|
56
|
+
};
|
|
57
|
+
preProcessesChains["8453"] = "base";
|
|
58
|
+
chains["base"] = {
|
|
59
|
+
id: 8453,
|
|
60
|
+
name: "Base",
|
|
61
|
+
network: "base",
|
|
62
|
+
nativeCurrency: { name: "ethereum", symbol: "ETH", decimals: 18 },
|
|
63
|
+
rpcUrls: {
|
|
64
|
+
default: { http: ["https://soft-broken-arm.base-mainnet.quiknode.pro/57c67d9e841d721a3943054111f538c0cc343c89/"] },
|
|
65
|
+
public: { http: ["https://soft-broken-arm.base-mainnet.quiknode.pro/57c67d9e841d721a3943054111f538c0cc343c89/"] }
|
|
66
|
+
},
|
|
67
|
+
blockExplorers: {
|
|
68
|
+
etherscan: { name: "BaseScan", url: "https://basescan.org/" },
|
|
69
|
+
default: { name: "BaseScan", url: "https://basescan.org/" }
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
class Auth {
|
|
73
|
+
constructor(authInput) {
|
|
74
|
+
this.inited = false;
|
|
75
|
+
if (authInput.web2AuthId) {
|
|
76
|
+
this.authId = authInput.web2AuthId;
|
|
77
|
+
}
|
|
78
|
+
if (authInput.client) {
|
|
79
|
+
this.client = authInput.client;
|
|
80
|
+
}
|
|
81
|
+
else if (authInput.windowEth) {
|
|
82
|
+
this.client = (0, viem_1.createWalletClient)({
|
|
83
|
+
transport: (0, viem_1.custom)(authInput.windowEth)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
else if (authInput.rpc) {
|
|
87
|
+
this.client = (0, viem_1.createWalletClient)({
|
|
88
|
+
transport: (0, viem_1.http)(authInput.rpc)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
else if (authInput.provider) {
|
|
92
|
+
this.client = (0, viem_2.convertProviderToClient)({ provider: authInput.provider });
|
|
93
|
+
}
|
|
94
|
+
else if (authInput.signer) {
|
|
95
|
+
this.client = (0, viem_2.convertSignerToClient)({ signer: authInput.signer });
|
|
96
|
+
}
|
|
97
|
+
else if (authInput.privateKey) {
|
|
98
|
+
let privateKey;
|
|
99
|
+
if ((0, TypeUtils_1.isBytes32)(authInput.privateKey)) {
|
|
100
|
+
privateKey = authInput.privateKey;
|
|
101
|
+
}
|
|
102
|
+
else if (!(0, viem_1.isHex)(authInput.privateKey) && authInput.privateKey.length === common_1.VALID_PRIVATE_KEY_LENGTH) {
|
|
103
|
+
privateKey = `0x${authInput.privateKey}`;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
throw new errors_1.InvalidParameterError(errors_1.ErrorCode.InvalidParameter, "privateKey is not a valid one", authInput.privateKey, "Provide valid privateKey string", "https://docs.fun.xyz/how-to-guides/configure-account");
|
|
107
|
+
}
|
|
108
|
+
this.signer = (0, accounts_1.privateKeyToAccount)(privateKey);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
throw new errors_1.InvalidParameterError(errors_1.ErrorCode.MissingParameter, "valid authInput is required", authInput, "Provide viem client, privateKey, window eth (check viem.sh), rpc signer, provider, or signer when constructing Auth", "https://docs.fun.xyz/how-to-guides/configure-account");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async init() {
|
|
115
|
+
if (this.inited)
|
|
116
|
+
return;
|
|
117
|
+
if (this.client) {
|
|
118
|
+
const address = await this.client.requestAddresses();
|
|
119
|
+
this.account = address[0];
|
|
120
|
+
}
|
|
121
|
+
else if (this.signer) {
|
|
122
|
+
this.account = this.signer.address;
|
|
123
|
+
}
|
|
124
|
+
this.authId ?? (this.authId = this.account);
|
|
125
|
+
this.inited = true;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Signs a hash using the stored signer and returns the signature.
|
|
129
|
+
* @param {Hex} hash - The hash to be signed.
|
|
130
|
+
* @param {boolean} isGroupOp - Whether the operation is a group operation (default: false).
|
|
131
|
+
* @returns {Promise<Hex>} The signature of the hash.
|
|
132
|
+
*/
|
|
133
|
+
async signHash(hash, isGroupOp = false) {
|
|
134
|
+
await this.init();
|
|
135
|
+
let signature;
|
|
136
|
+
if (this.signer?.type === "local") {
|
|
137
|
+
signature = await this.signer.signMessage({ message: { raw: (0, viem_1.toBytes)(hash) } });
|
|
138
|
+
}
|
|
139
|
+
else if (this.client && this.account) {
|
|
140
|
+
signature = await this.client.signMessage({ account: this.account, message: { raw: (0, viem_1.toBytes)(hash) } });
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
throw new Error("No signer or client");
|
|
144
|
+
}
|
|
145
|
+
if (isGroupOp) {
|
|
146
|
+
return signature;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
const walletSignature = {
|
|
150
|
+
userId: await this.getUserId(),
|
|
151
|
+
signature: signature
|
|
152
|
+
};
|
|
153
|
+
return (0, data_1.encodeWalletSignature)(walletSignature);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Signs an operation using the stored signer and returns the signature.
|
|
158
|
+
* @param {Operation} operation - The operation to be signed.
|
|
159
|
+
* @param {Chain} chain - The chain instance associated with the operation.
|
|
160
|
+
* @param {boolean} isGroupOp - Whether the operation is a group operation (default: false).
|
|
161
|
+
* @returns {Promise<Hex>} The signature of the operation.
|
|
162
|
+
*/
|
|
163
|
+
async signOp(operation, chain, isGroupOp = false) {
|
|
164
|
+
await this.init();
|
|
165
|
+
const opHash = await operation.getOpHash(chain);
|
|
166
|
+
return await this.signHash(opHash, isGroupOp);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Retrieves the address associated with the initialized signer or client.
|
|
170
|
+
* @returns {Promise<Address>} The address associated with the signer or client.
|
|
171
|
+
* @throws {Error} If no signer or client is available.
|
|
172
|
+
*/
|
|
173
|
+
async getAddress() {
|
|
174
|
+
await this.init();
|
|
175
|
+
if (this.account)
|
|
176
|
+
return this.account;
|
|
177
|
+
throw new Error("No signer or client");
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Retrieves the user ID by padding the address associated with the signer or client.
|
|
181
|
+
* @returns {Promise<Hex>} The padded user ID.
|
|
182
|
+
*/
|
|
183
|
+
async getUserId() {
|
|
184
|
+
return (0, viem_1.pad)(await this.getAddress(), { size: 32 });
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Generates an estimate gas signature for an operation using the provided user ID.
|
|
188
|
+
* @param {string} userId - The user ID to generate the estimate gas signature for.
|
|
189
|
+
* @param {Operation} _ - The operation (not used in this method).
|
|
190
|
+
* @returns {Promise<Hex>} The estimate gas signature.
|
|
191
|
+
*/
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
193
|
+
async getEstimateGasSignature(userId, _) {
|
|
194
|
+
await this.init();
|
|
195
|
+
const walletSignature = {
|
|
196
|
+
userId: (0, viem_1.pad)(userId, { size: 32 }),
|
|
197
|
+
signature: (0, viem_1.pad)("0x", { size: 65 })
|
|
198
|
+
};
|
|
199
|
+
return (0, data_1.encodeWalletSignature)(walletSignature);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Retrieves a unique ID for the wallet based on an index and optional skipDBActions flag.
|
|
203
|
+
* @param {number} index - The index for generating the unique ID (default: 0).
|
|
204
|
+
* @param {boolean} skipDBActions - Whether to skip database actions (default: false).
|
|
205
|
+
* @returns {Promise<Hex>} The generated unique ID for the wallet.
|
|
206
|
+
*/
|
|
207
|
+
async getWalletUniqueId(index = 0, skipDBActions = false) {
|
|
208
|
+
await this.init();
|
|
209
|
+
const authUniqueId = await (0, utils_1.getAuthUniqueId)(this.authId, await this.getAddress(), skipDBActions);
|
|
210
|
+
return (0, viem_1.keccak256)((0, viem_1.toBytes)(`${authUniqueId}-${index}`));
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Sends a transaction with the provided transaction data and options.
|
|
214
|
+
* @param {TransactionParams} txData - The transaction data including 'to', 'data', and 'value'.
|
|
215
|
+
* @param {EnvOption} options - The environment options (default: globalEnvOption).
|
|
216
|
+
* @returns {Promise<TransactionReceipt>} The transaction receipt.
|
|
217
|
+
*/
|
|
218
|
+
async sendTx(txData, options = globalThis.globalEnvOption) {
|
|
219
|
+
await this.init();
|
|
220
|
+
const chain = await data_1.Chain.getChain({ chainIdentifier: options.chain });
|
|
221
|
+
const chainId = await chain.getChainId();
|
|
222
|
+
const { to, data } = txData;
|
|
223
|
+
let { value } = txData;
|
|
224
|
+
if (!chain || !chainId) {
|
|
225
|
+
throw new errors_1.InvalidParameterError(errors_1.ErrorCode.MissingParameter, "chain object is missing or incorrect", { options, chainId }, "Provide proper chain information from options field", "https://docs.fun.xyz");
|
|
226
|
+
}
|
|
227
|
+
const client = await chain.getClient();
|
|
228
|
+
let tx;
|
|
229
|
+
value ?? (value = 0n);
|
|
230
|
+
let txClient;
|
|
231
|
+
if (this.client)
|
|
232
|
+
txClient = this.client;
|
|
233
|
+
else {
|
|
234
|
+
txClient = (0, viem_1.createWalletClient)({
|
|
235
|
+
account: this.signer,
|
|
236
|
+
transport: (0, viem_1.http)(client.transport.url),
|
|
237
|
+
chain: chains[preProcessesChains[await chain.getChainId()]]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
let maxPriorityFee, maxFee;
|
|
241
|
+
if (gasSpecificChain[chainId]) {
|
|
242
|
+
try {
|
|
243
|
+
const { standard: { maxPriorityFee: maxPriorityFee1, maxFee: maxFee1 } } = await (0, utils_1.getGasStation)(gasSpecificChain[chainId].gasStationUrl);
|
|
244
|
+
maxPriorityFee = maxPriorityFee1;
|
|
245
|
+
maxFee = maxFee1;
|
|
246
|
+
}
|
|
247
|
+
catch (e) {
|
|
248
|
+
maxPriorityFee = BigInt(gasSpecificChain[chainId].backupPriorityFee);
|
|
249
|
+
maxFee = BigInt(gasSpecificChain[chainId].backupFee);
|
|
250
|
+
}
|
|
251
|
+
tx = {
|
|
252
|
+
to,
|
|
253
|
+
value: BigInt(value),
|
|
254
|
+
data,
|
|
255
|
+
maxFeePerGas: BigInt(Math.floor(maxFee * 1e9)),
|
|
256
|
+
maxPriorityFeePerGas: BigInt(Math.floor(maxPriorityFee * 1e9))
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
tx = { to, value: BigInt(value), data };
|
|
261
|
+
}
|
|
262
|
+
const action = {
|
|
263
|
+
...tx,
|
|
264
|
+
account: this.signer ?? this.account,
|
|
265
|
+
chain: chains[preProcessesChains[await chain.getChainId()]]
|
|
266
|
+
};
|
|
267
|
+
const hash = await txClient.sendTransaction(action);
|
|
268
|
+
const receipt = await client.waitForTransactionReceipt({ hash, timeout: 300000 });
|
|
269
|
+
return receipt;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Sends an array of transactions and returns an array of corresponding transaction receipts.
|
|
273
|
+
* @param {TransactionData[]} txs - An array of transaction data.
|
|
274
|
+
* @returns {Promise<TransactionReceipt[]>} An array of transaction receipts.
|
|
275
|
+
*/
|
|
276
|
+
async sendTxs(txs) {
|
|
277
|
+
const receipts = [];
|
|
278
|
+
for (const tx of txs) {
|
|
279
|
+
if (tx.chain) {
|
|
280
|
+
receipts.push(await this.sendTx(tx, { chain: tx.chain }));
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
receipts.push(await this.sendTx(tx));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return receipts;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Retrieves the user IDs of the current auth object associated with a wallet address on a specific chain.
|
|
290
|
+
* @param {Address} wallet - The wallet address for which to retrieve user IDs.
|
|
291
|
+
* @param {string} chainId - The chain identifier.
|
|
292
|
+
* @returns {Promise<Hex[]>} An array of user IDs associated with the wallet address.
|
|
293
|
+
*/
|
|
294
|
+
async getUserIds(wallet, chainId) {
|
|
295
|
+
await this.init();
|
|
296
|
+
return await (0, UserApis_1.getUserWalletIdentities)(this.authId, chainId, wallet);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Retrieves the wallets associated with the current auth object.
|
|
300
|
+
* @param {string} [chainId] - Optional chain identifier.
|
|
301
|
+
* @returns {Promise<Wallet[]>} An array of wallet objects associated with the address.
|
|
302
|
+
*/
|
|
303
|
+
async getWallets(chainId) {
|
|
304
|
+
await this.init();
|
|
305
|
+
try {
|
|
306
|
+
return await (0, UserApis_1.getUserWalletsByAddr)(await this.getAddress(), chainId);
|
|
307
|
+
}
|
|
308
|
+
catch (err) {
|
|
309
|
+
if (err instanceof errors_1.ResourceNotFoundError) {
|
|
310
|
+
return [];
|
|
311
|
+
}
|
|
312
|
+
throw err;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
exports.Auth = Auth;
|
|
317
|
+
//# sourceMappingURL=Auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Auth.js","sourceRoot":"","sources":["../../../src/auth/Auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAca;AACb,4CAAmD;AACnD,oDAAqC;AAGrC,+CAAgF;AAChF,sCAAwF;AAExF,kCAAkF;AAClF,sCAAmF;AACnF,oCAAyD;AACzD,kDAA8C;AAC9C,kCAAwE;AACxE,MAAM,gBAAgB,GAAG;IACrB,KAAK,EAAE;QACH,aAAa,EAAE,0CAA0C;QACzD,iBAAiB,EAAE,MAAM;QACzB,SAAS,EAAE,KAAK,CAAC,WAAW;KAC/B;CACJ,CAAA;AAED,MAAM,kBAAkB,GAAQ,EAAE,CAAA;AAClC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;IACtB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;IACzB,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,CAAA;CACrC;AAED,kBAAkB,CAAC,OAAO,CAAC,GAAG,YAAY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,IAAI,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAA;SACtE;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,YAAY,8BAAqB,EAAE;gBACtC,OAAO,EAAE,CAAA;aACZ;YACD,MAAM,GAAG,CAAA;SACZ;IACL,CAAC;CACJ;AAvQD,oBAuQC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Hex } from "viem";
|
|
2
|
+
import { Auth } from "./Auth";
|
|
3
|
+
import { AuthInput, WalletCallData } from "./types";
|
|
4
|
+
import { Chain, Operation } from "../data";
|
|
5
|
+
import { MerkleTree } from "../utils/MerkleUtils";
|
|
6
|
+
export declare class SessionKeyAuth extends Auth {
|
|
7
|
+
ruleId: Hex;
|
|
8
|
+
roleId: Hex;
|
|
9
|
+
targetSelectorMerkleTree?: MerkleTree;
|
|
10
|
+
feeRecipientMerkleTree?: MerkleTree;
|
|
11
|
+
constructor(authInput: AuthInput);
|
|
12
|
+
signOp(operation: Operation, chain: Chain): Promise<Hex>;
|
|
13
|
+
getEstimateGasSignature(userId: string, operation: Operation): Promise<Hex>;
|
|
14
|
+
setTargetSelectorMerkleTree(targetSelectorMerkleTree: MerkleTree): void;
|
|
15
|
+
setFeeRecipientMerkleTree(feeRecipientMerkleTree: MerkleTree): void;
|
|
16
|
+
}
|
|
17
|
+
export declare const getTargetFromCall: (callData: Hex) => `0x${string}`;
|
|
18
|
+
export declare const getSelectorFromCall: (callData: Hex) => `0x${string}`;
|
|
19
|
+
export declare const decodeCalldata: (callData: Hex) => WalletCallData;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeCalldata = exports.getSelectorFromCall = exports.getTargetFromCall = exports.SessionKeyAuth = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const Auth_1 = require("./Auth");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const data_1 = require("../data");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const ViemUtils_1 = require("../utils/ViemUtils");
|
|
10
|
+
const SELECTOR_LENGTH = 10;
|
|
11
|
+
const execFromEntryPointSelector = (0, ViemUtils_1.getSigHash)(common_1.WALLET_ABI, "execFromEntryPoint");
|
|
12
|
+
const execFromEntryPointFeeSelector = (0, ViemUtils_1.getSigHash)(common_1.WALLET_ABI, "execFromEntryPointWithFee");
|
|
13
|
+
class SessionKeyAuth extends Auth_1.Auth {
|
|
14
|
+
constructor(authInput) {
|
|
15
|
+
super(authInput);
|
|
16
|
+
this.ruleId = (0, utils_1.randomBytes)(32);
|
|
17
|
+
this.roleId = (0, utils_1.randomBytes)(32);
|
|
18
|
+
}
|
|
19
|
+
async signOp(operation, chain) {
|
|
20
|
+
if (!this.targetSelectorMerkleTree) {
|
|
21
|
+
throw new Error("SessionKeyAuth not connected to wallet");
|
|
22
|
+
}
|
|
23
|
+
await this.init();
|
|
24
|
+
const opHash = await operation.getOpHash(chain);
|
|
25
|
+
let signature;
|
|
26
|
+
if (this.signer?.type === "local") {
|
|
27
|
+
signature = await this.signer.signMessage({ message: { raw: (0, viem_1.toBytes)(opHash) } });
|
|
28
|
+
}
|
|
29
|
+
else if (this.client && this.account) {
|
|
30
|
+
signature = await this.client.signMessage({ account: this.account, message: { raw: (0, viem_1.toBytes)(opHash) } });
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw new Error("No signer or client");
|
|
34
|
+
}
|
|
35
|
+
const target = (0, exports.getTargetFromCall)(operation.userOp.callData);
|
|
36
|
+
const selector = (0, exports.getSelectorFromCall)(operation.userOp.callData);
|
|
37
|
+
const walletSignature = {
|
|
38
|
+
userId: await this.getUserId(),
|
|
39
|
+
signature: signature,
|
|
40
|
+
roleId: this.roleId,
|
|
41
|
+
ruleId: this.ruleId,
|
|
42
|
+
extraData: {
|
|
43
|
+
targetPath: this.targetSelectorMerkleTree.getPathForItem(target),
|
|
44
|
+
selectorPath: this.targetSelectorMerkleTree.getPathForItem(selector)
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (0, data_1.encodeWalletSignature)(walletSignature);
|
|
48
|
+
}
|
|
49
|
+
async getEstimateGasSignature(userId, operation) {
|
|
50
|
+
if (!this.targetSelectorMerkleTree) {
|
|
51
|
+
throw new Error("SessionKeyAuth not connected to wallet");
|
|
52
|
+
}
|
|
53
|
+
await this.init();
|
|
54
|
+
const target = (0, exports.getTargetFromCall)(operation.userOp.callData);
|
|
55
|
+
const selector = (0, exports.getSelectorFromCall)(operation.userOp.callData);
|
|
56
|
+
try {
|
|
57
|
+
const walletSignature = {
|
|
58
|
+
userId: (0, viem_1.pad)(userId, { size: 32 }),
|
|
59
|
+
signature: (0, viem_1.pad)("0x", { size: 65 }),
|
|
60
|
+
roleId: this.roleId,
|
|
61
|
+
ruleId: this.ruleId,
|
|
62
|
+
extraData: {
|
|
63
|
+
targetPath: this.targetSelectorMerkleTree.getPathForItem(target),
|
|
64
|
+
selectorPath: this.targetSelectorMerkleTree.getPathForItem(selector)
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return (0, data_1.encodeWalletSignature)(walletSignature);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
throw new Error("Function or target is not allowed in session key");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
setTargetSelectorMerkleTree(targetSelectorMerkleTree) {
|
|
74
|
+
this.targetSelectorMerkleTree = targetSelectorMerkleTree;
|
|
75
|
+
}
|
|
76
|
+
setFeeRecipientMerkleTree(feeRecipientMerkleTree) {
|
|
77
|
+
this.feeRecipientMerkleTree = feeRecipientMerkleTree;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.SessionKeyAuth = SessionKeyAuth;
|
|
81
|
+
const getTargetFromCall = (callData) => {
|
|
82
|
+
return (0, exports.decodeCalldata)(callData).target;
|
|
83
|
+
};
|
|
84
|
+
exports.getTargetFromCall = getTargetFromCall;
|
|
85
|
+
const getSelectorFromCall = (callData) => {
|
|
86
|
+
const out = (0, exports.decodeCalldata)(callData).calldata.slice(0, SELECTOR_LENGTH);
|
|
87
|
+
return out === "0x" ? common_1.ETH_TRANSFER_SELECTOR : out;
|
|
88
|
+
};
|
|
89
|
+
exports.getSelectorFromCall = getSelectorFromCall;
|
|
90
|
+
const decodeCalldata = (callData) => {
|
|
91
|
+
if (callData.includes(execFromEntryPointFeeSelector)) {
|
|
92
|
+
return _decodeExecWithFee(callData);
|
|
93
|
+
}
|
|
94
|
+
else if (callData.includes(execFromEntryPointSelector)) {
|
|
95
|
+
return _decodeExec(callData);
|
|
96
|
+
}
|
|
97
|
+
throw new Error("invalid call data. must be execFromEntryPoint or execFromEntryPointWithFee");
|
|
98
|
+
};
|
|
99
|
+
exports.decodeCalldata = decodeCalldata;
|
|
100
|
+
const _decodeExecWithFee = (callData) => {
|
|
101
|
+
const walletcalldata = ("0x" + callData.slice(SELECTOR_LENGTH));
|
|
102
|
+
const [target, value, calldata] = (0, viem_1.decodeAbiParameters)([{ type: "address" }, { type: "uint256" }, { type: "bytes" }], walletcalldata);
|
|
103
|
+
return {
|
|
104
|
+
target: target,
|
|
105
|
+
value: value,
|
|
106
|
+
calldata: calldata
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const _decodeExec = (callData) => {
|
|
110
|
+
const walletcalldata = ("0x" + callData.slice(SELECTOR_LENGTH));
|
|
111
|
+
const [target, value, calldata] = (0, viem_1.decodeAbiParameters)([{ type: "address" }, { type: "uint256" }, { type: "bytes" }], walletcalldata);
|
|
112
|
+
return {
|
|
113
|
+
target: target,
|
|
114
|
+
value: value,
|
|
115
|
+
calldata: calldata
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=SessionKeyAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionKeyAuth.js","sourceRoot":"","sources":["../../../src/auth/SessionKeyAuth.ts"],"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|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Auth"), exports);
|
|
18
|
+
__exportStar(require("./SessionKeyAuth"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,mDAAgC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Address, Hex, WalletClient } from "viem";
|
|
2
|
+
export interface AuthInput {
|
|
3
|
+
web2AuthId?: string;
|
|
4
|
+
client?: WalletClient;
|
|
5
|
+
privateKey?: string;
|
|
6
|
+
windowEth?: any;
|
|
7
|
+
rpc?: string;
|
|
8
|
+
provider?: any;
|
|
9
|
+
signer?: any;
|
|
10
|
+
}
|
|
11
|
+
export type WalletCallData = {
|
|
12
|
+
target: Address;
|
|
13
|
+
value: bigint;
|
|
14
|
+
calldata: Hex;
|
|
15
|
+
feeInfo?: {
|
|
16
|
+
token: Address;
|
|
17
|
+
recipient: Address;
|
|
18
|
+
amount: bigint;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/auth/types.ts"],"names":[],"mappings":""}
|