Skip to content

Commit 2de955c

Browse files
authored
Merge pull request #12 from second-state/rename-x402-common
Rename x402-common to payment-common
2 parents 378d073 + 20c613c commit 2de955c

17 files changed

Lines changed: 33 additions & 33 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Payment skill for AI agents (Claude Code, OpenClaw, OpenCode) to make and receiv
3232

3333
## Directory Structure
3434

35-
- `x402-common/` - Shared library (config, wallet, errors)
35+
- `payment-common/` - Shared library (config, wallet, errors)
3636
- `create-wallet/` - Wallet creation tool
3737
- `get-address/` - Get wallet address and balance
3838
- `pay/` - Make payments

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"x402-common",
4+
"payment-common",
55
"payment-config",
66
"create-wallet",
77
"get-address",

PLAN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This skill enables Claude agents to handle HTTP 402 (Payment Required) responses
1010
x402_skill/
1111
├── Cargo.toml # Workspace manifest
1212
├── PLAN.md # This file
13-
├── x402-common/ # Shared library crate
13+
├── payment-common/ # Shared library crate
1414
│ ├── Cargo.toml
1515
│ └── src/
1616
│ ├── lib.rs
@@ -175,7 +175,7 @@ x402_skill/
175175

176176
## Shared Components
177177

178-
Consider creating a shared library crate (`x402-common`) for:
178+
Consider creating a shared library crate (`payment-common`) for:
179179
- Wallet loading/decryption
180180
- Configuration file handling (`~/.payment/config.toml`)
181181
- Common types and error handling
@@ -340,9 +340,9 @@ payment-config use-network base-mainnet
340340

341341
## Implementation Order
342342

343-
1. **x402-common** - Shared library with config and wallet utilities
343+
1. **payment-common** - Shared library with config and wallet utilities
344344
2. **payment-config** - Configuration management; needed to set up environment
345-
3. **create-wallet** - Wallet generation (uses x402-common)
345+
3. **create-wallet** - Wallet generation (uses payment-common)
346346
4. **get-address** - Simple, validates wallet format
347347
5. **pay** - Core payment logic
348348
6. **x402curl** - Integrates everything

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ This is a Rust workspace with the following crates:
134134

135135
| Crate | Description |
136136
|-------|-------------|
137-
| `x402-common` | Shared library for configuration, errors, and utilities |
137+
| `payment-common` | Shared library for configuration, errors, and utilities |
138138
| `create-wallet` | Wallet creation CLI |
139139
| `get-address` | Address retrieval CLI |
140140
| `pay` | Token payment CLI |

create-wallet/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ version.workspace = true
44
edition = "2021"
55
authors.workspace = true
66
license.workspace = true
7-
description = "Create a new Ethereum-compatible wallet for x402 payments"
7+
description = "Create a new Ethereum-compatible wallet for payments"
88

99
[[bin]]
1010
name = "create-wallet"
1111
path = "src/main.rs"
1212

1313
[dependencies]
14-
x402_common = { path = "../x402-common" }
14+
payment_common = { path = "../payment-common" }
1515
clap = { version = "4", features = ["derive"] }

create-wallet/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use clap::Parser;
2+
use payment_common::{default_config_path, Config, Wallet};
23
use std::fs;
34
use std::path::PathBuf;
45
use std::process::ExitCode;
5-
use x402_common::{default_config_path, Config, Wallet};
66

77
/// Create a new Ethereum-compatible wallet for x402 payments
88
#[derive(Parser, Debug)]
@@ -43,7 +43,7 @@ fn main() -> ExitCode {
4343
}
4444
}
4545

46-
fn run(args: Args) -> x402_common::Result<()> {
46+
fn run(args: Args) -> payment_common::Result<()> {
4747
// Check if config file exists
4848
let config_path = args.config.clone().unwrap_or_else(default_config_path);
4949

@@ -52,7 +52,7 @@ fn run(args: Args) -> x402_common::Result<()> {
5252
"Missing the {} file. Please create one using:\n payment-config use-network base-sepolia",
5353
config_path.display()
5454
);
55-
return Err(x402_common::Error::MissingConfig(
55+
return Err(payment_common::Error::MissingConfig(
5656
config_path.display().to_string(),
5757
));
5858
}
@@ -73,7 +73,7 @@ fn run(args: Args) -> x402_common::Result<()> {
7373
"Error: Wallet already exists at {}\nUse --force to overwrite.",
7474
wallet_path.display()
7575
);
76-
return Err(x402_common::Error::WalletExists(
76+
return Err(payment_common::Error::WalletExists(
7777
wallet_path.display().to_string(),
7878
));
7979
}

get-address/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name = "get-address"
1111
path = "src/main.rs"
1212

1313
[dependencies]
14-
x402_common = { path = "../x402-common" }
14+
payment_common = { path = "../payment-common" }
1515
clap = { version = "4", features = ["derive"] }
1616
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
1717
alloy = { version = "1.0", default-features = false, features = [

get-address/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use alloy::primitives::Address;
22
use alloy::providers::ProviderBuilder;
33
use alloy::sol;
44
use clap::Parser;
5+
use payment_common::{Config, Wallet};
56
use serde::Serialize;
67
use std::path::PathBuf;
78
use std::process::ExitCode;
8-
use x402_common::{Config, Wallet};
99

1010
// ERC-20 balanceOf function
1111
sol! {

pay/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ version.workspace = true
44
edition = "2021"
55
authors.workspace = true
66
license.workspace = true
7-
description = "Make token payments from an x402 wallet"
7+
description = "Make token payments from a payment wallet"
88

99
[[bin]]
1010
name = "pay"
1111
path = "src/main.rs"
1212

1313
[dependencies]
14-
x402_common = { path = "../x402-common" }
14+
payment_common = { path = "../payment-common" }
1515
clap = { version = "4", features = ["derive"] }
1616
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
1717
alloy = { version = "1.0", default-features = false, features = [

pay/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use alloy::providers::{Provider, ProviderBuilder};
44
use alloy::signers::local::PrivateKeySigner;
55
use alloy::sol;
66
use clap::Parser;
7+
use payment_common::Config;
78
use std::fs;
89
use std::path::PathBuf;
910
use std::process::ExitCode;
10-
use x402_common::Config;
1111

1212
// ERC-20 transfer function
1313
sol! {

0 commit comments

Comments
 (0)