remitmd 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -288
- data/lib/remitmd/http.rb +5 -0
- data/lib/remitmd/mock.rb +39 -10
- data/lib/remitmd/models.rb +4 -11
- data/lib/remitmd/wallet.rb +37 -19
- data/lib/remitmd.rb +1 -1
- metadata +12 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb629574b0068a996c2afc9beec3bf0c28a4d3838e674cdf5a9841a66b3de091
|
|
4
|
+
data.tar.gz: 25446d1826566c5606f80845dab3263b5bf5936ce2b4d123b317b6f9162d845c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45bb3ff15f9966ca2b424e9ebe91b7a368328ef5dceb4cd6eb3fb4e3b0991e20622d5dba55b1983b3dd0bd7f2978d4d6922f22b9dabefdace06bbdb4331ce6b4
|
|
7
|
+
data.tar.gz: 44bd1e9d31c038f5a5e5fad6a65be2194d3004a7222391f0ace4472799a05e96e25c3cf25986be160dce7c423579605b04306248636c128d359ec8b404911f50
|
data/README.md
CHANGED
|
@@ -1,290 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# remitmd (Ruby) — DEPRECATED
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **This gem has been deprecated.** Use the [pay CLI](https://pay-skill.com/docs/cli) or [pay SDKs](https://pay-skill.com/docs) instead.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
|
|
10
|
-
## Installation
|
|
11
|
-
|
|
12
|
-
```ruby
|
|
13
|
-
gem "remitmd"
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
or install directly:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
gem install remitmd
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Quickstart
|
|
23
|
-
|
|
24
|
-
```ruby
|
|
25
|
-
require "remitmd"
|
|
26
|
-
|
|
27
|
-
wallet = Remitmd::RemitWallet.new(private_key: ENV["REMITMD_KEY"])
|
|
28
|
-
|
|
29
|
-
# Direct payment
|
|
30
|
-
tx = wallet.pay("0xRecipient0000000000000000000000000000001", 1.50)
|
|
31
|
-
puts tx.tx_hash
|
|
32
|
-
|
|
33
|
-
# Check reputation
|
|
34
|
-
rep = wallet.reputation("0xSomeAgent000000000000000000000000001")
|
|
35
|
-
puts "Score: #{rep.score}"
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Or from environment variables:
|
|
39
|
-
|
|
40
|
-
```ruby
|
|
41
|
-
wallet = Remitmd::RemitWallet.from_env
|
|
42
|
-
# Auto-detects: CliSigner (remit CLI) > REMITMD_KEY
|
|
43
|
-
# Optional: REMITMD_CHAIN (default: "base"), REMITMD_API_URL
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Permits are auto-signed. Every payment method calls the server's `/permits/prepare` endpoint, signs the hash, and includes the permit automatically.
|
|
47
|
-
|
|
48
|
-
## CLI Signer (Recommended)
|
|
49
|
-
|
|
50
|
-
The CLI signer delegates key management to the `remit` CLI binary, which holds your encrypted keystore at `~/.remit/keys/`. No private key in your environment -- just install the CLI and set a password.
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
# Install the CLI
|
|
54
|
-
# macOS: brew install remit-md/tap/remit
|
|
55
|
-
# Windows: winget install remit-md.remit
|
|
56
|
-
# Linux: curl -fsSL https://remit.md/install.sh | sh
|
|
57
|
-
|
|
58
|
-
export REMIT_SIGNER_KEY=your-keystore-password
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
```ruby
|
|
62
|
-
# Explicit
|
|
63
|
-
signer = Remitmd::CliSigner.new
|
|
64
|
-
wallet = Remitmd::RemitWallet.new(signer: signer)
|
|
65
|
-
|
|
66
|
-
# Or auto-detect from env (recommended)
|
|
67
|
-
wallet = Remitmd::RemitWallet.from_env # detects remit CLI automatically
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
`RemitWallet.from_env` detects signing methods automatically. Priority: `CliSigner` (CLI + keystore + password) > `REMITMD_KEY`.
|
|
71
|
-
|
|
72
|
-
## Payment Models
|
|
73
|
-
|
|
74
|
-
### Direct Payment
|
|
75
|
-
|
|
76
|
-
```ruby
|
|
77
|
-
tx = wallet.pay("0xRecipient...", 5.00, memo: "AI inference fee")
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Escrow
|
|
81
|
-
|
|
82
|
-
```ruby
|
|
83
|
-
escrow = wallet.create_escrow("0xContractor...", 100.00, memo: "Code review")
|
|
84
|
-
# Work happens...
|
|
85
|
-
tx = wallet.release_escrow(escrow.id) # pay the contractor
|
|
86
|
-
# or
|
|
87
|
-
tx = wallet.cancel_escrow(escrow.id) # refund yourself
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Metered Tab (off-chain billing)
|
|
91
|
-
|
|
92
|
-
```ruby
|
|
93
|
-
tab = wallet.create_tab("0xProvider...", 50.00, 0.003)
|
|
94
|
-
|
|
95
|
-
# Provider charges with EIP-712 signature
|
|
96
|
-
contracts = wallet.get_contracts
|
|
97
|
-
sig = wallet.sign_tab_charge(contracts.tab, tab.id, 3_000_000, 1)
|
|
98
|
-
wallet.charge_tab(tab.id, 0.003, 0.003, 1, sig)
|
|
99
|
-
|
|
100
|
-
# Close when done - unused funds return
|
|
101
|
-
wallet.close_tab(tab.id)
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Payment Stream
|
|
105
|
-
|
|
106
|
-
```ruby
|
|
107
|
-
stream = wallet.create_stream("0xWorker...", 0.001, 100.00)
|
|
108
|
-
# Worker receives 0.001 USDC/second, funded with 100 USDC deposit
|
|
109
|
-
|
|
110
|
-
tx = wallet.withdraw_stream(stream.id)
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Bounty
|
|
114
|
-
|
|
115
|
-
```ruby
|
|
116
|
-
bounty = wallet.create_bounty(25.00, "Summarise top 10 EIPs of 2025")
|
|
117
|
-
|
|
118
|
-
# Any agent can submit work; you decide the winner
|
|
119
|
-
tx = wallet.award_bounty(bounty.id, "0xWinner...")
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Security Deposit
|
|
123
|
-
|
|
124
|
-
```ruby
|
|
125
|
-
dep = wallet.place_deposit("0xCounterpart...", 100.00, expires_in_secs: 86_400)
|
|
126
|
-
wallet.return_deposit(dep.id)
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### Payment Intent
|
|
130
|
-
|
|
131
|
-
```ruby
|
|
132
|
-
# Propose payment terms before committing
|
|
133
|
-
intent = wallet.propose_intent("0xCounterpart...", 50.00, type: "escrow")
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Testing with MockRemit
|
|
137
|
-
|
|
138
|
-
MockRemit gives you a zero-network, zero-latency test double. No API key needed.
|
|
139
|
-
|
|
140
|
-
```ruby
|
|
141
|
-
require "remitmd"
|
|
142
|
-
|
|
143
|
-
RSpec.describe MyPayingAgent do
|
|
144
|
-
let(:mock) { Remitmd::MockRemit.new }
|
|
145
|
-
let(:wallet) { mock.wallet }
|
|
146
|
-
|
|
147
|
-
after { mock.reset }
|
|
148
|
-
|
|
149
|
-
it "pays the correct amount" do
|
|
150
|
-
agent = MyPayingAgent.new(wallet: wallet)
|
|
151
|
-
agent.run(task: "summarise document")
|
|
152
|
-
|
|
153
|
-
expect(mock.was_paid?("0xProvider...", 0.003)).to be true
|
|
154
|
-
expect(mock.balance).to eq(BigDecimal("9999.997"))
|
|
155
|
-
end
|
|
156
|
-
end
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### MockRemit assertions
|
|
160
|
-
|
|
161
|
-
```ruby
|
|
162
|
-
mock.was_paid?(address, amount) # true/false
|
|
163
|
-
mock.total_paid_to(address) # BigDecimal - sum of all payments to address
|
|
164
|
-
mock.transaction_count # Integer
|
|
165
|
-
mock.balance # BigDecimal - current balance
|
|
166
|
-
mock.transactions # Array<Transaction>
|
|
167
|
-
mock.set_balance(amount) # Override starting balance
|
|
168
|
-
mock.reset # Clear all state
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## All Methods
|
|
172
|
-
|
|
173
|
-
```ruby
|
|
174
|
-
# Contract discovery (cached per session)
|
|
175
|
-
wallet.get_contracts # Hash
|
|
176
|
-
|
|
177
|
-
# Balance & analytics
|
|
178
|
-
wallet.balance # Balance
|
|
179
|
-
wallet.history(limit: 50, offset: 0) # TransactionList
|
|
180
|
-
wallet.reputation(address) # Reputation
|
|
181
|
-
wallet.spending_summary # SpendingSummary
|
|
182
|
-
wallet.remaining_budget # Budget
|
|
183
|
-
|
|
184
|
-
# Direct payment
|
|
185
|
-
wallet.pay(to, amount, memo: nil, permit: nil) # Transaction
|
|
186
|
-
|
|
187
|
-
# Escrow
|
|
188
|
-
wallet.create_escrow(payee, amount, memo: nil, expires_in_secs: nil, permit: nil) # Escrow
|
|
189
|
-
wallet.claim_start(escrow_id) # Escrow
|
|
190
|
-
wallet.release_escrow(escrow_id, memo: nil) # Transaction
|
|
191
|
-
wallet.cancel_escrow(escrow_id) # Transaction
|
|
192
|
-
wallet.get_escrow(escrow_id) # Escrow
|
|
193
|
-
|
|
194
|
-
# Tabs
|
|
195
|
-
wallet.create_tab(provider, limit, per_unit, expires_in_secs: 86_400, permit: nil) # Tab
|
|
196
|
-
wallet.charge_tab(tab_id, amount, cumulative, call_count, provider_sig) # TabCharge
|
|
197
|
-
wallet.close_tab(tab_id, final_amount: nil, provider_sig: nil) # Tab
|
|
198
|
-
|
|
199
|
-
# Tab provider (signing charges)
|
|
200
|
-
wallet.sign_tab_charge(tab_contract, tab_id, total_charged, call_count) # String
|
|
201
|
-
|
|
202
|
-
# EIP-2612 Permit (auto-signed when omitted from payment methods)
|
|
203
|
-
wallet.sign_permit(flow, amount) # PermitSignature
|
|
204
|
-
|
|
205
|
-
# Streams
|
|
206
|
-
wallet.create_stream(payee, rate_per_second, max_total, permit: nil) # Stream
|
|
207
|
-
wallet.close_stream(stream_id) # Stream
|
|
208
|
-
wallet.withdraw_stream(stream_id) # Transaction
|
|
209
|
-
|
|
210
|
-
# Bounties
|
|
211
|
-
wallet.create_bounty(amount, task, deadline, max_attempts: 10, permit: nil) # Bounty
|
|
212
|
-
wallet.submit_bounty(bounty_id, evidence_hash) # BountySubmission
|
|
213
|
-
wallet.award_bounty(bounty_id, submission_id) # Bounty
|
|
214
|
-
|
|
215
|
-
# Deposits
|
|
216
|
-
wallet.place_deposit(provider, amount, expires_in_secs: 3600, permit: nil) # Deposit
|
|
217
|
-
wallet.return_deposit(deposit_id) # Transaction
|
|
218
|
-
|
|
219
|
-
# Webhooks
|
|
220
|
-
wallet.register_webhook(url, events, chains: nil) # Webhook
|
|
221
|
-
|
|
222
|
-
# Operator links (optional: messages: [], agent_name: "")
|
|
223
|
-
wallet.create_fund_link # LinkResponse
|
|
224
|
-
wallet.create_withdraw_link(messages: ["Withdraw"], agent_name: "my-agent") # LinkResponse
|
|
225
|
-
|
|
226
|
-
# Testnet
|
|
227
|
-
wallet.mint(amount) # Hash {tx_hash, balance}
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
## Error Handling
|
|
231
|
-
|
|
232
|
-
All errors are `Remitmd::RemitError` with structured fields and enriched details:
|
|
233
|
-
|
|
234
|
-
```ruby
|
|
235
|
-
begin
|
|
236
|
-
wallet.pay("0xRecipient...", 100.00)
|
|
237
|
-
rescue Remitmd::RemitError => e
|
|
238
|
-
puts e.code # "INSUFFICIENT_BALANCE"
|
|
239
|
-
puts e.message # "Insufficient USDC balance: have $5.00, need $100.00"
|
|
240
|
-
puts e.doc_url # Direct link to error documentation
|
|
241
|
-
puts e.context # Hash: {"required" => "100.00", "available" => "5.00", ...}
|
|
242
|
-
end
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
## Custom Signer
|
|
246
|
-
|
|
247
|
-
Implement `Remitmd::Signer` for HSM, KMS, or multi-sig workflows:
|
|
248
|
-
|
|
249
|
-
```ruby
|
|
250
|
-
class MyHsmSigner
|
|
251
|
-
include Remitmd::Signer
|
|
252
|
-
|
|
253
|
-
def sign(message)
|
|
254
|
-
# Delegate to your HSM
|
|
255
|
-
MyHsm.sign(message)
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
def address
|
|
259
|
-
"0xYourAddress..."
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
wallet = Remitmd::RemitWallet.new(signer: MyHsmSigner.new)
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
## Chains
|
|
267
|
-
|
|
268
|
-
```ruby
|
|
269
|
-
Remitmd::RemitWallet.new(private_key: key, chain: "base") # Base mainnet (default)
|
|
270
|
-
Remitmd::RemitWallet.new(private_key: key, chain: "base_sepolia") # Base Sepolia testnet
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
## Advanced
|
|
274
|
-
|
|
275
|
-
### Manual Permit Signing
|
|
276
|
-
|
|
277
|
-
Permits are auto-signed by default via the server's `/permits/prepare` endpoint. If you need manual control (pre-signed permits, multi-step workflows), pass a `PermitSignature` explicitly:
|
|
278
|
-
|
|
279
|
-
```ruby
|
|
280
|
-
permit = wallet.sign_permit("direct", 5.00)
|
|
281
|
-
tx = wallet.pay("0xRecipient...", 5.00, permit: permit)
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Supported flows: `"direct"`, `"escrow"`, `"tab"`, `"stream"`, `"bounty"`, `"deposit"`.
|
|
285
|
-
|
|
286
|
-
## License
|
|
287
|
-
|
|
288
|
-
MIT - see [LICENSE](LICENSE)
|
|
289
|
-
|
|
290
|
-
[Documentation](https://remit.md/docs) · [Protocol Spec](https://remit.md) · [GitHub](https://github.com/remit-md/sdk)
|
|
5
|
+
- **CLI:** `cargo install pay-cli` — [pay-skill.com/docs/cli](https://pay-skill.com/docs/cli)
|
|
6
|
+
- **Python SDK:** `pip install pay-sdk` — [pay-skill.com/docs/sdk/python](https://pay-skill.com/docs/sdk/python)
|
|
7
|
+
- **TypeScript SDK:** `npm install @pay-skill/sdk` — [pay-skill.com/docs/sdk/typescript](https://pay-skill.com/docs/sdk/typescript)
|
|
8
|
+
- **Source:** [github.com/remit-md/pay-sdk](https://github.com/remit-md/pay-sdk)
|
data/lib/remitmd/http.rb
CHANGED
|
@@ -38,6 +38,10 @@ module Remitmd
|
|
|
38
38
|
request(:post, path, body)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
def patch(path, body = nil)
|
|
42
|
+
request(:patch, path, body)
|
|
43
|
+
end
|
|
44
|
+
|
|
41
45
|
def delete(path)
|
|
42
46
|
request(:delete, path, nil)
|
|
43
47
|
end
|
|
@@ -71,6 +75,7 @@ module Remitmd
|
|
|
71
75
|
req = case method
|
|
72
76
|
when :get then Net::HTTP::Get.new(full_path)
|
|
73
77
|
when :post then Net::HTTP::Post.new(full_path)
|
|
78
|
+
when :patch then Net::HTTP::Patch.new(full_path)
|
|
74
79
|
when :delete then Net::HTTP::Delete.new(full_path)
|
|
75
80
|
end
|
|
76
81
|
|
data/lib/remitmd/mock.rb
CHANGED
|
@@ -130,6 +130,10 @@ module Remitmd
|
|
|
130
130
|
dispatch("POST", path, body)
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
def patch(path, body = nil)
|
|
134
|
+
dispatch("PATCH", path, body)
|
|
135
|
+
end
|
|
136
|
+
|
|
133
137
|
def delete(path)
|
|
134
138
|
dispatch("DELETE", path, nil)
|
|
135
139
|
end
|
|
@@ -414,20 +418,45 @@ module Remitmd
|
|
|
414
418
|
"has_more" => false,
|
|
415
419
|
}
|
|
416
420
|
|
|
417
|
-
#
|
|
418
|
-
in ["POST", "/
|
|
419
|
-
to = fetch!(b, :to)
|
|
420
|
-
amount = decimal!(b, :amount)
|
|
421
|
+
# Deposit forfeit
|
|
422
|
+
in ["POST", path] if path.end_with?("/forfeit") && path.include?("/deposits/")
|
|
421
423
|
{
|
|
422
|
-
"id" => new_id("
|
|
423
|
-
"
|
|
424
|
-
"
|
|
425
|
-
"amount" => amount.to_s("F"),
|
|
426
|
-
"type" => b[:type] || "direct",
|
|
427
|
-
"expires_at" => now,
|
|
424
|
+
"id" => new_id("tx"),
|
|
425
|
+
"tx_hash" => "0x#{SecureRandom.hex(32)}",
|
|
426
|
+
"chain_id" => ChainId::BASE_SEPOLIA,
|
|
428
427
|
"created_at" => now,
|
|
429
428
|
}
|
|
430
429
|
|
|
430
|
+
# Bounty reclaim
|
|
431
|
+
in ["POST", path] if path.end_with?("/reclaim") && path.include?("/bounties/")
|
|
432
|
+
{
|
|
433
|
+
"id" => new_id("tx"),
|
|
434
|
+
"tx_hash" => "0x#{SecureRandom.hex(32)}",
|
|
435
|
+
"chain_id" => ChainId::BASE_SEPOLIA,
|
|
436
|
+
"created_at" => now,
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
# Webhook update
|
|
440
|
+
in ["PATCH", path] if path.start_with?("/webhooks/")
|
|
441
|
+
webhook_id = path.split("/").last
|
|
442
|
+
{
|
|
443
|
+
"id" => webhook_id,
|
|
444
|
+
"wallet" => MockRemit::MOCK_ADDRESS,
|
|
445
|
+
"url" => b[:url] || "https://example.com/hook",
|
|
446
|
+
"events" => b[:events] || [],
|
|
447
|
+
"chains" => ["base-sepolia"],
|
|
448
|
+
"active" => b.key?(:active) ? b[:active] : true,
|
|
449
|
+
"created_at" => now,
|
|
450
|
+
"updated_at" => now,
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
# Wallet settings update
|
|
454
|
+
in ["PATCH", "/wallet/settings"]
|
|
455
|
+
{
|
|
456
|
+
"wallet" => MockRemit::MOCK_ADDRESS,
|
|
457
|
+
"display_name" => b[:display_name],
|
|
458
|
+
}
|
|
459
|
+
|
|
431
460
|
else
|
|
432
461
|
{}
|
|
433
462
|
end
|
data/lib/remitmd/models.rb
CHANGED
|
@@ -349,21 +349,14 @@ module Remitmd
|
|
|
349
349
|
private :decimal, :parse_time
|
|
350
350
|
end
|
|
351
351
|
|
|
352
|
-
class
|
|
352
|
+
class WalletSettings < Model
|
|
353
353
|
def initialize(attrs)
|
|
354
354
|
h = attrs.transform_keys(&:to_s)
|
|
355
|
-
@
|
|
356
|
-
@
|
|
357
|
-
@to = h["to"]
|
|
358
|
-
@amount = decimal(h["amount"])
|
|
359
|
-
@type = h["type"]
|
|
360
|
-
@expires_at = parse_time(h["expires_at"])
|
|
361
|
-
@created_at = parse_time(h["created_at"])
|
|
355
|
+
@wallet = h["wallet"]
|
|
356
|
+
@display_name = h["display_name"]
|
|
362
357
|
end
|
|
363
358
|
|
|
364
|
-
attr_reader :
|
|
365
|
-
|
|
366
|
-
private :decimal, :parse_time
|
|
359
|
+
attr_reader :wallet, :display_name
|
|
367
360
|
end
|
|
368
361
|
|
|
369
362
|
class Budget < Model
|
data/lib/remitmd/wallet.rb
CHANGED
|
@@ -459,6 +459,13 @@ module Remitmd
|
|
|
459
459
|
Bounty.new(@transport.post("/bounties/#{bounty_id}/award", { submission_id: submission_id }))
|
|
460
460
|
end
|
|
461
461
|
|
|
462
|
+
# Reclaim an expired or cancelled bounty (called by the poster).
|
|
463
|
+
# @param bounty_id [String]
|
|
464
|
+
# @return [Transaction]
|
|
465
|
+
def reclaim_bounty(bounty_id)
|
|
466
|
+
Transaction.new(@transport.post("/bounties/#{bounty_id}/reclaim", {}))
|
|
467
|
+
end
|
|
468
|
+
|
|
462
469
|
# List bounties with optional filters.
|
|
463
470
|
# @param status [String, nil] filter by status (open, claimed, awarded, expired)
|
|
464
471
|
# @param poster [String, nil] filter by poster wallet address
|
|
@@ -504,26 +511,19 @@ module Remitmd
|
|
|
504
511
|
Transaction.new(@transport.post("/deposits/#{deposit_id}/return", {}))
|
|
505
512
|
end
|
|
506
513
|
|
|
514
|
+
# Forfeit a deposit (called by the depositor to surrender their deposit).
|
|
515
|
+
# @param deposit_id [String]
|
|
516
|
+
# @return [Transaction]
|
|
517
|
+
def forfeit_deposit(deposit_id)
|
|
518
|
+
Transaction.new(@transport.post("/deposits/#{deposit_id}/forfeit", {}))
|
|
519
|
+
end
|
|
520
|
+
|
|
507
521
|
# Lock a security deposit.
|
|
508
522
|
# @deprecated Use {#place_deposit} instead
|
|
509
523
|
def lock_deposit(provider, amount, expires_in_secs, permit: nil)
|
|
510
524
|
place_deposit(provider, amount, expires_in_secs: expires_in_secs, permit: permit)
|
|
511
525
|
end
|
|
512
526
|
|
|
513
|
-
# ─── Payment Intents ─────────────────────────────────────────────────────
|
|
514
|
-
|
|
515
|
-
# Propose a payment intent for counterpart approval before execution.
|
|
516
|
-
# @param to [String] 0x-prefixed address
|
|
517
|
-
# @param amount [Numeric] amount in USDC
|
|
518
|
-
# @param type [String] payment type - "direct", "escrow", "tab"
|
|
519
|
-
# @return [Intent]
|
|
520
|
-
def propose_intent(to, amount, type: "direct")
|
|
521
|
-
validate_address!(to)
|
|
522
|
-
validate_amount!(amount)
|
|
523
|
-
body = { to: to, amount: amount.to_s, type: type }
|
|
524
|
-
Intent.new(@transport.post("/intents", body))
|
|
525
|
-
end
|
|
526
|
-
|
|
527
527
|
# ─── Webhooks ─────────────────────────────────────────────────────────────
|
|
528
528
|
|
|
529
529
|
# Register a webhook endpoint to receive event notifications.
|
|
@@ -548,6 +548,29 @@ module Remitmd
|
|
|
548
548
|
nil
|
|
549
549
|
end
|
|
550
550
|
|
|
551
|
+
# Update an existing webhook's URL, events, or active status.
|
|
552
|
+
# @param webhook_id [String]
|
|
553
|
+
# @param url [String, nil] new URL
|
|
554
|
+
# @param events [Array<String>, nil] new event types
|
|
555
|
+
# @param active [Boolean, nil] new active status
|
|
556
|
+
# @return [Webhook]
|
|
557
|
+
def update_webhook(webhook_id, url: nil, events: nil, active: nil)
|
|
558
|
+
body = {}
|
|
559
|
+
body[:url] = url unless url.nil?
|
|
560
|
+
body[:events] = events unless events.nil?
|
|
561
|
+
body[:active] = active unless active.nil?
|
|
562
|
+
Webhook.new(@transport.patch("/webhooks/#{webhook_id}", body))
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
# Update wallet display settings.
|
|
566
|
+
# @param display_name [String, nil] new display name
|
|
567
|
+
# @return [WalletSettings]
|
|
568
|
+
def update_wallet_settings(display_name: nil)
|
|
569
|
+
body = {}
|
|
570
|
+
body[:display_name] = display_name unless display_name.nil?
|
|
571
|
+
WalletSettings.new(@transport.patch("/wallet/settings", body))
|
|
572
|
+
end
|
|
573
|
+
|
|
551
574
|
# ─── Canonical name aliases ──────────────────────────────────────────────
|
|
552
575
|
|
|
553
576
|
# Canonical name for create_tab.
|
|
@@ -565,11 +588,6 @@ module Remitmd
|
|
|
565
588
|
create_bounty(amount, task_description, deadline, max_attempts: max_attempts, permit: permit)
|
|
566
589
|
end
|
|
567
590
|
|
|
568
|
-
# Alias for propose_intent.
|
|
569
|
-
def express_intent(to, amount, type: "direct")
|
|
570
|
-
propose_intent(to, amount, type: type)
|
|
571
|
-
end
|
|
572
|
-
|
|
573
591
|
# ─── One-time operator links ───────────────────────────────────────────────
|
|
574
592
|
|
|
575
593
|
# Generate a one-time URL for the operator to fund this wallet.
|
data/lib/remitmd.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: remitmd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- remit.md
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|
|
@@ -38,9 +38,9 @@ dependencies:
|
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '1.60'
|
|
41
|
-
description:
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
description: 'DEPRECATED: This gem is no longer maintained. Use pay-cli (cargo install
|
|
42
|
+
pay-cli) or pay SDKs (pip install pay-sdk / npm install @pay-skill/sdk). See https://pay-skill.com/docs
|
|
43
|
+
for migration.'
|
|
44
44
|
email:
|
|
45
45
|
- hello@remit.md
|
|
46
46
|
executables: []
|
|
@@ -61,14 +61,15 @@ files:
|
|
|
61
61
|
- lib/remitmd/wallet.rb
|
|
62
62
|
- lib/remitmd/x402_client.rb
|
|
63
63
|
- lib/remitmd/x402_paywall.rb
|
|
64
|
-
homepage: https://
|
|
64
|
+
homepage: https://pay-skill.com
|
|
65
65
|
licenses:
|
|
66
66
|
- MIT
|
|
67
67
|
metadata:
|
|
68
|
-
homepage_uri: https://
|
|
69
|
-
source_code_uri: https://github.com/remit-md/sdk
|
|
70
|
-
changelog_uri: https://github.com/remit-md/sdk/releases
|
|
71
|
-
post_install_message:
|
|
68
|
+
homepage_uri: https://pay-skill.com
|
|
69
|
+
source_code_uri: https://github.com/remit-md/pay-sdk
|
|
70
|
+
changelog_uri: https://github.com/remit-md/pay-sdk/releases
|
|
71
|
+
post_install_message: 'WARNING: remitmd is deprecated. Use pay-cli or pay SDKs instead.
|
|
72
|
+
See https://pay-skill.com/docs'
|
|
72
73
|
rdoc_options: []
|
|
73
74
|
require_paths:
|
|
74
75
|
- lib
|
|
@@ -86,5 +87,5 @@ requirements: []
|
|
|
86
87
|
rubygems_version: 3.4.19
|
|
87
88
|
signing_key:
|
|
88
89
|
specification_version: 4
|
|
89
|
-
summary:
|
|
90
|
+
summary: 'DEPRECATED: Use pay-cli or pay SDKs instead. See https://pay-skill.com/docs'
|
|
90
91
|
test_files: []
|