@joai/warps-adapter-evm 1.3.0 → 1.4.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/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +8 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -3
package/dist/index.mjs
CHANGED
|
@@ -1223,9 +1223,7 @@ import {
|
|
|
1223
1223
|
getProviderConfig as getProviderConfig2,
|
|
1224
1224
|
getWarpWalletAddressFromConfig as getWarpWalletAddressFromConfig2,
|
|
1225
1225
|
parseOutputOutIndex,
|
|
1226
|
-
WarpConstants as WarpConstants2
|
|
1227
|
-
WarpCache as WarpCache3,
|
|
1228
|
-
WarpCacheKey as WarpCacheKey2
|
|
1226
|
+
WarpConstants as WarpConstants2
|
|
1229
1227
|
} from "@joai/warps";
|
|
1230
1228
|
import { ethers as ethers5 } from "ethers";
|
|
1231
1229
|
|
|
@@ -1394,10 +1392,9 @@ var WarpEvmOutput = class {
|
|
|
1394
1392
|
const providerConfig = getProviderConfig2(this.config, this.chain.name, this.config.env, this.chain.defaultApiUrl);
|
|
1395
1393
|
const network = new ethers5.Network(this.chain.name, parseInt(this.chain.chainId));
|
|
1396
1394
|
this.provider = new ethers5.JsonRpcProvider(providerConfig.url, network);
|
|
1397
|
-
this.cache = new WarpCache3(config.env, config.cache);
|
|
1398
1395
|
}
|
|
1399
|
-
async getActionExecution(warp, actionIndex, tx) {
|
|
1400
|
-
const inputs =
|
|
1396
|
+
async getActionExecution(warp, actionIndex, tx, injectedInputs) {
|
|
1397
|
+
const inputs = injectedInputs ?? [];
|
|
1401
1398
|
const resolvedInputs = extractResolvedInputValues(inputs);
|
|
1402
1399
|
if (!tx) {
|
|
1403
1400
|
return this.createFailedExecution(warp, actionIndex, resolvedInputs);
|
|
@@ -1939,10 +1936,7 @@ var WarpEvmExplorer = class {
|
|
|
1939
1936
|
import {
|
|
1940
1937
|
getProviderConfig as getProviderConfig4
|
|
1941
1938
|
} from "@joai/warps";
|
|
1942
|
-
import { toClientEvmSigner } from "@x402/evm";
|
|
1943
|
-
import { registerExactEvmScheme } from "@x402/evm/exact/client";
|
|
1944
1939
|
import { ethers as ethers7 } from "ethers";
|
|
1945
|
-
import { createPublicClient, http } from "viem";
|
|
1946
1940
|
import { privateKeyToAccount } from "viem/accounts";
|
|
1947
1941
|
var WarpEvmWallet = class {
|
|
1948
1942
|
constructor(config, chain) {
|
|
@@ -2049,26 +2043,14 @@ var WarpEvmWallet = class {
|
|
|
2049
2043
|
getPublicKey() {
|
|
2050
2044
|
return this.cachedPublicKey;
|
|
2051
2045
|
}
|
|
2052
|
-
async
|
|
2046
|
+
async getMppAccount() {
|
|
2053
2047
|
if (!this.walletProvider) throw new Error("No wallet provider available");
|
|
2054
2048
|
const provider = this.walletProvider;
|
|
2055
2049
|
const getInstance = provider.getWalletInstance;
|
|
2056
|
-
if (typeof getInstance !== "function") throw new Error("Wallet provider does not
|
|
2050
|
+
if (typeof getInstance !== "function") throw new Error("Wallet provider does not support getMppAccount");
|
|
2057
2051
|
const wallet = getInstance();
|
|
2058
|
-
if (!wallet
|
|
2059
|
-
|
|
2060
|
-
privateKeyToAccount(wallet.privateKey),
|
|
2061
|
-
createPublicClient({
|
|
2062
|
-
transport: http(getProviderConfig4(this.config, this.chain.name, this.config.env, this.chain.defaultApiUrl).url)
|
|
2063
|
-
})
|
|
2064
|
-
);
|
|
2065
|
-
const handlers = {};
|
|
2066
|
-
for (const chainId of SupportedEvmChainIds) {
|
|
2067
|
-
handlers[`eip155:${chainId}`] = () => {
|
|
2068
|
-
registerExactEvmScheme(client, { signer });
|
|
2069
|
-
};
|
|
2070
|
-
}
|
|
2071
|
-
return handlers;
|
|
2052
|
+
if (!wallet?.privateKey) throw new Error("Wallet instance does not have a private key");
|
|
2053
|
+
return privateKeyToAccount(wallet.privateKey);
|
|
2072
2054
|
}
|
|
2073
2055
|
createProvider() {
|
|
2074
2056
|
const wallet = this.config.user?.wallets?.[this.chain.name];
|
|
@@ -2289,7 +2271,7 @@ var NativeTokenEth = {
|
|
|
2289
2271
|
var EthereumAdapter = createEvmAdapter(WarpChainName16.Ethereum, {
|
|
2290
2272
|
mainnet: {
|
|
2291
2273
|
name: WarpChainName16.Ethereum,
|
|
2292
|
-
displayName: "Ethereum
|
|
2274
|
+
displayName: "Ethereum",
|
|
2293
2275
|
chainId: "1",
|
|
2294
2276
|
blockTime: 12e3,
|
|
2295
2277
|
addressHrp: "0x",
|
|
@@ -2404,7 +2386,7 @@ var NativeTokenStt = {
|
|
|
2404
2386
|
var SomniaAdapter = createEvmAdapter(WarpChainName18.Somnia, {
|
|
2405
2387
|
mainnet: {
|
|
2406
2388
|
name: WarpChainName18.Somnia,
|
|
2407
|
-
displayName: "Somnia
|
|
2389
|
+
displayName: "Somnia",
|
|
2408
2390
|
chainId: "5031",
|
|
2409
2391
|
blockTime: 100,
|
|
2410
2392
|
addressHrp: "0x",
|