Skip to content

Commit

Permalink
Merge pull request #19 from aymericdelab/15-add-multicall-functionality
Browse files Browse the repository at this point in the history
feat: resolved #15 by adding multicall
  • Loading branch information
ponderingdemocritus authored Oct 16, 2023
2 parents d373c38 + 6e24d0a commit b831a82
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions packages/core/src/provider/RPCProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RpcProvider, Account, num, InvokeFunctionResponse, Contract, Result, shortString, InvocationsDetails } from "starknet";
import { RpcProvider, Account, num, InvokeFunctionResponse, Contract, Result, shortString, InvocationsDetails, AllowArray, Call } from "starknet";
import { Provider } from "./provider";
import { Query, WorldEntryPoints } from "../types";
import { LOCAL_KATANA } from '../constants';
Expand Down Expand Up @@ -81,28 +81,20 @@ export class RPCProvider extends Provider {
* Executes a function with the given parameters.
*
* @param {Account} account - The account to use.
* @param {string} contract - The contract to execute.
* @param {string} call - The function to call.
* @param {num.BigNumberish[]} call_data - The call data for the function.
* @param {AllowArray<Call>} calls - The calls to execute.
* @param {InvocationsDetails | undefined} transactionDetails - The transactionDetails allow to override maxFee & version
* @returns {Promise<InvokeFunctionResponse>} - A promise that resolves to the response of the function execution.
*/
public async execute(
account: Account,
contract: string,
call: string,
calldata: num.BigNumberish[],
calls: AllowArray<Call>,
transactionDetails?: InvocationsDetails | undefined
): Promise<InvokeFunctionResponse> {
try {
const nonce = await account?.getNonce()

return await account?.execute(
{
contractAddress: contract,
entrypoint: call,
calldata: calldata
},
calls,
undefined,
{
maxFee: 0, // TODO: Update this value as needed.
Expand Down

0 comments on commit b831a82

Please sign in to comment.