repo_name stringlengths 1 62 | dataset stringclasses 1
value | lang stringclasses 11
values | pr_id int64 1 20.1k | owner stringlengths 2 34 | reviewer stringlengths 2 39 | diff_hunk stringlengths 15 262k | code_review_comment stringlengths 1 99.6k |
|---|---|---|---|---|---|---|---|
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -0,0 +1,479 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ toHex,
+ zeroAddress
+} from "viem"
+import {
+ ... | I see only `ecdsaValidatorAddress, metaFactoryAddress, bootstrapAddress` are being used, what is the reason for other addresses to be returned? |
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -0,0 +1,479 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ toHex,
+ zeroAddress
+} from "viem"
+import {
+ ... | I think we can reuse the chainId variable you created above to minimize the api requests. |
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -0,0 +1,479 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ toHex,
+ zeroAddress
+} from "viem"
+import {
+ ... | The function name says `root` identifier but we are returning type `validator`. I see there is `VALIDATOR_TYPE.ROOT` also. Can we change the name. |
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -0,0 +1,479 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ toHex,
+ zeroAddress
+} from "viem"
+import {
+ ... | We will have to change the error here to `Etherspot smart account doesn't support account deployment`. Though if you do have a default create2 proxy you can encode the transaction using that. |
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -0,0 +1,479 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ toHex,
+ zeroAddress
+} from "viem"
+import {
+ ... | Can you change `_tx -> tx`. We use `_` to denote unused variables. |
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -0,0 +1,89 @@
+import {
+ type Address,
+ type Hex,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ toHex
+} from "viem"
+import { EtherspotExecuteAbi } from "../abi/EtherspotExecuteAbi"
+import { CALL_TYPE, EXEC_TYPE } from "../constants"
+import { getExecMode } from "./getExecMode"
+
... | Can you change `_tx -> tx`. We use `_` to denote unused variables. |
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -0,0 +1,39 @@
+import {
+ type Account,
+ type Chain,
+ type Client,
+ type LocalAccount,
+ type SignMessageParameters,
+ type SignMessageReturnType,
+ type Transport,
+ hashMessage,
+ publicActions
+} from "viem"
+import { signMessage as _signMessage } from "viem/actions"
+import { type W... | can we make chainId an explicit parameter, since we do make a chain id call in the account, this will save an extra chain id call if client doens't have chain. Checkout `GetChainParameter<TChain, TChainOverride>` in https://github.com/pimlicolabs/permissionless.js/blob/main/packages/permissionless/experimental/eip7677/... |
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -0,0 +1,68 @@
+import {
+ type Account,
+ type Chain,
+ type Client,
+ type LocalAccount,
+ type SignTypedDataParameters,
+ type SignTypedDataReturnType,
+ type Transport,
+ type TypedData,
+ getTypesForEIP712Domain,
+ hashTypedData,
+ publicActions,
+ validateTypedData
+} from "v... | since there is no other `signMessage` we don't need to rename it. |
permissionless.js | github_2023 | typescript | 214 | pimlicolabs | plusminushalf | @@ -85,5 +91,8 @@ export {
type PrivateKeyToSafeSmartAccountParameters,
type SignerToEcdsaKernelSmartAccountParameters,
type SignerToBiconomySmartAccountParameters,
- type PrivateKeyToBiconomySmartAccountParameters
+ type PrivateKeyToBiconomySmartAccountParameters,
+ type EtherspotSmartAccount,
... | can we also add `PrivateKeyToEtherspotSmartAccount` file |
permissionless.js | github_2023 | typescript | 255 | pimlicolabs | kristofgazso | @@ -0,0 +1,120 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type Transport,
+ encodeFunctionData,
+ getAddress
+} from "viem"
+import { getAction } from "viem/utils"
+import type { SmartAccount } from "../../accounts/types"
+import type { GetAccountParameter, Prettify } f... | why default to 0? |
permissionless.js | github_2023 | typescript | 207 | pimlicolabs | plusminushalf | @@ -366,35 +441,13 @@ const main = async () => {
address: kernelFactoryOwner
})
- // ==== SETUP ALCHEMY LIGHT ACCOUNT CONTRACTS ==== //
- const alchemyLightClientOwner = "0xDdF32240B4ca3184De7EC8f0D5Aba27dEc8B7A5C" | Why have we removed this? |
permissionless.js | github_2023 | typescript | 207 | pimlicolabs | plusminushalf | @@ -85,5 +93,6 @@ export {
type PrivateKeyToSafeSmartAccountParameters,
type SignerToEcdsaKernelSmartAccountParameters,
type SignerToBiconomySmartAccountParameters,
- type PrivateKeyToBiconomySmartAccountParameters
+ type PrivateKeyToBiconomySmartAccountParameters,
+ type SignerToTrustSmartAccou... | we should add `PrivateKeyToTrustSmartAccount` as well. |
permissionless.js | github_2023 | typescript | 207 | pimlicolabs | plusminushalf | @@ -0,0 +1,194 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex
+} from "viem"
+import { getChainId } from "viem/actions"
+import { getAccountNonce } from "../../actions/public/getAccountNon... | We don't need prettify here, it is mostly to simplify complex inferred objects. |
permissionless.js | github_2023 | typescript | 207 | pimlicolabs | plusminushalf | @@ -0,0 +1,234 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ hashMessage,
+ hashTypedData
+} from "viem"
+import { getChainId } from "viem/actions"
+import { getAc... | Can we check if client has the chain so
`client.chain?.id ?? getChainId(client)` |
permissionless.js | github_2023 | typescript | 207 | pimlicolabs | plusminushalf | @@ -0,0 +1,55 @@
+import type { Account, Address } from "viem"
+import { encodeFunctionData } from "viem"
+
+/**
+ * Wrapped this function to minimize the call to check if account is deployed
+ */
+export const getFactoryData = async ({
+ account,
+ bytes,
+ index,
+ secp256k1VerificationFacetAddress
+}: {
... | why do we need account? this check doesn't help anything. |
permissionless.js | github_2023 | others | 221 | pimlicolabs | plusminushalf | @@ -0,0 +1,5 @@
+---
+"permissionless": patch
+---
+
+fix: domain typing | Can we change to `Fixed domain not typed as TypedDataDomain` |
permissionless.js | github_2023 | typescript | 221 | pimlicolabs | plusminushalf | @@ -136,10 +137,9 @@ export async function signTypedData<
const account = parseAccount(account_)
const types = {
- EIP712Domain: getTypesForEIP712Domain({ domain }),
+ EIP712Domain: getTypesForEIP712Domain(domain as {domain: TypedDataDomain}), | Shouldn't parameter still be
```typescript
EIP712Domain: getTypesForEIP712Domain({domain} as {domain: TypedDataDomain}),
``` |
permissionless.js | github_2023 | typescript | 213 | pimlicolabs | kristofgazso | @@ -113,12 +113,23 @@ export type SignerToSimpleSmartAccountParameters<
TAddress extends Address = Address
> = Prettify<{
signer: SmartAccountSigner<TSource, TAddress>
- factoryAddress: Address
+ factoryAddress?: Address
entryPoint: entryPoint
index?: bigint
address?: Address
}>
+cons... | weird naming no? more like `getFactoryAddress` |
permissionless.js | github_2023 | typescript | 205 | pimlicolabs | pavlovdog | @@ -123,10 +115,11 @@ export const getUserOperationReceipt = async <
blockNumber: BigInt(log.blockNumber),
blockHash: log.blockHash,
transactionHash: log.transactionHash,
- logIndex: BigInt(log.logIndex),
- transactionIndex: BigInt(log.transactionIndex),
+ ... | Why not return the log as it is? |
permissionless.js | github_2023 | typescript | 188 | pimlicolabs | plusminushalf | @@ -0,0 +1,439 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ encodeFunctionData,
+ hashMessage,
+ hashTypedData
+} from "viem"
+import { getChainId, signMessage... | since lightVersion is a constant can we just accept 1.1.0? |
permissionless.js | github_2023 | typescript | 188 | pimlicolabs | plusminushalf | @@ -0,0 +1,439 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ encodeFunctionData,
+ hashMessage,
+ hashTypedData
+} from "viem"
+import { getChainId, signMessage... | this might be light account here. |
permissionless.js | github_2023 | typescript | 188 | pimlicolabs | plusminushalf | @@ -0,0 +1,439 @@
+import {
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type LocalAccount,
+ type Transport,
+ type TypedData,
+ type TypedDataDefinition,
+ concatHex,
+ encodeFunctionData,
+ hashMessage,
+ hashTypedData
+} from "viem"
+import { getChainId, signMessage... | why is this dependent ion entryPoint version? both entryPoint version can call any of the wallet's execute implementation. |
permissionless.js | github_2023 | others | 188 | pimlicolabs | plusminushalf | @@ -0,0 +1,5 @@
+---
+"permissionless": minor
+---
+
+Add Alchemy's LightAccount support V1.1.0 | `Add -> Added` we use past tense.
`V1.1.0 -> v1.1.0` |
permissionless.js | github_2023 | typescript | 181 | pimlicolabs | plusminushalf | @@ -20,11 +20,14 @@ export type GetUserOperationReceiptParameters = {
export type GetUserOperationReceiptReturnType = {
userOpHash: Hash
+ entryPoint: Address
sender: Address
nonce: bigint
+ paymaster?: Address | undefined | I don't think we need undefined if we have used `?:` |
permissionless.js | github_2023 | typescript | 174 | pimlicolabs | plusminushalf | @@ -73,52 +89,175 @@ const createAccountAbi = [
}
] as const
+export type KernelVersion = "0.2.2" | "0.3.0-beta"
+
/**
- * Default addresses for kernel smart account
+ * Default addresses map for different kernel smart account versions
*/
-const KERNEL_ADDRESSES: {
- ECDSA_VALIDATOR: Address
- ACCOUNT_... | we can use entryPoint constant, also is the new version of kernel not usable with older entryPoint? |
permissionless.js | github_2023 | typescript | 174 | pimlicolabs | plusminushalf | @@ -210,6 +358,7 @@ export type SignerToEcdsaKernelSmartAccountParameters<
address?: Address
index?: bigint
factoryAddress?: Address
+ metaFactoryAddress?: Address
accountLogicAddress?: Address
ecdsaValidatorAddress?: Address | should we have kernel version as a param? |
permissionless.js | github_2023 | typescript | 174 | pimlicolabs | plusminushalf | @@ -353,7 +535,11 @@ export async function signerToEcdsaKernelSmartAccount<
if (smartAccountDeployed) return "0x"
- return concatHex([factoryAddress, await generateInitCode()])
+ const _factoryAddress =
+ entryPointVersion === "v0.6"
+ ? factoryAd... | What is the difference between `metaFactoryAddress` and `factoryAddress` and why do we need two separate keys for it. |
permissionless.js | github_2023 | typescript | 174 | pimlicolabs | plusminushalf | @@ -0,0 +1,36 @@
+import { concatHex, maxUint16, pad, toHex } from "viem"
+import { VALIDATOR_MODE, VALIDATOR_TYPE } from "../constants"
+import {
+ KERNEL_VERSION_TO_ADDRESSES_MAP,
+ type KernelVersion
+} from "../signerToEcdsaKernelSmartAccount"
+
+export const getNonceKeyWithEncoding = (
+ accountVerion: Ke... | User might have passed a different ESDSA_VALIDATOR address in the `signerToEcdsaKernelSmartAccount` we might want to pass that down here. |
permissionless.js | github_2023 | typescript | 174 | pimlicolabs | plusminushalf | @@ -73,52 +89,175 @@ const createAccountAbi = [
}
] as const
+export type KernelVersion = "0.2.2" | "0.3.0-beta"
+
/**
- * Default addresses for kernel smart account
+ * Default addresses map for different kernel smart account versions
*/
-const KERNEL_ADDRESSES: {
- ECDSA_VALIDATOR: Address
- ACCOUNT_... | this is hard coding the ECDSA_VALIDATOR address, but we hare taking this address as a param in `signerTo..*`. We should use that address as it also defaults to `KERNEL_VERSION_TO_ADDRESSES_MAP["0.3.0-beta"].ECDSA_VALIDATOR` |
permissionless.js | github_2023 | typescript | 139 | pimlicolabs | plusminushalf | @@ -78,20 +77,20 @@ export type SmartAccountClientConfig<
*/
export function createSmartAccountClient<
- entryPoint extends EntryPoint,
- TSmartAccount extends SmartAccount<entryPoint> | undefined =
- | SmartAccount<entryPoint>
+ TEntryPoint extends EntryPoint = EntryPoint,
+ TSmartAccount exten... | Can we do use
```typescript
TSmartAccount extends SmartAccount<infer TEntryPoint>
? TEntryPoint
: never,
```
instead of `TEntryPoint` |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -242,7 +240,7 @@ export const getEoaWalletClient = () => {
export const getEntryPoint = () => {
if (!process.env.ENTRYPOINT_ADDRESS)
throw new Error("ENTRYPOINT_ADDRESS environment variable not set")
- return process.env.ENTRYPOINT_ADDRESS as Address
+ return ENTRYPOINT_ADDRESS_0_6 | hmm throughout this PR would it not be better to name this ENTRYPOINT_ADDRESS_V06 / ENTRYPOINT_ADDRESS_V07 instead of ENTRYPOINT_ADDRESS_0_6/ |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -122,14 +121,11 @@ const getAccountInitCode = async ({
})
// Build the account init code
- return concatHex([
- factoryAddress,
- encodeFunctionData({
- abi: createAccountAbi,
- functionName: "deployCounterFactualAccount",
- args: [ecdsaModuleAddress, ecd... | what is this change doing? |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -350,6 +367,32 @@ export async function signerToEcdsaKernelSmartAccount<
if (smartAccountDeployed) return "0x"
+ return concatHex([factoryAddress, await generateInitCode()])
+ },
+
+ async getFactory() {
+ if (smartAccountDeployed) return null
+
+ smart... | why check twice? |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -59,13 +77,20 @@ export class InvalidEntryPointError extends BaseError {
* // Return '0x7a88a206ba40b37a8c07a2b5688cf8b287318b63'
*/
export const getSenderAddress = async <
+ entryPoint extends EntryPoint,
TTransport extends Transport = Transport,
TChain extends Chain | undefined = Chain | undefine... | confusing |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -95,21 +130,125 @@ export async function prepareUserOperationRequest<
}
if (sponsorUserOperation) {
- userOperation = await sponsorUserOperation({
+ userOperation = (await sponsorUserOperation({
+ userOperation,
+ entryPoint: account.entryPoint
+ } as {
+ ... | in these cases would it not be better for the typing to be v0.6 instead of 0.6? |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -95,21 +130,125 @@ export async function prepareUserOperationRequest<
}
if (sponsorUserOperation) {
- userOperation = await sponsorUserOperation({
+ userOperation = (await sponsorUserOperation({
+ userOperation,
+ entryPoint: account.entryPoint
+ } as {
+ ... | why not use |= ? |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -123,5 +262,39 @@ export async function prepareUserOperationRequest<
userOperation.preVerificationGas || gasParameters.preVerificationGas
}
- return userOperation
+ return userOperation as PrepareUserOperationRequestReturnType<entryPoint>
+}
+
+export async function prepareUserOperationRequ... | weird func naming no? |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -0,0 +1,15 @@
+import type {
+ ENTRYPOINT_ADDRESS_V06_TYPE,
+ ENTRYPOINT_ADDRESS_V07_TYPE
+} from "../types"
+import type { EntryPoint, GetEntryPointVersion } from "../types/entrypoint"
+
+export const ENTRYPOINT_ADDRESS_V06: ENTRYPOINT_ADDRESS_V06_TYPE =
+ "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
+expo... | the address is not final yet right? |
permissionless.js | github_2023 | typescript | 114 | pimlicolabs | kristofgazso | @@ -18,14 +20,36 @@ export type GetRequiredPrefundReturnType = {
* userOperation
* })
*/
-export const getRequiredPrefund = ({
- userOperation
-}: GetRequiredPrefundReturnType): bigint => {
- const multiplier = userOperation.paymasterAndData.length > 2 ? 3n : 1n
+export const getRequiredPrefund = <entry... | -> userOperationVersionV07? |
permissionless.js | github_2023 | typescript | 118 | pimlicolabs | kristofgazso | @@ -172,11 +172,64 @@ describe("Safe Account", () => {
const smartAccountClient = await getSmartAccountClient({
account: await getSignerToSafeSmartAccount()
})
+
const response = await smartAccountClient.sendTransaction({
to: zeroAddress,
value: 0n,
... | log? |
permissionless.js | github_2023 | others | 92 | pimlicolabs | kristofgazso | @@ -23,20 +23,28 @@
"license": "MIT",
"scripts": {
"build": "bun run clean && bun run build:cjs && bun run build:esm && bun run build:types",
- "build:cjs": "tsc --project ./tsconfig.build.json --module commonjs --outDir ./packages/permissionless/_cjs --removeComments --verbatimModuleSyntax fa... | why a separate build step? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SmartAccountAlreadyDeployed extends BaseError {
+ static message = /aa10/
+ override name = "SmartAccountAlreadyDeployed"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Ad... | Do -> Does
Or actually why not call this smth like just:
NotEnoughFunds |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SmartAccountAlreadyDeployed extends BaseError {
+ static message = /aa10/
+ override name = "SmartAccountAlreadyDeployed"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Ad... | SmartAccountSignatureExpiredOrNotDue -> SignatureExpiredOrNotDue? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SmartAccountAlreadyDeployed extends BaseError {
+ static message = /aa10/
+ override name = "SmartAccountAlreadyDeployed"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Ad... | SmartAccountRevertedOrOutOfGasDuringValidation -> ValidationRevertedOrOutOfGas? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SmartAccountAlreadyDeployed extends BaseError {
+ static message = /aa10/
+ override name = "SmartAccountAlreadyDeployed"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Ad... | SmartAccountInvalidSignature -> InvalidSignature? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SmartAccountAlreadyDeployed extends BaseError {
+ static message = /aa10/
+ override name = "SmartAccountAlreadyDeployed"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Ad... | SmartAccountNonceInvalid -> NonceInvalid? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,55 @@
+import { BaseError } from "viem"
+
+export class InvalidBeneficiaryAddressSetByBundler extends BaseError { | InvalidBeneficiaryAddressSetByBundler -> InvalidBeneficiaryAddress |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,107 @@
+import { BaseError } from "viem"
+
+export class VerificationGasLimitNotEnough extends BaseError {
+ static message = /aa4[01]/
+ override name = "VerificationGasLimitNotEnough"
+ constructor({
+ cause,
+ verificationGasLimit,
+ docsPath
+ }: {
+ cause?: BaseEr... | I'd remove `like Pimlico` |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,235 @@
+import { BaseError, type Hex } from "viem"
+import { getAddressFromInitCodeOrPaymasterAndData } from "../utils/index.js"
+
+export class PaymasterNotDeployed extends BaseError {
+ static message = /aa30/
+ override name = "PaymasterNotDeployed"
+ constructor({
+ cause,
+ paymas... | PaymasterValidationRevertedOrNotEnoughGas -> PaymasterValidationRevertedOrOutOfGas |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SenderAlreadyDeployedError extends BaseError {
+ static message = /aa10/
+ override name = "SenderAlreadyDeployedError"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Addr... | Init code -> The initCode |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SenderAlreadyDeployedError extends BaseError {
+ static message = /aa10/
+ override name = "SenderAlreadyDeployedError"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Addr... | Init code -> The initCode |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SenderAlreadyDeployedError extends BaseError {
+ static message = /aa10/
+ override name = "SenderAlreadyDeployedError"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Addr... | but -> and |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SenderAlreadyDeployedError extends BaseError {
+ static message = /aa10/
+ override name = "SenderAlreadyDeployedError"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Addr... | pre-fund -> prefund |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SenderAlreadyDeployedError extends BaseError {
+ static message = /aa10/
+ override name = "SenderAlreadyDeployedError"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Addr... | weren't we gonna change this to SmartAccountSignatureValidityPeriodError? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,306 @@
+import { type Address, BaseError } from "viem"
+
+export class SenderAlreadyDeployedError extends BaseError {
+ static message = /aa10/
+ override name = "SenderAlreadyDeployedError"
+ constructor({
+ cause,
+ sender,
+ docsPath
+ }: { cause?: BaseError; sender?: Addr... | should we show the key and sequence separately too here? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,107 @@
+import { BaseError } from "viem"
+
+export class VerificationGasLimitTooLowError extends BaseError {
+ static message = /aa4[01]/
+ override name = "VerificationGasLimitTooLowError"
+ constructor({
+ cause,
+ verificationGasLimit,
+ docsPath
+ }: {
+ cause?: Ba... | Smart account -> The smart account |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,235 @@
+import { BaseError, type Hex } from "viem"
+import { getAddressFromInitCodeOrPaymasterAndData } from "../utils/index.js"
+
+export class PaymasterNotDeployedError extends BaseError {
+ static message = /aa30/
+ override name = "PaymasterNotDeployedError"
+ constructor({
+ cause,
+ ... | remove the colon? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,235 @@
+import { BaseError, type Hex } from "viem"
+import { getAddressFromInitCodeOrPaymasterAndData } from "../utils/index.js"
+
+export class PaymasterNotDeployedError extends BaseError {
+ static message = /aa30/
+ override name = "PaymasterNotDeployedError"
+ constructor({
+ cause,
+ ... | remove the colon? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,235 @@
+import { BaseError, type Hex } from "viem"
+import { getAddressFromInitCodeOrPaymasterAndData } from "../utils/index.js"
+
+export class PaymasterNotDeployedError extends BaseError {
+ static message = /aa30/
+ override name = "PaymasterNotDeployedError"
+ constructor({
+ cause,
+ ... | remove the colon? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,235 @@
+import { BaseError, type Hex } from "viem"
+import { getAddressFromInitCodeOrPaymasterAndData } from "../utils/index.js"
+
+export class PaymasterNotDeployedError extends BaseError {
+ static message = /aa30/
+ override name = "PaymasterNotDeployedError"
+ constructor({
+ cause,
+ ... | remove the colon? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,235 @@
+import { BaseError, type Hex } from "viem"
+import { getAddressFromInitCodeOrPaymasterAndData } from "../utils/index.js"
+
+export class PaymasterNotDeployedError extends BaseError {
+ static message = /aa30/
+ override name = "PaymasterNotDeployedError"
+ constructor({
+ cause,
+ ... | remove the colon? |
permissionless.js | github_2023 | typescript | 92 | pimlicolabs | kristofgazso | @@ -0,0 +1,235 @@
+import { BaseError, type Hex } from "viem"
+import { getAddressFromInitCodeOrPaymasterAndData } from "../utils/index.js"
+
+export class PaymasterNotDeployedError extends BaseError {
+ static message = /aa30/
+ override name = "PaymasterNotDeployedError"
+ constructor({
+ cause,
+ ... | remove the colon? |
permissionless.js | github_2023 | typescript | 47 | pimlicolabs | plusminushalf | @@ -0,0 +1,151 @@
+/**
+ * The exeuctor abi, used to execute transactions on the Biconomy Modular Smart Account
+ */
+export const BiconomyExecuteAbi = [
+ {
+ inputs: [
+ {
+ internalType: "address",
+ name: "dest",
+ type: "address"
+ },
+ ... | I think we don't use this function of the abi, we can remove this. |
permissionless.js | github_2023 | typescript | 47 | pimlicolabs | plusminushalf | @@ -0,0 +1,389 @@
+import {
+ type Account,
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type Transport,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ encodePacked,
+ getContractAddress,
+ hexToBigInt,
+ keccak256,
+ parseAbiParameters
+} from "viem"... | `SmartAccountSigner` now needs source & address; |
permissionless.js | github_2023 | typescript | 47 | pimlicolabs | plusminushalf | @@ -0,0 +1,389 @@
+import {
+ type Account,
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type Transport,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ encodePacked,
+ getContractAddress,
+ hexToBigInt,
+ keccak256,
+ parseAbiParameters
+} from "viem"... | need to resolve this. |
permissionless.js | github_2023 | typescript | 47 | pimlicolabs | plusminushalf | @@ -0,0 +1,389 @@
+import {
+ type Account,
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type Transport,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ encodePacked,
+ getContractAddress,
+ hexToBigInt,
+ keccak256,
+ parseAbiParameters
+} from "viem"... | this too |
permissionless.js | github_2023 | typescript | 47 | pimlicolabs | plusminushalf | @@ -0,0 +1,389 @@
+import {
+ type Account,
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type Transport,
+ concatHex,
+ encodeAbiParameters,
+ encodeFunctionData,
+ encodePacked,
+ getContractAddress,
+ hexToBigInt,
+ keccak256,
+ parseAbiParameters
+} from "viem"... | Can we not use:
```typescript
const initCode = await getAccountInitCode(...)
return getSenderAddress(client, {
initCode,
entryPoint
})
``` |
permissionless.js | github_2023 | typescript | 42 | pimlicolabs | plusminushalf | @@ -0,0 +1,363 @@
+import {
+ type Account,
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type Transport,
+ concatHex,
+ encodeFunctionData,
+ isAddressEqual
+} from "viem"
+import { toAccount } from "viem/accounts"
+import {
+ getBytecode,
+ getChainId,
+ readContract,
... | what do you mean by "since we will use external paymaster"? Will this impact others using this library? |
permissionless.js | github_2023 | typescript | 42 | pimlicolabs | plusminushalf | @@ -16,6 +16,11 @@ import {
smartAccountActions
} from "./decorators/smartAccount.js"
+/**
+ * TODO:
+ * - Add docs
+ * - Fix typing, 'accounts' is required to signMessage, signTypedData, signTransaction, but not needed here, since account is embedded in the client | This is not needed, as in viem in `signTransaction` you can have a client without an account and attach the account to any of the above function calls separately. |
permissionless.js | github_2023 | typescript | 42 | pimlicolabs | plusminushalf | @@ -0,0 +1,363 @@
+import {
+ type Account,
+ type Address,
+ type Chain,
+ type Client,
+ type Hex,
+ type Transport,
+ concatHex,
+ encodeFunctionData,
+ isAddressEqual
+} from "viem"
+import { toAccount } from "viem/accounts"
+import {
+ getBytecode,
+ getChainId,
+ readContract,
... | Can we define a custom error for this? |
permissionless.js | github_2023 | typescript | 10 | pimlicolabs | plusminushalf | @@ -44,8 +44,7 @@ export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus
/**
* Returns the live gas prices that you can use to send a user operation.
*
- * - Docs: [TODO://add link]
- * - Example: [TODO://add link]
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-acti... | <img width="529" alt="image" src="https://github.com/pimlicolabs/permissionless.js/assets/5251472/150e3e3f-95cf-4d8c-ac64-d8d53d2bc9c7">
We can use createPimlicoBundlerClient |
permissionless.js | github_2023 | typescript | 10 | pimlicolabs | plusminushalf | @@ -218,8 +213,7 @@ export type PimlicoPaymasterClientActions = {
/**
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
*
- * - Docs: [TODO://add link]
- * - Example: [TODO://add link]
+ * https://docs.pimlico.io/permissionless/reference/pimlico-paymas... | Can use `createPimlicoPaymasterClient`.
<img width="620" alt="image" src="https://github.com/pimlicolabs/permissionless.js/assets/5251472/d2e2626f-a87e-44c6-85dc-d241791d9a70">
|
permissionless.js | github_2023 | others | 8 | pimlicolabs | kristofgazso | @@ -42,7 +36,11 @@
"types": "./_types/clients/pimlico.d.ts",
"import": "./_esm/clients/pimlico.js",
"default": "./_cjs/clients/pimlico.js"
- }
+ },"./utils": { | (nitpick) formatting |
permissionless.js | github_2023 | typescript | 8 | pimlicolabs | kristofgazso | @@ -0,0 +1,46 @@
+import { type Address, type Hex, encodeAbiParameters, keccak256 } from "viem"
+import type { UserOperation } from "../types"
+
+function packUserOp(userOperation: UserOperation): Hex {
+ const hashedInitCode = keccak256(userOperation.initCode)
+ const hashedCallData = keccak256(userOperation.cal... | should these be positional or kwargs? |
leptonic | github_2023 | others | 77 | lpotthast | ydirson | @@ -30,33 +30,33 @@ js-sys = "0.3.68"
leptos = "0.6.5"
leptos_reactive = "0.6.5"
leptos-tiptap = { version = "0.7.0", optional = true }
-leptos-use = { version = "0.10.2", features = ["math"] }
+leptos-use = { version = "0.12.0", features = ["math"] }
icondata = { version = "0.3.0" }
leptos_meta = { version = "0.6... | this and other indent changes just introduce noise |
leptonic | github_2023 | others | 77 | lpotthast | ydirson | @@ -30,33 +30,33 @@ js-sys = "0.3.68"
leptos = "0.6.5"
leptos_reactive = "0.6.5"
leptos-tiptap = { version = "0.7.0", optional = true }
-leptos-use = { version = "0.10.2", features = ["math"] }
+leptos-use = { version = "0.12.0", features = ["math"] } | This is highly unrelated to the `time` issue - Leptonic even build fine with Rust 1.80 and `leptos-use` 0.10.10, though there are errors that do need handling, which may have an origin similar to that of the `time` create. |
leptonic | github_2023 | others | 77 | lpotthast | ydirson | @@ -30,33 +30,33 @@ js-sys = "0.3.68"
leptos = "0.6.5"
leptos_reactive = "0.6.5"
leptos-tiptap = { version = "0.7.0", optional = true }
-leptos-use = { version = "0.10.2", features = ["math"] }
+leptos-use = { version = "0.12.0", features = ["math"] }
icondata = { version = "0.3.0" }
leptos_meta = { version = "0.6... | And this is the version on `main`, which has no issue getting a fixed `time` crate - the problem is really the `=0.3.31` in the v0.5.0 release |
leptonic | github_2023 | others | 16 | lpotthast | paulvt | @@ -1,7 +1,7 @@
use std::fmt::{Display, Formatter};
use leptos::{
- leptos_dom::{Callable, Callback},
+ Callable, Callback, | `Callable` and `Callback` are included in `leptos::*` by default now, so these can be removed (in this file and all the others)! |
leptonic | github_2023 | others | 16 | lpotthast | paulvt | @@ -1,7 +1,7 @@
use std::fmt::Display;
use leptos::{
- leptos_dom::{Callable, Callback, StoredCallback},
+ Callable, Callback, StoredValue,
| The same holds for `StoredValue` 🙂 |
novel | github_2023 | others | 403 | steven-tey | andrewdoro | @@ -200,4 +200,12 @@ div[data-youtube-video] > iframe {
div[data-youtube-video] > iframe {
max-height: 100px;
}
+}
+
+span[style] > strong {
+ color: inherit;
+}
+
+mark[style] > strong {
+ color: inherit; | hey thanks for the change, it would be great if you can also add the changes to the prosemirror docs file |
novel | github_2023 | typescript | 400 | steven-tey | andrewdoro | @@ -28,7 +29,7 @@ const Command = Extension.create({
},
});
-const renderItems = () => {
+const renderItems = (elementRef: RefObject<Element> | null = null) => { | I think you need to make the elementRef optional
`elementRef?: RefObject<Element> | null = null`
I just want to be sure that TS won't complain about missing argument when calling renderItems() |
novel | github_2023 | typescript | 375 | steven-tey | maks-ivanov | @@ -106,6 +112,16 @@ const starterKit = StarterKit.configure({
gapcursor: false,
});
+const lowlight = createLowlight(common);
+lowlight.register("html", html);
+lowlight.register("css", css);
+lowlight.register("js", js);
+lowlight.register("ts", ts);
+
+const codeBlockLowlight = CodeBlockLowlight.configure({
+ ... | Nice, I've been looking at implementing this feature!
I think this would need a way to specify languages via configuration, since this block basically just hardcodes these 4 |
novel | github_2023 | typescript | 361 | steven-tey | haydenbleasel | @@ -38,7 +40,10 @@ const simpleExtensions = [
transformCopiedText: true,
}),
CustomKeymap,
- DragAndDrop,
+ GlobalDragHandle.configure({
+ scrollTreshold: 0, | Typo |
novel | github_2023 | typescript | 350 | steven-tey | andrewdoro | @@ -12,6 +12,17 @@ export interface DragHandleOptions {
}
function absoluteRect(node: Element) {
const data = node.getBoundingClientRect();
+ const modal = node.closest('[role="dialog"]'); | should we also add something about this to the docs, I don't know if all people use this attr for their dialog`[role="dialog"]`. Wyt? |
novel | github_2023 | typescript | 297 | steven-tey | chrisp018 | @@ -53,26 +55,94 @@ export async function POST(req: Request): Promise<Response> {
}
}
- let { prompt } = await req.json();
+ let { prompt, option } = await req.json();
- const response = await openai.chat.completions.create({
- model: process.env.NODE_ENV == "development" ? "llama2" : "gpt-3.5-turbo",... | 

Do you think we should add further information for content?, I just added simple expand sentence like this
```content... |
novel | github_2023 | typescript | 136 | steven-tey | jeloi | @@ -0,0 +1,172 @@
+import StarterKit, { StarterKitOptions } from "@tiptap/starter-kit";
+import HorizontalRule from "@tiptap/extension-horizontal-rule";
+import TiptapLink from "@tiptap/extension-link";
+import TiptapImage from "@tiptap/extension-image";
+import Placeholder from "@tiptap/extension-placeholder";
+import... | could we make this a param thats passed in? alternative is to just supporting override extensions entirely to configure a custom one, but could be too heavy handed. |
novel | github_2023 | typescript | 47 | steven-tey | steven-tey | @@ -140,12 +141,13 @@ export default function Editor() {
onClick={() => {
editor?.chain().focus().run();
}}
- className="relative min-h-[500px] w-full max-w-screen-lg border-stone-200 p-12 px-8 sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:px-12 sm:shadow-lg"
+ className=" min-h-[500px]... | This breaks the Save Status component's positioning:

|
novel | github_2023 | typescript | 18 | steven-tey | steven-tey | @@ -33,8 +35,10 @@ export const metadata: Metadata = {
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
- <Toaster />
- <body className={cx(cal.variable, inter.variable)}>{children}</body>
+ <body className={cx(cal.variable, inter.variable)}>
... | Perfect – this has actually been bugging me for a while haha so thank you! |
novel | github_2023 | others | 161 | steven-tey | MarkLyck | @@ -150,7 +150,7 @@ ul[data-type="taskList"] li[data-checked="true"] > div > p {
}
&:active {
- background-color: var(--novel-stone-200);
+ background-color: var(--nnovel-stone-200); | Is this supposed to have two `n`'s? |
novel | github_2023 | typescript | 93 | steven-tey | jasonLaster | @@ -0,0 +1,83 @@
+import { defineConfig, devices } from '@playwright/test';
+import { devices as replayDevices } from "@replayio/playwright";
+
+
+/**
+ * Read environment variables from file.
+ * https://github.com/motdotla/dotenv
+ */
+// require('dotenv').config();
+
+/**
+ * See https://playwright.dev/docs/test-con... | we probably should remove the comments |
novel | github_2023 | typescript | 93 | steven-tey | jasonLaster | @@ -0,0 +1,49 @@
+import { test, expect } from '@playwright/test';
+
+test('editing the content should work', async ({ page }) => {
+ await page.goto('http://localhost:3000/');
+ await expect(page.getByText("Hello World!")).toHaveCount(0)
+
+ await page.getByRole('heading', { name: 'Introducing Novel' }).click();
... | comments... |
novel | github_2023 | others | 93 | steven-tey | jasonLaster | @@ -0,0 +1,38 @@
+name: Playwright Tests
+on:
+ push:
+ branches: [main, master]
+ pull_request:
+ branches: [main, master]
+jobs:
+ test:
+ timeout-minutes: 60
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-vers... | lets do `public:true` so these replays are publicly available |
novel | github_2023 | typescript | 62 | steven-tey | steven-tey | @@ -7,6 +7,7 @@ import { Analytics } from "@vercel/analytics/react";
import { Metadata } from "next";
import Toaster from "./toaster";
import { ReactNode } from "react";
+import { cookies } from "next/dist/client/components/headers"; | This should be `import { cookies } from 'next/headers'` |
novel | github_2023 | typescript | 62 | steven-tey | steven-tey | @@ -1,31 +1,43 @@
import Editor from "@/ui/editor";
+import { ThemeSwitcher } from "@/ui/editor/components/theme-switcher";
import Github from "@/ui/shared/github";
+import { cookies } from "next/dist/client/components/headers";
export default function Page() {
+
+ const theme = cookies().get("theme")?.value === ... | Can we standardize to use shades of `stone` instead of `slate` please? 🙏 |
Swift-Macros | github_2023 | others | 65 | krzysztofzablocki | krzysztofzablocki | @@ -149,11 +149,12 @@ that implements the same interface as the protocol and keeps track of interactio
- [Reuse Identifier](https://github.com/collisionspace/ReuseIdentifierMacro): A Reuse Identifier Macro that is useful in generation of a reuse id for your UICollectionViewCells and UITableViewCells
- [SwiftMacros co... | shouldn't modify this :) |
nestjs-resilience | github_2023 | typescript | 320 | SocketSomeone | SocketSomeone | @@ -53,6 +57,18 @@ export class CircuitBreakerStrategy extends Strategy<CircuitBreakerOptions> {
const failuresPercentage = () =>
(state.failuresCount / this.options.requestVolumeThreshold) * 100;
+ if (this.options.rollingWindowInMilliseconds) {
+ const rollingWindowHasExpired = () =>
+ Date.n... | Why we set last request only when rolling window has expired not every request? If its has no meaning - will be merged |
nestjs-resilience | github_2023 | typescript | 320 | SocketSomeone | SocketSomeone | @@ -0,0 +1,57 @@
+import { CircuitBreakerStrategy, UseResilience } from '../../src'; | You created new decorator spec, but test for circuit strategy already created, maybe use previous? |
nestjs-resilience | github_2023 | typescript | 320 | SocketSomeone | SocketSomeone | @@ -53,6 +57,18 @@ export class CircuitBreakerStrategy extends Strategy<CircuitBreakerOptions> {
const failuresPercentage = () =>
(state.failuresCount / this.options.requestVolumeThreshold) * 100;
+ if (this.options.rollingWindowInMilliseconds) {
+ const rollingWindowHasExpired = () =>
+ Date.n... | ```suggestion
}
state.lastRequestTimeMs = Date.now();
``` |
lm-human-preference-details | github_2023 | python | 19 | vwxyzjn | lewtun | @@ -510,6 +514,37 @@ def train(args: Args):
)
dataloader = DataLoader(dataset, batch_size=args.ppo.local_batch_size)
policy, optimizer, dataloader = accelerator.prepare(policy, optimizer, dataloader)
+ if args.deepspeed:
+ import deepspeed
+
+ deepspeed_states = AcceleratorState().deepsp... | Note that this will slow down your code significantly. I would allow the option to be set as an option that's inferred from the `accelerate` config as I did here: https://github.com/huggingface/trl/pull/758 |
lm-human-preference-details | github_2023 | python | 19 | vwxyzjn | lewtun | @@ -510,6 +514,37 @@ def train(args: Args):
)
dataloader = DataLoader(dataset, batch_size=args.ppo.local_batch_size)
policy, optimizer, dataloader = accelerator.prepare(policy, optimizer, dataloader)
+ if args.deepspeed:
+ import deepspeed
+
+ deepspeed_states = AcceleratorState().deepsp... | I think this flag is only needed if each node has a separate local filesystem. For the HFC case, you probably don't need it |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.