Skip to content

Commit 741004b

Browse files
committed
final cleanup, add qn endpoints
1 parent 8d08574 commit 741004b

4 files changed

Lines changed: 10 additions & 14 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Ruby gem for generating signed payment HTTP headers and links using the [x402 protocol](https://www.x402.org/).
88

9-
Supports USDC and other token payments on Base, Avalanche, Solana, and other EVM networks.
9+
Supports USDC and other token payments on Base, Avalanche, Solana, and other EVM networks with EIP-712 signing.
1010

1111
## Installation
1212

@@ -121,7 +121,7 @@ X402::Payments.configure do |config|
121121
)
122122

123123
# Set the RPC URL for the custom chain
124-
config.rpc_urls["polygon-amoy"] = "https://rpc-amoy.polygon.technology"
124+
config.rpc_urls["polygon-amoy"] = "https://bitter-attentive-pool.matic-amoy.quiknode.pro"
125125

126126
config.chain = "polygon-amoy"
127127
config.currency = "USDC"
@@ -131,7 +131,7 @@ end
131131
You can also set RPC URLs via environment variables using the pattern `X402_<CHAIN>_RPC_URL`:
132132

133133
```bash
134-
export X402_POLYGON_AMOY_RPC_URL="https://rpc-amoy.polygon.technology"
134+
export X402_POLYGON_AMOY_RPC_URL="https://bitter-attentive-pool.matic-amoy.quiknode.pro"
135135
```
136136

137137
#### Register a Custom Token on a Built-in Chain

examples/.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ X402_SOLANA_FEE_PAYER=CKPKJWNdJEqa81x7CkZ14BVPiY6y16Sxs7owznqtWYp5
4747
# X402_SOLANA_DEVNET_RPC_URL=https://your-solana-devnet-rpc.com
4848

4949
# Custom chains (example)
50-
# X402_POLYGON_AMOY_RPC_URL=https://rpc-amoy.polygon.technology
51-
# X402_POLYGON_RPC_URL=https://polygon-rpc.com
50+
# X402_POLYGON_AMOY_RPC_URL=https://your-rpc-amoy-rpc.com
51+
# X402_POLYGON_RPC_URL=https://your-polygon-rpc.com

examples/generate_payment.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,9 @@
5555
"polygon-amoy" => {
5656
chain_id: 80002,
5757
usdc_address: "0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582",
58-
usdc_name: "USDC",
59-
usdc_version: "2"
60-
},
61-
"polygon" => {
62-
chain_id: 137,
63-
usdc_address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
64-
usdc_name: "USD Coin",
65-
usdc_version: "2"
58+
usdc_name: "USDC", # Token name for EIP-712 domain (must match contract's name())
59+
usdc_version: "2",
60+
rpc_url: "https://bitter-attentive-pool.matic-amoy.quiknode.pro"
6661
}
6762
}.freeze
6863

@@ -88,6 +83,7 @@
8883
name: custom[:usdc_name],
8984
version: custom[:usdc_version]
9085
)
86+
config.rpc_urls[CHAIN] = custom[:rpc_url] # Register the RPC URL for the custom chain
9187
end
9288

9389
config.chain = CHAIN

lib/x402/payments/chains.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module Payments
3737
},
3838
"solana" => {
3939
chain_id: 101,
40-
rpc_url: "https://alien-burned-energy.solana-mainnet.quiknode.pro/",
40+
rpc_url: "https://alien-burned-energy.solana-mainnet.quiknode.pro",
4141
usdc_address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
4242
explorer_url: "https://explorer.solana.com",
4343
fee_payer: "CKPKJWNdJEqa81x7CkZ14BVPiY6y16Sxs7owznqtWYp5"

0 commit comments

Comments
 (0)