@joai/warps-adapter-evm 1.3.1 → 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 CHANGED
@@ -308,7 +308,7 @@ declare class WarpEvmWallet implements AdapterWarpWallet {
308
308
  delete(provider: WarpWalletProvider, externalId: string): Promise<void>;
309
309
  getAddress(): string | null;
310
310
  getPublicKey(): string | null;
311
- registerX402Handlers(client: unknown): Promise<Record<string, () => void>>;
311
+ getMppAccount(): Promise<unknown>;
312
312
  private createProvider;
313
313
  private getAddressAsync;
314
314
  private createProviderForOperation;
package/dist/index.d.ts CHANGED
@@ -308,7 +308,7 @@ declare class WarpEvmWallet implements AdapterWarpWallet {
308
308
  delete(provider: WarpWalletProvider, externalId: string): Promise<void>;
309
309
  getAddress(): string | null;
310
310
  getPublicKey(): string | null;
311
- registerX402Handlers(client: unknown): Promise<Record<string, () => void>>;
311
+ getMppAccount(): Promise<unknown>;
312
312
  private createProvider;
313
313
  private getAddressAsync;
314
314
  private createProviderForOperation;
package/dist/index.js CHANGED
@@ -1968,10 +1968,7 @@ var WarpEvmExplorer = class {
1968
1968
 
1969
1969
  // src/WarpEvmWallet.ts
1970
1970
  var import_warps20 = require("@joai/warps");
1971
- var import_evm = require("@x402/evm");
1972
- var import_client = require("@x402/evm/exact/client");
1973
1971
  var import_ethers7 = require("ethers");
1974
- var import_viem = require("viem");
1975
1972
  var import_accounts = require("viem/accounts");
1976
1973
  var WarpEvmWallet = class {
1977
1974
  constructor(config, chain) {
@@ -2078,26 +2075,14 @@ var WarpEvmWallet = class {
2078
2075
  getPublicKey() {
2079
2076
  return this.cachedPublicKey;
2080
2077
  }
2081
- async registerX402Handlers(client) {
2078
+ async getMppAccount() {
2082
2079
  if (!this.walletProvider) throw new Error("No wallet provider available");
2083
2080
  const provider = this.walletProvider;
2084
2081
  const getInstance = provider.getWalletInstance;
2085
- if (typeof getInstance !== "function") throw new Error("Wallet provider does not have getWalletInstance method");
2082
+ if (typeof getInstance !== "function") throw new Error("Wallet provider does not support getMppAccount");
2086
2083
  const wallet = getInstance();
2087
- if (!wallet || !wallet.privateKey) throw new Error("Wallet instance does not have private key");
2088
- const signer = (0, import_evm.toClientEvmSigner)(
2089
- (0, import_accounts.privateKeyToAccount)(wallet.privateKey),
2090
- (0, import_viem.createPublicClient)({
2091
- transport: (0, import_viem.http)((0, import_warps20.getProviderConfig)(this.config, this.chain.name, this.config.env, this.chain.defaultApiUrl).url)
2092
- })
2093
- );
2094
- const handlers = {};
2095
- for (const chainId of SupportedEvmChainIds) {
2096
- handlers[`eip155:${chainId}`] = () => {
2097
- (0, import_client.registerExactEvmScheme)(client, { signer });
2098
- };
2099
- }
2100
- return handlers;
2084
+ if (!wallet?.privateKey) throw new Error("Wallet instance does not have a private key");
2085
+ return (0, import_accounts.privateKeyToAccount)(wallet.privateKey);
2101
2086
  }
2102
2087
  createProvider() {
2103
2088
  const wallet = this.config.user?.wallets?.[this.chain.name];