@alchemy/aa-core
Advanced tools
Comparing version 0.1.0-alpha.11 to 0.1.0-alpha.14
@@ -22,2 +22,3 @@ export type { Abi } from "abitype"; | ||
export { asyncPipe, deepHexlify, defineReadOnly, getChain, getUserOperationHash, resolveProperties, } from "./utils.js"; | ||
export { Logger, type LogLevel } from "./logger.js"; | ||
export { Logger } from "./logger.js"; | ||
export type { LogLevel } from "./logger.js"; |
@@ -30,2 +30,3 @@ import { type Address, type Chain, type Hash, type RpcTransactionRequest, type Transport } from "viem"; | ||
sendTransaction: (request: RpcTransactionRequest) => Promise<Hash>; | ||
signMessage: (msg: string | Uint8Array) => Promise<Hash>; | ||
sendTransactions: (requests: RpcTransactionRequest[]) => Promise<`0x${string}`>; | ||
@@ -32,0 +33,0 @@ waitForUserOperationTransaction: (hash: Hash) => Promise<Hash>; |
@@ -71,5 +71,2 @@ "use strict"; | ||
case "personal_sign": | ||
if (!this.account) { | ||
throw new Error("account not connected!"); | ||
} | ||
const [data, address] = params; | ||
@@ -79,3 +76,3 @@ if (address !== (await this.getAddress())) { | ||
} | ||
return await this.account.signMessage(data); | ||
return this.signMessage(data); | ||
default: | ||
@@ -113,2 +110,13 @@ return this.rpcClient.request(args); | ||
}); | ||
Object.defineProperty(this, "signMessage", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: async (msg) => { | ||
if (!this.account) { | ||
throw new Error("account not connected!"); | ||
} | ||
return this.account.signMessage(msg); | ||
} | ||
}); | ||
Object.defineProperty(this, "sendTransactions", { | ||
@@ -115,0 +123,0 @@ enumerable: true, |
@@ -35,2 +35,3 @@ import type { Address } from "abitype"; | ||
}): Promise<any>; | ||
signMessage: (msg: string | Uint8Array) => Promise<Hash>; | ||
getAddress: () => Promise<Address>; | ||
@@ -37,0 +38,0 @@ withPaymasterMiddleware: (overrides: { |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "0.1.0-alpha.11"; | ||
export declare const VERSION = "0.1.0-alpha.14"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = void 0; | ||
exports.VERSION = "0.1.0-alpha.11"; | ||
exports.VERSION = "0.1.0-alpha.14"; | ||
//# sourceMappingURL=version.js.map |
@@ -22,2 +22,3 @@ export type { Abi } from "abitype"; | ||
export { asyncPipe, deepHexlify, defineReadOnly, getChain, getUserOperationHash, resolveProperties, } from "./utils.js"; | ||
export { Logger, type LogLevel } from "./logger.js"; | ||
export { Logger } from "./logger.js"; | ||
export type { LogLevel } from "./logger.js"; |
@@ -30,2 +30,3 @@ import { type Address, type Chain, type Hash, type RpcTransactionRequest, type Transport } from "viem"; | ||
sendTransaction: (request: RpcTransactionRequest) => Promise<Hash>; | ||
signMessage: (msg: string | Uint8Array) => Promise<Hash>; | ||
sendTransactions: (requests: RpcTransactionRequest[]) => Promise<`0x${string}`>; | ||
@@ -32,0 +33,0 @@ waitForUserOperationTransaction: (hash: Hash) => Promise<Hash>; |
@@ -68,5 +68,2 @@ import { fromHex, } from "viem"; | ||
case "personal_sign": | ||
if (!this.account) { | ||
throw new Error("account not connected!"); | ||
} | ||
const [data, address] = params; | ||
@@ -76,3 +73,3 @@ if (address !== (await this.getAddress())) { | ||
} | ||
return await this.account.signMessage(data); | ||
return this.signMessage(data); | ||
default: | ||
@@ -110,2 +107,13 @@ return this.rpcClient.request(args); | ||
}); | ||
Object.defineProperty(this, "signMessage", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: async (msg) => { | ||
if (!this.account) { | ||
throw new Error("account not connected!"); | ||
} | ||
return this.account.signMessage(msg); | ||
} | ||
}); | ||
Object.defineProperty(this, "sendTransactions", { | ||
@@ -112,0 +120,0 @@ enumerable: true, |
@@ -35,2 +35,3 @@ import type { Address } from "abitype"; | ||
}): Promise<any>; | ||
signMessage: (msg: string | Uint8Array) => Promise<Hash>; | ||
getAddress: () => Promise<Address>; | ||
@@ -37,0 +38,0 @@ withPaymasterMiddleware: (overrides: { |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "0.1.0-alpha.11"; | ||
export declare const VERSION = "0.1.0-alpha.14"; |
@@ -1,2 +0,2 @@ | ||
export const VERSION = "0.1.0-alpha.11"; | ||
export const VERSION = "0.1.0-alpha.14"; | ||
//# sourceMappingURL=version.js.map |
@@ -22,3 +22,4 @@ export type { Abi } from "abitype"; | ||
export { asyncPipe, deepHexlify, defineReadOnly, getChain, getUserOperationHash, resolveProperties, } from "./utils.js"; | ||
export { Logger, type LogLevel } from "./logger.js"; | ||
export { Logger } from "./logger.js"; | ||
export type { LogLevel } from "./logger.js"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -39,2 +39,3 @@ import { type Address, type Chain, type Hash, type RpcTransactionRequest, type Transport } from "viem"; | ||
sendTransaction: (request: RpcTransactionRequest) => Promise<Hash>; | ||
signMessage: (msg: string | Uint8Array) => Promise<Hash>; | ||
sendTransactions: (requests: RpcTransactionRequest[]) => Promise<`0x${string}`>; | ||
@@ -41,0 +42,0 @@ waitForUserOperationTransaction: (hash: Hash) => Promise<Hash>; |
@@ -91,2 +91,9 @@ import type { Address } from "abitype"; | ||
/** | ||
* This method returns an ERC-191 compliant signed message | ||
* | ||
* @param msg - message to be signed | ||
* @returns the signed hash for the message passed | ||
*/ | ||
signMessage: (msg: string | Uint8Array) => Promise<Hash>; | ||
/** | ||
* @returns the address of the connected account | ||
@@ -93,0 +100,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.1.0-alpha.11"; | ||
export declare const VERSION = "0.1.0-alpha.14"; | ||
//# sourceMappingURL=version.d.ts.map |
{ | ||
"name": "@alchemy/aa-core", | ||
"license": "MIT", | ||
"version": "0.1.0-alpha.11", | ||
"version": "0.1.0-alpha.14", | ||
"description": "viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts", | ||
@@ -66,3 +66,3 @@ "author": "Alchemy", | ||
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme", | ||
"gitHead": "ec39fa8f4583c862cc8c866bcdf01c3ebdd2c0f4" | ||
"gitHead": "5b67970bdad3951372a43fdebea6f255b4fdac64" | ||
} |
@@ -44,2 +44,3 @@ export type { Abi } from "abitype"; | ||
export { Logger, type LogLevel } from "./logger.js"; | ||
export { Logger } from "./logger.js"; | ||
export type { LogLevel } from "./logger.js"; |
@@ -115,6 +115,2 @@ import { | ||
case "personal_sign": | ||
if (!this.account) { | ||
throw new Error("account not connected!"); | ||
} | ||
const [data, address] = params!; | ||
@@ -126,4 +122,3 @@ if (address !== (await this.getAddress())) { | ||
} | ||
return await this.account.signMessage(data); | ||
return this.signMessage(data); | ||
default: | ||
@@ -160,2 +155,9 @@ // TODO: there's probably a number of methods we just don't support, will need to test most of them out | ||
signMessage = async (msg: string | Uint8Array): Promise<Hash> => { | ||
if (!this.account) { | ||
throw new Error("account not connected!"); | ||
} | ||
return this.account.signMessage(msg); | ||
}; | ||
sendTransactions = async (requests: RpcTransactionRequest[]) => { | ||
@@ -162,0 +164,0 @@ const batch = requests.map((request) => { |
@@ -139,4 +139,12 @@ import type { Address } from "abitype"; | ||
// TODO: potentially add methods here for signing or something like viem's walletActions? | ||
/** | ||
* This method returns an ERC-191 compliant signed message | ||
* | ||
* @param msg - message to be signed | ||
* @returns the signed hash for the message passed | ||
*/ | ||
signMessage: (msg: string | Uint8Array) => Promise<Hash>; | ||
// TODO: potentially add methods here for something like viem's walletActions? | ||
/** | ||
* @returns the address of the connected account | ||
@@ -143,0 +151,0 @@ */ |
// This file is autogenerated by inject-version.ts. Any changes will be | ||
// overwritten on commit! | ||
export const VERSION = "0.1.0-alpha.11"; | ||
export const VERSION = "0.1.0-alpha.14"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
807071
14923