---
updatedAt: 2025-06-09T22:51:29.000Z
agentTools:
  projectIndex: https://docs.metakeep.xyz/llms.txt
---

# Create Lambda

In this tutorial, we are excited to discuss `LambdaV3` and the powerful `Business Wallets`. Unlike its predecessor, `LambdaV2` which required developers to make modifications to the smart contracts, `LambdaV3 `offers an efficient and seamless deployment process without requiring any changes to the contract code.

## Getting Started with Lambda Business Wallets

The first step is to get an API key. To do so, sign up [here](https://docs.metakeep.xyz/reference/get-a-developer-account).

In this tutorial, we will start with a basic Voting Smart contract from our [GitHub repo](https://github.com/PassbirdCo/MetaKeepCodeSamples/blob/main/lambda/business-wallet/batch-transactions/smart-contracts/contracts/Voting.sol).

You can find an end-to-end working demo [here](https://github.com/PassbirdCo/MetaKeepCodeSamples/blob/main/lambda/business-wallet/batch-transactions/).

### Step 1: Compile your contract

Once you have developed and tested your smart contract, compile your contract to get the contract `bytecode` and `ABI`.

### Step 2: Prepare  a POST request to the `lambda/create` API

Let's construct the request body using all the information from the previous step as shown below.

```json
{
  "name": <Lambda_Name>,
  "constructor" : { args : ["arg1", "arg2"]},
  "bytecode" : <Bytecode>,
  "abi" : < ABI >
}
```

### Step 3: Call create API to deploy your contract

To deploy your contract, make a POST request to the API. For this, you would require an `API Key` and an [Idempotency Key](https://docs.metakeep.xyz/reference/idempotency-key). Here's how you would make a request to API.

```javascript Call Lambda Create
const fetch = require('node-fetch');

const url = 'https://api.metakeep.xyz/v2/app/lambda/create';
const request_body = {
  "name": <Lambda_Name>,
  "constructor" : { args : ["arg1", "arg2"]},
  "bytecode" : <Bytecode>,
  "abi" : < ABI >
}

const options = {
  method: 'POST',
  headers: {
  'Accept': 'application/json',
  'Content-Type': 'application/json',
  'x-api-key': <API_KEY>,
  'Idempotency-Key’: <IDEMPOTENCY_KEY>
  },
  body: JSON.stringify(request_body)
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
```

This is what you should see as the response from the create API:

```json Create Response
{
  status: 'QUEUED',
  transactionId: '1f424819-4ddc-4bcb-9054-ca75b2719f9b',
  transactionHash: '0x9b304e368e0d5d6398c6dd6ad5e216bfc80fefebb99897e8238633ef1d957b7a',
  transactionChainScanUrl: 'https://mumbai.polygonscan.com/tx/0x9b304e368e0d5d6398c6dd6ad5e216bfc80fefebb99897e8238633ef1d957b7a',
  lambda: '0x17192E38Db788a15432149C93101C6cB040dE7C2'
}
```

> 📘 Note the lambda field in the response
>
> The `lambda` field gives you the address of your smart contract. Ensure that you keep the address recorded because it will be used for lambda invocation (You can always get the list of your deployed lambdas using the [list lambdas](https://docs.metakeep.xyz/reference/list-lambdas) API).

## Running the demo

You can find an end-to-end working demo [here](https://github.com/PassbirdCo/MetaKeepCodeSamples/blob/main/lambda/business-wallet/batch-transactions/). Follow these steps to run the demo:

### Step 1: Compile the contract

Navigate to the `lambda/business-wallet/batch-transactions/smart-contracts`directory. Then, run the command:

```shell Shell
npm install
npx hardhat compile
```

### Step 2: Update the .env file

Update the API key in the [.env](https://github.com/PassbirdCo/MetaKeepCodeSamples/blob/main/lambda/business-wallet/batch-transactions/scripts/.env) file.

### Step 3: Run the Script

Navigate to the `lambda/business-wallet/batch-transactions/scripts` directory. Then run the command:

```Text Shell
npm install
npm run create
```

The demo will deploy the lambda, and wait for the transaction mining. You will see the created `lambda address` in the output of the script.

## Next Steps

Voila! You have deployed your first lambda contract with `business wallet`🎉🎉.

Next, we will discuss making batch calls to the deployed contract using `business wallet`.