> ## Documentation Index
> Fetch the complete documentation index at: https://armory.sh/llms.txt
> Use this file to discover all available pages before exploring further.

> Web3.js payment client

# @armory-sh/client-web3

Make payments using Web3.js wallets.

## Installation

```bash theme={null}
# npm
npm install @armory-sh/client-web3

# yarn
yarn add @armory-sh/client-web3

# pnpm
pnpm add @armory-sh/client-web3

# bun
bun add @armory-sh/client-web3
```

## armoryPay

```typescript theme={null}
import { armoryPay } from '@armory-sh/client-web3';
import { Web3 } from 'web3';

const web3 = new Web3('https://...');
const account = web3.eth.accounts.wallet.add('0x...')[0];

const result = await armoryPay(
  { web3, account },
  'https://api.example.com/data',
  'base',
  'usdc'
);

if (result.success) {
  console.log(result.data);
} else {
  console.error(result.code, result.message);
}
```

## createArmoryClient

```typescript theme={null}
import { createArmoryClient } from '@armory-sh/client-web3';

const armory = createArmoryClient({
  web3,
  account,
});

const result = await armory.pay({
  to: '0x...',
  amount: '1000000000',
  token: TOKENS.USDC_BASE,
});
```
