remitmd 0.2.5 → 0.3.0
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/lib/remitmd/http.rb +7 -2
- data/lib/remitmd/mock.rb +4 -0
- data/lib/remitmd/wallet.rb +33 -0
- data/lib/remitmd.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a4fe50ca322390d98424e60dd8ecd9fb1fbd27ffd8264e5d4167e1d2d249212
|
|
4
|
+
data.tar.gz: 68079923cac8357d6560432bb31a26217296d1de44f2134e8934cd233822a03d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50e790537a39130346e2436e1c90b90cc1ca7e7aafe8bf4ba46cde03da31040f4126ba17c5d8e995edd2da2ba4be6d540771a13cb9aeb0f5093554d266bb3794
|
|
7
|
+
data.tar.gz: 8e62c3cfe6c96ea2ccd2dc0cabbefe03bd96602807c916667b87db668c14ccb442fdaabb61c4589177dad5cda3a25f98789a168015b8ca34d47c88f54a35a7f9
|
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 delete(path)
|
|
42
|
+
request(:delete, path, nil)
|
|
43
|
+
end
|
|
44
|
+
|
|
41
45
|
private
|
|
42
46
|
|
|
43
47
|
def request(method, path, body)
|
|
@@ -65,8 +69,9 @@ module Remitmd
|
|
|
65
69
|
def build_request(method, path, body, idempotency_key = nil)
|
|
66
70
|
full_path = "#{@uri.path}#{path}"
|
|
67
71
|
req = case method
|
|
68
|
-
when :get
|
|
69
|
-
when :post
|
|
72
|
+
when :get then Net::HTTP::Get.new(full_path)
|
|
73
|
+
when :post then Net::HTTP::Post.new(full_path)
|
|
74
|
+
when :delete then Net::HTTP::Delete.new(full_path)
|
|
70
75
|
end
|
|
71
76
|
|
|
72
77
|
# Generate 32-byte random nonce and Unix timestamp.
|
data/lib/remitmd/mock.rb
CHANGED
data/lib/remitmd/wallet.rb
CHANGED
|
@@ -537,6 +537,39 @@ module Remitmd
|
|
|
537
537
|
Webhook.new(@transport.post("/webhooks", body))
|
|
538
538
|
end
|
|
539
539
|
|
|
540
|
+
# List all registered webhooks for this wallet.
|
|
541
|
+
def list_webhooks
|
|
542
|
+
@transport.get("/webhooks").map { |w| Webhook.new(w) }
|
|
543
|
+
end
|
|
544
|
+
|
|
545
|
+
# Delete a webhook by ID.
|
|
546
|
+
def delete_webhook(webhook_id)
|
|
547
|
+
@transport.delete("/webhooks/#{webhook_id}")
|
|
548
|
+
nil
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
# ─── Canonical name aliases ──────────────────────────────────────────────
|
|
552
|
+
|
|
553
|
+
# Canonical name for create_tab.
|
|
554
|
+
def open_tab(provider, limit_amount, per_unit = 0.0, expires_in_secs: 86_400, permit: nil)
|
|
555
|
+
create_tab(provider, limit_amount, per_unit, expires_in_secs: expires_in_secs, permit: permit)
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
# Canonical name for create_stream.
|
|
559
|
+
def open_stream(payee, rate_per_second, max_total, permit: nil)
|
|
560
|
+
create_stream(payee, rate_per_second, max_total, permit: permit)
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
# Canonical name for create_bounty.
|
|
564
|
+
def post_bounty(amount, task_description, deadline, max_attempts: 10, permit: nil)
|
|
565
|
+
create_bounty(amount, task_description, deadline, max_attempts: max_attempts, permit: permit)
|
|
566
|
+
end
|
|
567
|
+
|
|
568
|
+
# Alias for propose_intent.
|
|
569
|
+
def express_intent(to, amount, type: "direct")
|
|
570
|
+
propose_intent(to, amount, type: type)
|
|
571
|
+
end
|
|
572
|
+
|
|
540
573
|
# ─── One-time operator links ───────────────────────────────────────────────
|
|
541
574
|
|
|
542
575
|
# Generate a one-time URL for the operator to fund this wallet.
|
data/lib/remitmd.rb
CHANGED