Skip to main content
Deploys wallets via the factory contract, settles the payment, and optionally funds the newly deployed wallets. Call /deploy/verify first to compute addresses and fees. Two flows are available depending on how the payer signs the transaction.

EOA Deploy Settle

POST /deploy/settle
Submits signed EIP-712 payment payloads and triggers on-chain deployment.

Request Body

FieldTypeRequiredDescription
paymentPayloadPaymentPayload[]YesSame signed payments from the verify step
paymentRequirementsobjectYesSame configuration from the verify step
paymentRequirements.networkstringYesTarget network ("bsc" or "base")
paymentRequirements.relayerContractstringYesb402 Relayer contract address
paymentRequirements.deploymentobjectYesDeployment parameters
paymentRequirements.deployment.ownerAddressstringYesOwner of the wallets
paymentRequirements.deployment.saltsstring[]Yes1-10 salts matching the verify request
paymentRequirements.deployment.fundingRequestedbooleanYesWhether to fund wallets after deployment
paymentRequirements.deployment.tokenstringYesERC-20 token contract address
walletsobject[]YesWallet array returned from /deploy/verify
wallets[].addressstringYesDeterministic wallet address
wallets[].saltstringYesSalt for this wallet
wallets[].ownerstringYesOwner address
wallets[].fundingAmountstringYesAmount to fund (wei), "0" if no funding

Response (200)

FieldTypeDescription
paymentSuccessbooleanWhether the fee payment settled on-chain
deploymentSuccessbooleanWhether all wallets deployed successfully
fundingSuccessbooleanWhether all funding transfers completed
walletsobject[]Per-wallet deployment results
wallets[].addressstringDeployed wallet address
wallets[].deploymentTxHashstringTransaction hash for deployment
wallets[].fundingTxHashstring | nullTransaction hash for funding, null if not requested
wallets[].fundingCompletedbooleanWhether this wallet was funded
failedWalletsstring[]Addresses that failed to deploy
failedFundingsstring[]Addresses that failed to receive funding
paymentTxHashstringTransaction hash for the fee payment
deploymentFeestringFee charged (wei)

cURL

curl -X POST https://facilitatorv3.b402.ai/deploy/settle \
  -H "Content-Type: application/json" \
  -d '{
    "paymentPayload": [
      {
        "token": "0x55d398326f99059fF775485246999027B3197955",
        "payload": {
          "authorization": {
            "from": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
            "to": "0xE91b564EB8DFF305Ff8efA332f84c487b9da5171",
            "value": "500000000000000000",
            "validAfter": 1709251200,
            "validBefore": 1709254800,
            "nonce": "0xaaa...fee_nonce"
          },
          "signature": "0x...fee_signature"
        }
      }
    ],
    "paymentRequirements": {
      "network": "bsc",
      "relayerContract": "0xE91b564EB8DFF305Ff8efA332f84c487b9da5171",
      "deployment": {
        "ownerAddress": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
        "salts": ["0x1234...master_salt"],
        "fundingRequested": false,
        "token": "0x55d398326f99059fF775485246999027B3197955"
      }
    },
    "wallets": [
      {
        "address": "0x...computed_address",
        "salt": "0x1234...master_salt",
        "owner": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
        "fundingAmount": "0"
      }
    ]
  }'

TypeScript

// After calling /deploy/verify
const verifyResult = await verifyResponse.json();

const settleResponse = await fetch("https://facilitatorv3.b402.ai/deploy/settle", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    paymentPayload: [feePayload, ...fundingPayloads],
    paymentRequirements: {
      network: "bsc", // or "base"
      relayerContract: "0xE91b564EB8DFF305Ff8efA332f84c487b9da5171",
      deployment: {
        ownerAddress: wallet.address,
        salts: [masterSalt],
        fundingRequested: true,
        token: "0x55d398326f99059fF775485246999027B3197955",
      },
    },
    wallets: verifyResult.wallets,
  }),
});

const result = await settleResponse.json();

if (result.deploymentSuccess) {
  for (const w of result.wallets) {
    console.log(`Deployed ${w.address} - tx: ${w.deploymentTxHash}`);
    if (w.fundingCompleted) {
      console.log(`  Funded - tx: ${w.fundingTxHash}`);
    }
  }
} else {
  console.error("Failed wallets:", result.failedWallets);
}

Smart Wallet Deploy Settle

POST /deploy/wallet/settle
For smart wallet payers, submit the signed UserOp from the verify step instead of EIP-712 payment payloads.

Request Body

FieldTypeRequiredDescription
userOpobjectYesUserOp from /deploy/wallet/verify
signaturestringYesClient signature of userOpHash
paymentRequirementsobjectYesSame configuration from the verify step
paymentRequirements.networkstringYesTarget network ("bsc" or "base")
paymentRequirements.deploymentobjectYesDeployment parameters
paymentRequirements.deployment.ownerAddressstringYesOwner of the wallets
paymentRequirements.deployment.saltsstring[]YesSalts matching the verify request
paymentRequirements.deployment.tokenstringYesERC-20 token contract address
paymentRequirements.deployment.payerAddressstringYesSmart wallet address paying for deployment
walletsobject[]YesWallet array returned from /deploy/wallet/verify

Response (200)

The response schema is identical to the EOA deploy settle response above.

cURL

curl -X POST https://facilitatorv3.b402.ai/deploy/wallet/settle \
  -H "Content-Type: application/json" \
  -d '{
    "userOp": { "sender": "0x...", "nonce": "0x...", "callData": "0x...", "..." : "..." },
    "signature": "0x...signed_userOpHash",
    "paymentRequirements": {
      "network": "bsc",
      "deployment": {
        "ownerAddress": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
        "salts": ["0x1234...master_salt"],
        "token": "0x55d398326f99059fF775485246999027B3197955",
        "payerAddress": "0x...nexus_smart_wallet"
      }
    },
    "wallets": [
      {
        "address": "0x...computed_address",
        "salt": "0x1234...master_salt",
        "owner": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
        "fundingAmount": "0"
      }
    ]
  }'

TypeScript

// After calling /deploy/wallet/verify and signing the userOpHash
const verifyResult = await verifyResponse.json();

// Sign the userOpHash with the smart wallet owner's key
const signature = await walletOwner.signMessage(
  ethers.getBytes(verifyResult.userOpHash)
);

const settleResponse = await fetch("https://facilitatorv3.b402.ai/deploy/wallet/settle", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    userOp: verifyResult.userOp,
    signature,
    paymentRequirements: {
      network: "bsc", // or "base"
      deployment: {
        ownerAddress: ownerAddress,
        salts: [masterSalt],
        token: "0x55d398326f99059fF775485246999027B3197955",
        payerAddress: smartWalletAddress,
      },
    },
    wallets: verifyResult.wallets,
  }),
});

const result = await settleResponse.json();

if (result.deploymentSuccess) {
  console.log("All wallets deployed successfully");
} else {
  console.error("Failed wallets:", result.failedWallets);
  // Use /wallet/claim to retry failed deployments
}

Settlement Process

The facilitator executes these steps in order:
  1. Settle payment - Executes the fee payment on-chain (EIP-712 transfer or UserOp submission)
  2. Deploy wallets - Calls the factory contract with each salt to deploy wallets via CREATE2
  3. Fund wallets - If funding was requested, transfers tokens to each newly deployed wallet
  4. Return results - Reports per-wallet success/failure for both deployment and funding
If payment succeeds but deployment or funding partially fails, the payment is not reversed. Use /wallet/claim to retry failed deployments and fundings.
The facilitator covers all gas costs for deployment and funding transactions.

Error Codes

CodeHTTP StatusDescription
validation_error400Missing required fields or wallets array doesn’t match verify response
payment_settlement_error500Fee payment transaction reverted on-chain
deployment_error500Factory contract call failed for one or more wallets
funding_error500Funding transfer failed for one or more wallets
blockchain_error500RPC or network-level failure