-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8638d9b
commit e4afc83
Showing
1 changed file
with
62 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,170 +1,170 @@ | ||
import { type GetFunctionArgs, encodeFunctionData } from 'viem' | ||
import type { Plugin } from './types' | ||
import type { BaseSmartContractAccount } from '@alchemy/aa-core' | ||
import { type GetFunctionArgs, encodeFunctionData } from "viem"; | ||
import type { Plugin } from "./types"; | ||
import type { BaseSmartContractAccount } from "@alchemy/aa-core"; | ||
|
||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// ERC6900PluginGen: This file is auto-generated by plugingen | ||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
const MultiOwnerPlugin_ = { | ||
meta: { | ||
name: 'Multi Owner Plugin', | ||
version: '1.0.0', | ||
name: "Multi Owner Plugin", | ||
version: "1.0.0", | ||
}, | ||
accountDecorators: (account: BaseSmartContractAccount) => ({ | ||
encodeUpdateOwnersData: ({ | ||
args, | ||
}: GetFunctionArgs< | ||
typeof MultiOwnerPluginExecutionFunctionAbi, | ||
'updateOwners' | ||
"updateOwners" | ||
>) => { | ||
return encodeFunctionData({ | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'updateOwners', | ||
functionName: "updateOwners", | ||
args, | ||
}) | ||
}); | ||
}, | ||
|
||
encodeOwnersData: () => { | ||
return encodeFunctionData({ | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'owners', | ||
}) | ||
functionName: "owners", | ||
}); | ||
}, | ||
|
||
readOwners: async () => { | ||
return account.rpcProvider.readContract({ | ||
address: await account.getAddress(), | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'owners', | ||
}) | ||
functionName: "owners", | ||
}); | ||
}, | ||
|
||
encodeIsOwnerData: ({ | ||
args, | ||
}: GetFunctionArgs< | ||
typeof MultiOwnerPluginExecutionFunctionAbi, | ||
'isOwner' | ||
"isOwner" | ||
>) => { | ||
return encodeFunctionData({ | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'isOwner', | ||
functionName: "isOwner", | ||
args, | ||
}) | ||
}); | ||
}, | ||
|
||
readIsOwner: async ({ | ||
args, | ||
}: GetFunctionArgs< | ||
typeof MultiOwnerPluginExecutionFunctionAbi, | ||
'isOwner' | ||
"isOwner" | ||
>) => { | ||
return account.rpcProvider.readContract({ | ||
address: await account.getAddress(), | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'isOwner', | ||
functionName: "isOwner", | ||
args, | ||
}) | ||
}); | ||
}, | ||
|
||
encodeEip712DomainData: () => { | ||
return encodeFunctionData({ | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'eip712Domain', | ||
}) | ||
functionName: "eip712Domain", | ||
}); | ||
}, | ||
|
||
readEip712Domain: async () => { | ||
return account.rpcProvider.readContract({ | ||
address: await account.getAddress(), | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'eip712Domain', | ||
}) | ||
functionName: "eip712Domain", | ||
}); | ||
}, | ||
|
||
encodeIsValidSignatureData: ({ | ||
args, | ||
}: GetFunctionArgs< | ||
typeof MultiOwnerPluginExecutionFunctionAbi, | ||
'isValidSignature' | ||
"isValidSignature" | ||
>) => { | ||
return encodeFunctionData({ | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'isValidSignature', | ||
functionName: "isValidSignature", | ||
args, | ||
}) | ||
}); | ||
}, | ||
|
||
readIsValidSignature: async ({ | ||
args, | ||
}: GetFunctionArgs< | ||
typeof MultiOwnerPluginExecutionFunctionAbi, | ||
'isValidSignature' | ||
"isValidSignature" | ||
>) => { | ||
return account.rpcProvider.readContract({ | ||
address: await account.getAddress(), | ||
abi: MultiOwnerPluginExecutionFunctionAbi, | ||
functionName: 'isValidSignature', | ||
functionName: "isValidSignature", | ||
args, | ||
}) | ||
}); | ||
}, | ||
}), | ||
} | ||
}; | ||
|
||
export const MultiOwnerPlugin: Plugin< | ||
ReturnType<(typeof MultiOwnerPlugin_)['accountDecorators']> | ||
> = MultiOwnerPlugin_ | ||
ReturnType<(typeof MultiOwnerPlugin_)["accountDecorators"]> | ||
> = MultiOwnerPlugin_; | ||
|
||
export const MultiOwnerPluginExecutionFunctionAbi = [ | ||
{ | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
stateMutability: "nonpayable", | ||
type: "function", | ||
inputs: [ | ||
{ name: 'ownersToAdd', internalType: 'address[]', type: 'address[]' }, | ||
{ name: 'ownersToRemove', internalType: 'address[]', type: 'address[]' }, | ||
{ name: "ownersToAdd", internalType: "address[]", type: "address[]" }, | ||
{ name: "ownersToRemove", internalType: "address[]", type: "address[]" }, | ||
], | ||
name: 'updateOwners', | ||
name: "updateOwners", | ||
outputs: [], | ||
}, | ||
{ | ||
stateMutability: 'view', | ||
type: 'function', | ||
stateMutability: "view", | ||
type: "function", | ||
inputs: [], | ||
name: 'owners', | ||
outputs: [{ name: '', internalType: 'address[]', type: 'address[]' }], | ||
name: "owners", | ||
outputs: [{ name: "", internalType: "address[]", type: "address[]" }], | ||
}, | ||
{ | ||
stateMutability: 'view', | ||
type: 'function', | ||
stateMutability: "view", | ||
type: "function", | ||
inputs: [ | ||
{ name: 'ownerToCheck', internalType: 'address', type: 'address' }, | ||
{ name: "ownerToCheck", internalType: "address", type: "address" }, | ||
], | ||
name: 'isOwner', | ||
outputs: [{ name: '', internalType: 'bool', type: 'bool' }], | ||
name: "isOwner", | ||
outputs: [{ name: "", internalType: "bool", type: "bool" }], | ||
}, | ||
{ | ||
stateMutability: 'view', | ||
type: 'function', | ||
stateMutability: "view", | ||
type: "function", | ||
inputs: [], | ||
name: 'eip712Domain', | ||
name: "eip712Domain", | ||
outputs: [ | ||
{ name: 'fields', internalType: 'bytes1', type: 'bytes1' }, | ||
{ name: 'name', internalType: 'string', type: 'string' }, | ||
{ name: 'version', internalType: 'string', type: 'string' }, | ||
{ name: 'chainId', internalType: 'uint256', type: 'uint256' }, | ||
{ name: 'verifyingContract', internalType: 'address', type: 'address' }, | ||
{ name: 'salt', internalType: 'bytes32', type: 'bytes32' }, | ||
{ name: 'extensions', internalType: 'uint256[]', type: 'uint256[]' }, | ||
{ name: "fields", internalType: "bytes1", type: "bytes1" }, | ||
{ name: "name", internalType: "string", type: "string" }, | ||
{ name: "version", internalType: "string", type: "string" }, | ||
{ name: "chainId", internalType: "uint256", type: "uint256" }, | ||
{ name: "verifyingContract", internalType: "address", type: "address" }, | ||
{ name: "salt", internalType: "bytes32", type: "bytes32" }, | ||
{ name: "extensions", internalType: "uint256[]", type: "uint256[]" }, | ||
], | ||
}, | ||
{ | ||
stateMutability: 'view', | ||
type: 'function', | ||
stateMutability: "view", | ||
type: "function", | ||
inputs: [ | ||
{ name: 'digest', internalType: 'bytes32', type: 'bytes32' }, | ||
{ name: 'signature', internalType: 'bytes', type: 'bytes' }, | ||
{ name: "digest", internalType: "bytes32", type: "bytes32" }, | ||
{ name: "signature", internalType: "bytes", type: "bytes" }, | ||
], | ||
name: 'isValidSignature', | ||
outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], | ||
name: "isValidSignature", | ||
outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], | ||
}, | ||
] as const | ||
] as const; |