bsv-wallet 0.1.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 +7 -0
- data/LICENSE +86 -0
- data/lib/bsv/wallet_interface/errors/invalid_hmac_error.rb +11 -0
- data/lib/bsv/wallet_interface/errors/invalid_parameter_error.rb +14 -0
- data/lib/bsv/wallet_interface/errors/invalid_signature_error.rb +11 -0
- data/lib/bsv/wallet_interface/errors/unsupported_action_error.rb +11 -0
- data/lib/bsv/wallet_interface/errors/wallet_error.rb +14 -0
- data/lib/bsv/wallet_interface/interface.rb +384 -0
- data/lib/bsv/wallet_interface/key_deriver.rb +142 -0
- data/lib/bsv/wallet_interface/memory_store.rb +115 -0
- data/lib/bsv/wallet_interface/proto_wallet.rb +361 -0
- data/lib/bsv/wallet_interface/storage_adapter.rb +51 -0
- data/lib/bsv/wallet_interface/validators.rb +126 -0
- data/lib/bsv/wallet_interface/version.rb +7 -0
- data/lib/bsv/wallet_interface/wallet_client.rb +486 -0
- data/lib/bsv/wallet_interface.rb +25 -0
- data/lib/bsv-wallet.rb +4 -0
- metadata +87 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c3b78f18799abee8200aa740beca3a466c03c025bd52c00bb1f3c47af70efd15
|
|
4
|
+
data.tar.gz: d99f2facb2c349a330fce269f2e17496aa08928b069d49ee23cc1eae0acdecb7
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 762008f49eac271256c65eb328bc261a057a102828fed01927a488548e1299b62e172d4acbf886f8736fbe7460e829feef461efa16090aedb0a0268b390395f1
|
|
7
|
+
data.tar.gz: 05f4446e9967cb0d3e3c0c7760516a63e46f9edae408148ed20c125086865acf927739bca6d586511099b777ed4c22ac7c38176c5f3c7683501a9f9ec4b2eae8
|
data/LICENSE
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Open BSV License Version 5 – granted by BSV Association, Grafenauweg 6, 6300
|
|
2
|
+
Zug, Switzerland (CHE-427.008.338) ("Licensor"), to you as a user (henceforth
|
|
3
|
+
"You", "User" or "Licensee").
|
|
4
|
+
|
|
5
|
+
For the purposes of this license, the definitions below have the following
|
|
6
|
+
meanings:
|
|
7
|
+
|
|
8
|
+
"Bitcoin Protocol" means the protocol implementation, cryptographic rules,
|
|
9
|
+
network protocols, and consensus mechanisms in the Bitcoin White Paper as
|
|
10
|
+
described here https://protocol.bsvblockchain.org.
|
|
11
|
+
|
|
12
|
+
"Bitcoin White Paper" means the paper entitled 'Bitcoin: A Peer-to-Peer
|
|
13
|
+
Electronic Cash System' published by 'Satoshi Nakamoto' in October 2008.
|
|
14
|
+
|
|
15
|
+
"BSV Blockchains" means:
|
|
16
|
+
(a) the Bitcoin blockchain containing block height #556767 with the hash
|
|
17
|
+
"000000000000000001d956714215d96ffc00e0afda4cd0a96c96f8d802b1662b" and
|
|
18
|
+
that contains the longest honest persistent chain of blocks which has been
|
|
19
|
+
produced in a manner which is consistent with the rules set forth in the
|
|
20
|
+
Network Access Rules; and
|
|
21
|
+
(b) the test blockchains that contain the longest honest persistent chains of
|
|
22
|
+
blocks which has been produced in a manner which is consistent with the
|
|
23
|
+
rules set forth in the Network Access Rules.
|
|
24
|
+
|
|
25
|
+
"Network Access Rules" or "Rules" means the set of rules regulating the
|
|
26
|
+
relationship between BSV Association and the nodes on BSV based on the Bitcoin
|
|
27
|
+
Protocol rules and those set out in the Bitcoin White Paper, and available here
|
|
28
|
+
https://bsvblockchain.org/network-access-rules.
|
|
29
|
+
|
|
30
|
+
"Software" means the software the subject of this licence, including any/all
|
|
31
|
+
intellectual property rights therein and associated documentation files.
|
|
32
|
+
|
|
33
|
+
BSV Association grants permission, free of charge and on a non-exclusive and
|
|
34
|
+
revocable basis, to any person obtaining a copy of the Software to deal in the
|
|
35
|
+
Software without restriction, including without limitation the rights to use,
|
|
36
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
37
|
+
Software, and to permit persons to whom the Software is furnished to do so,
|
|
38
|
+
subject to and conditioned upon the following conditions:
|
|
39
|
+
|
|
40
|
+
1 - The text "© BSV Association," and this license shall be included in all
|
|
41
|
+
copies or substantial portions of the Software.
|
|
42
|
+
2 - The Software, and any software that is derived from the Software or parts
|
|
43
|
+
thereof, must only be used on the BSV Blockchains.
|
|
44
|
+
|
|
45
|
+
For the avoidance of doubt, this license is granted subject to and conditioned
|
|
46
|
+
upon your compliance with these terms only. In the event of non-compliance, the
|
|
47
|
+
license shall extinguish and you can be enjoined from violating BSV's
|
|
48
|
+
intellectual property rights (incl. damages and similar related claims).
|
|
49
|
+
|
|
50
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
51
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES REGARDING ENTITLEMENT,
|
|
52
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
53
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS THEREOF BE LIABLE FOR ANY CLAIM,
|
|
54
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
55
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
56
|
+
DEALINGS IN THE SOFTWARE.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
Version 0.1.1 of the Bitcoin SV software, and prior versions of software upon
|
|
60
|
+
which it was based, were licensed under the MIT License, which is included below.
|
|
61
|
+
|
|
62
|
+
The MIT License (MIT)
|
|
63
|
+
|
|
64
|
+
Copyright (c) 2009-2010 Satoshi Nakamoto
|
|
65
|
+
Copyright (c) 2009-2015 Bitcoin Developers
|
|
66
|
+
Copyright (c) 2009-2017 The Bitcoin Core developers
|
|
67
|
+
Copyright (c) 2017 The Bitcoin ABC developers
|
|
68
|
+
Copyright (c) 2018 Bitcoin Association for BSV
|
|
69
|
+
Copyright (c) 2023 BSV Association
|
|
70
|
+
|
|
71
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
72
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
73
|
+
the Software without restriction, including without limitation the rights to
|
|
74
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
75
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
76
|
+
subject to the following conditions:
|
|
77
|
+
|
|
78
|
+
The above copyright notice and this permission notice shall be included in all
|
|
79
|
+
copies or substantial portions of the Software.
|
|
80
|
+
|
|
81
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
82
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
83
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
84
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
85
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
86
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BSV
|
|
4
|
+
module Wallet
|
|
5
|
+
class InvalidParameterError < WalletError
|
|
6
|
+
attr_reader :parameter
|
|
7
|
+
|
|
8
|
+
def initialize(parameter, must_be = 'valid')
|
|
9
|
+
@parameter = parameter
|
|
10
|
+
super("The #{parameter} parameter must be #{must_be}", 6)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BSV
|
|
4
|
+
module Wallet
|
|
5
|
+
# BRC-100 Wallet Interface
|
|
6
|
+
#
|
|
7
|
+
# Defines the 28 methods of the standard BSV wallet-to-application interface.
|
|
8
|
+
# Include this module and override the methods your implementation supports.
|
|
9
|
+
# Unimplemented methods raise {UnsupportedActionError}.
|
|
10
|
+
module Interface
|
|
11
|
+
# rubocop:disable Lint/UnusedMethodArgument
|
|
12
|
+
|
|
13
|
+
# --- Transaction Operations ---
|
|
14
|
+
|
|
15
|
+
# Creates a new Bitcoin transaction with metadata and labels.
|
|
16
|
+
#
|
|
17
|
+
# @param args [Hash] transaction parameters
|
|
18
|
+
# @option args [String] :description (required) 5-50 char description
|
|
19
|
+
# @option args [Array<Integer>] :input_beef BEEF data for inputs
|
|
20
|
+
# @option args [Array<Hash>] :inputs input objects with :outpoint, :unlocking_script, :input_description
|
|
21
|
+
# @option args [Array<Hash>] :outputs output objects with :locking_script, :satoshis, :output_description
|
|
22
|
+
# @option args [Integer] :lock_time optional lock time
|
|
23
|
+
# @option args [Integer] :version optional transaction version
|
|
24
|
+
# @option args [Array<String>] :labels optional transaction labels
|
|
25
|
+
# @option args [Hash] :options optional processing options
|
|
26
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
27
|
+
# @return [Hash] with :txid, :tx, :no_send_change, :send_with_results, :signable_transaction
|
|
28
|
+
def create_action(args, originator: nil)
|
|
29
|
+
raise UnsupportedActionError, 'create_action'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Signs a previously created transaction.
|
|
33
|
+
#
|
|
34
|
+
# @param args [Hash] signing parameters
|
|
35
|
+
# @option args [Hash] :spends map of input indexes to unlocking scripts
|
|
36
|
+
# @option args [String] :reference base64 reference from create_action
|
|
37
|
+
# @option args [Hash] :options optional processing options
|
|
38
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
39
|
+
# @return [Hash] with :txid, :tx, :send_with_results
|
|
40
|
+
def sign_action(args, originator: nil)
|
|
41
|
+
raise UnsupportedActionError, 'sign_action'
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Aborts an incomplete transaction.
|
|
45
|
+
#
|
|
46
|
+
# @param args [Hash]
|
|
47
|
+
# @option args [String] :reference base64 reference to abort
|
|
48
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
49
|
+
# @return [Hash] { aborted: true }
|
|
50
|
+
def abort_action(args, originator: nil)
|
|
51
|
+
raise UnsupportedActionError, 'abort_action'
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Lists transactions matching the specified labels.
|
|
55
|
+
#
|
|
56
|
+
# @param args [Hash] query parameters
|
|
57
|
+
# @option args [Array<String>] :labels (required) labels to filter by
|
|
58
|
+
# @option args [String] :label_query_mode 'any' or 'all'
|
|
59
|
+
# @option args [Boolean] :include_labels include labels in results
|
|
60
|
+
# @option args [Boolean] :include_inputs include input details
|
|
61
|
+
# @option args [Boolean] :include_outputs include output details
|
|
62
|
+
# @option args [Integer] :limit max results (default 10, max 10000)
|
|
63
|
+
# @option args [Integer] :offset number to skip
|
|
64
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
65
|
+
# @return [Hash] with :total_actions, :actions
|
|
66
|
+
def list_actions(args, originator: nil)
|
|
67
|
+
raise UnsupportedActionError, 'list_actions'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Accepts an incoming transaction for internalization.
|
|
71
|
+
#
|
|
72
|
+
# @param args [Hash]
|
|
73
|
+
# @option args [Array<Integer>] :tx Atomic BEEF-formatted transaction
|
|
74
|
+
# @option args [Array<Hash>] :outputs metadata about outputs
|
|
75
|
+
# @option args [String] :description 5-50 char description
|
|
76
|
+
# @option args [Array<String>] :labels optional labels
|
|
77
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
78
|
+
# @return [Hash] { accepted: true }
|
|
79
|
+
def internalize_action(args, originator: nil)
|
|
80
|
+
raise UnsupportedActionError, 'internalize_action'
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Lists spendable outputs in a basket.
|
|
84
|
+
#
|
|
85
|
+
# @param args [Hash]
|
|
86
|
+
# @option args [String] :basket (required) basket name
|
|
87
|
+
# @option args [Array<String>] :tags optional tag filter
|
|
88
|
+
# @option args [String] :tag_query_mode 'any' or 'all'
|
|
89
|
+
# @option args [String] :include 'locking scripts' or 'entire transactions'
|
|
90
|
+
# @option args [Integer] :limit max results
|
|
91
|
+
# @option args [Integer] :offset number to skip
|
|
92
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
93
|
+
# @return [Hash] with :total_outputs, :outputs
|
|
94
|
+
def list_outputs(args, originator: nil)
|
|
95
|
+
raise UnsupportedActionError, 'list_outputs'
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Releases an output from basket tracking.
|
|
99
|
+
#
|
|
100
|
+
# @param args [Hash]
|
|
101
|
+
# @option args [String] :basket basket name
|
|
102
|
+
# @option args [String] :output outpoint string
|
|
103
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
104
|
+
# @return [Hash] { relinquished: true }
|
|
105
|
+
def relinquish_output(args, originator: nil)
|
|
106
|
+
raise UnsupportedActionError, 'relinquish_output'
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# --- Public Key Management ---
|
|
110
|
+
|
|
111
|
+
# Retrieves a derived or identity public key.
|
|
112
|
+
#
|
|
113
|
+
# @param args [Hash]
|
|
114
|
+
# @option args [Boolean] :identity_key if true, return the identity key
|
|
115
|
+
# @option args [Array] :protocol_id [security_level, protocol_name]
|
|
116
|
+
# @option args [String] :key_id key identifier
|
|
117
|
+
# @option args [String] :counterparty public key hex, 'self', or 'anyone'
|
|
118
|
+
# @option args [Boolean] :for_self derive from own identity
|
|
119
|
+
# @option args [Boolean] :privileged privileged mode
|
|
120
|
+
# @option args [String] :privileged_reason reason for privileged access
|
|
121
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
122
|
+
# @return [Hash] { public_key: String }
|
|
123
|
+
def get_public_key(args, originator: nil)
|
|
124
|
+
raise UnsupportedActionError, 'get_public_key'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Reveals key linkage between self and a counterparty to a verifier.
|
|
128
|
+
#
|
|
129
|
+
# @param args [Hash]
|
|
130
|
+
# @option args [String] :counterparty counterparty public key hex
|
|
131
|
+
# @option args [String] :verifier verifier public key hex
|
|
132
|
+
# @option args [Boolean] :privileged privileged mode
|
|
133
|
+
# @option args [String] :privileged_reason reason for privileged access
|
|
134
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
135
|
+
# @return [Hash] with :prover, :verifier, :counterparty, :revelation_time, :encrypted_linkage, :encrypted_linkage_proof
|
|
136
|
+
def reveal_counterparty_key_linkage(args, originator: nil)
|
|
137
|
+
raise UnsupportedActionError, 'reveal_counterparty_key_linkage'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Reveals specific key linkage for a particular interaction.
|
|
141
|
+
#
|
|
142
|
+
# @param args [Hash]
|
|
143
|
+
# @option args [String] :counterparty counterparty public key hex
|
|
144
|
+
# @option args [String] :verifier verifier public key hex
|
|
145
|
+
# @option args [Array] :protocol_id [security_level, protocol_name]
|
|
146
|
+
# @option args [String] :key_id key identifier
|
|
147
|
+
# @option args [Boolean] :privileged privileged mode
|
|
148
|
+
# @option args [String] :privileged_reason reason for privileged access
|
|
149
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
150
|
+
# @return [Hash] with :prover, :verifier, :counterparty, :protocol_id, :key_id, :encrypted_linkage, :encrypted_linkage_proof, :proof_type
|
|
151
|
+
def reveal_specific_key_linkage(args, originator: nil)
|
|
152
|
+
raise UnsupportedActionError, 'reveal_specific_key_linkage'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# --- Cryptography Operations ---
|
|
156
|
+
|
|
157
|
+
# Encrypts data using a derived symmetric key.
|
|
158
|
+
#
|
|
159
|
+
# @param args [Hash]
|
|
160
|
+
# @option args [Array<Integer>] :plaintext byte array to encrypt
|
|
161
|
+
# @option args [Array] :protocol_id [security_level, protocol_name]
|
|
162
|
+
# @option args [String] :key_id key identifier
|
|
163
|
+
# @option args [String] :counterparty public key hex, 'self', or 'anyone'
|
|
164
|
+
# @option args [Boolean] :privileged privileged mode
|
|
165
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
166
|
+
# @return [Hash] { ciphertext: Array<Integer> }
|
|
167
|
+
def encrypt(args, originator: nil)
|
|
168
|
+
raise UnsupportedActionError, 'encrypt'
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Decrypts data using a derived symmetric key.
|
|
172
|
+
#
|
|
173
|
+
# @param args [Hash]
|
|
174
|
+
# @option args [Array<Integer>] :ciphertext byte array to decrypt
|
|
175
|
+
# @option args [Array] :protocol_id [security_level, protocol_name]
|
|
176
|
+
# @option args [String] :key_id key identifier
|
|
177
|
+
# @option args [String] :counterparty public key hex, 'self', or 'anyone'
|
|
178
|
+
# @option args [Boolean] :privileged privileged mode
|
|
179
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
180
|
+
# @return [Hash] { plaintext: Array<Integer> }
|
|
181
|
+
def decrypt(args, originator: nil)
|
|
182
|
+
raise UnsupportedActionError, 'decrypt'
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Creates an HMAC using a derived symmetric key.
|
|
186
|
+
#
|
|
187
|
+
# @param args [Hash]
|
|
188
|
+
# @option args [Array<Integer>] :data byte array
|
|
189
|
+
# @option args [Array] :protocol_id [security_level, protocol_name]
|
|
190
|
+
# @option args [String] :key_id key identifier
|
|
191
|
+
# @option args [String] :counterparty public key hex, 'self', or 'anyone'
|
|
192
|
+
# @option args [Boolean] :privileged privileged mode
|
|
193
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
194
|
+
# @return [Hash] { hmac: Array<Integer> }
|
|
195
|
+
def create_hmac(args, originator: nil)
|
|
196
|
+
raise UnsupportedActionError, 'create_hmac'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Verifies an HMAC using a derived symmetric key.
|
|
200
|
+
#
|
|
201
|
+
# @param args [Hash]
|
|
202
|
+
# @option args [Array<Integer>] :data byte array
|
|
203
|
+
# @option args [Array<Integer>] :hmac HMAC to verify
|
|
204
|
+
# @option args [Array] :protocol_id [security_level, protocol_name]
|
|
205
|
+
# @option args [String] :key_id key identifier
|
|
206
|
+
# @option args [String] :counterparty public key hex, 'self', or 'anyone'
|
|
207
|
+
# @option args [Boolean] :privileged privileged mode
|
|
208
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
209
|
+
# @return [Hash] { valid: true }
|
|
210
|
+
def verify_hmac(args, originator: nil)
|
|
211
|
+
raise UnsupportedActionError, 'verify_hmac'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Creates a digital signature using a derived private key.
|
|
215
|
+
#
|
|
216
|
+
# @param args [Hash]
|
|
217
|
+
# @option args [Array<Integer>] :data data to sign
|
|
218
|
+
# @option args [Array<Integer>] :hash_to_directly_sign pre-hashed data to sign
|
|
219
|
+
# @option args [Array] :protocol_id [security_level, protocol_name]
|
|
220
|
+
# @option args [String] :key_id key identifier
|
|
221
|
+
# @option args [String] :counterparty public key hex, 'self', or 'anyone'
|
|
222
|
+
# @option args [Boolean] :privileged privileged mode
|
|
223
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
224
|
+
# @return [Hash] { signature: Array<Integer> }
|
|
225
|
+
def create_signature(args, originator: nil)
|
|
226
|
+
raise UnsupportedActionError, 'create_signature'
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Verifies a digital signature using a derived public key.
|
|
230
|
+
#
|
|
231
|
+
# @param args [Hash]
|
|
232
|
+
# @option args [Array<Integer>] :data original data
|
|
233
|
+
# @option args [Array<Integer>] :hash_to_directly_verify pre-hashed data
|
|
234
|
+
# @option args [Array<Integer>] :signature DER-encoded signature
|
|
235
|
+
# @option args [Array] :protocol_id [security_level, protocol_name]
|
|
236
|
+
# @option args [String] :key_id key identifier
|
|
237
|
+
# @option args [String] :counterparty public key hex, 'self', or 'anyone'
|
|
238
|
+
# @option args [Boolean] :for_self verify own signature
|
|
239
|
+
# @option args [Boolean] :privileged privileged mode
|
|
240
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
241
|
+
# @return [Hash] { valid: true }
|
|
242
|
+
def verify_signature(args, originator: nil)
|
|
243
|
+
raise UnsupportedActionError, 'verify_signature'
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# --- Identity and Certificate Management ---
|
|
247
|
+
|
|
248
|
+
# Acquires an identity certificate.
|
|
249
|
+
#
|
|
250
|
+
# @param args [Hash]
|
|
251
|
+
# @option args [String] :type certificate type (base64)
|
|
252
|
+
# @option args [String] :certifier certifier public key hex
|
|
253
|
+
# @option args [String] :acquisition_protocol 'direct' or 'issuance'
|
|
254
|
+
# @option args [Hash] :fields certificate fields
|
|
255
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
256
|
+
# @return [Hash] certificate data
|
|
257
|
+
def acquire_certificate(args, originator: nil)
|
|
258
|
+
raise UnsupportedActionError, 'acquire_certificate'
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Lists identity certificates.
|
|
262
|
+
#
|
|
263
|
+
# @param args [Hash]
|
|
264
|
+
# @option args [Array<String>] :certifiers certifier public keys
|
|
265
|
+
# @option args [Array<String>] :types certificate types
|
|
266
|
+
# @option args [Integer] :limit max results
|
|
267
|
+
# @option args [Integer] :offset number to skip
|
|
268
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
269
|
+
# @return [Hash] with :total_certificates, :certificates
|
|
270
|
+
def list_certificates(args, originator: nil)
|
|
271
|
+
raise UnsupportedActionError, 'list_certificates'
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Proves select fields of a certificate to a verifier.
|
|
275
|
+
#
|
|
276
|
+
# @param args [Hash]
|
|
277
|
+
# @option args [Hash] :certificate the certificate to prove
|
|
278
|
+
# @option args [Array<String>] :fields_to_reveal field names to reveal
|
|
279
|
+
# @option args [String] :verifier verifier public key hex
|
|
280
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
281
|
+
# @return [Hash] { keyring_for_verifier: Hash }
|
|
282
|
+
def prove_certificate(args, originator: nil)
|
|
283
|
+
raise UnsupportedActionError, 'prove_certificate'
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Removes a certificate from the wallet.
|
|
287
|
+
#
|
|
288
|
+
# @param args [Hash]
|
|
289
|
+
# @option args [String] :type certificate type
|
|
290
|
+
# @option args [String] :serial_number certificate serial number
|
|
291
|
+
# @option args [String] :certifier certifier public key hex
|
|
292
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
293
|
+
# @return [Hash] { relinquished: true }
|
|
294
|
+
def relinquish_certificate(args, originator: nil)
|
|
295
|
+
raise UnsupportedActionError, 'relinquish_certificate'
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Discovers certificates by identity key.
|
|
299
|
+
#
|
|
300
|
+
# @param args [Hash]
|
|
301
|
+
# @option args [String] :identity_key public key hex to search
|
|
302
|
+
# @option args [Integer] :limit max results
|
|
303
|
+
# @option args [Integer] :offset number to skip
|
|
304
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
305
|
+
# @return [Hash] with :total_certificates, :certificates
|
|
306
|
+
def discover_by_identity_key(args, originator: nil)
|
|
307
|
+
raise UnsupportedActionError, 'discover_by_identity_key'
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# Discovers certificates by attributes.
|
|
311
|
+
#
|
|
312
|
+
# @param args [Hash]
|
|
313
|
+
# @option args [Hash] :attributes attribute name/value pairs to match
|
|
314
|
+
# @option args [Integer] :limit max results
|
|
315
|
+
# @option args [Integer] :offset number to skip
|
|
316
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
317
|
+
# @return [Hash] with :total_certificates, :certificates
|
|
318
|
+
def discover_by_attributes(args, originator: nil)
|
|
319
|
+
raise UnsupportedActionError, 'discover_by_attributes'
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# --- Blockchain and Network Data ---
|
|
323
|
+
|
|
324
|
+
# Returns the current blockchain height.
|
|
325
|
+
#
|
|
326
|
+
# @param args [Hash] empty hash
|
|
327
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
328
|
+
# @return [Hash] { height: Integer }
|
|
329
|
+
def get_height(args = {}, originator: nil)
|
|
330
|
+
raise UnsupportedActionError, 'get_height'
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Returns the block header at a given height.
|
|
334
|
+
#
|
|
335
|
+
# @param args [Hash]
|
|
336
|
+
# @option args [Integer] :height block height
|
|
337
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
338
|
+
# @return [Hash] { header: String }
|
|
339
|
+
def get_header_for_height(args, originator: nil)
|
|
340
|
+
raise UnsupportedActionError, 'get_header_for_height'
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Returns the network (mainnet or testnet).
|
|
344
|
+
#
|
|
345
|
+
# @param args [Hash] empty hash
|
|
346
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
347
|
+
# @return [Hash] { network: String }
|
|
348
|
+
def get_network(args = {}, originator: nil)
|
|
349
|
+
raise UnsupportedActionError, 'get_network'
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Returns the wallet version string.
|
|
353
|
+
#
|
|
354
|
+
# @param args [Hash] empty hash
|
|
355
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
356
|
+
# @return [Hash] { version: String }
|
|
357
|
+
def get_version(args = {}, originator: nil)
|
|
358
|
+
raise UnsupportedActionError, 'get_version'
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# --- Authentication ---
|
|
362
|
+
|
|
363
|
+
# Checks if the user is authenticated.
|
|
364
|
+
#
|
|
365
|
+
# @param args [Hash] empty hash
|
|
366
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
367
|
+
# @return [Hash] { authenticated: Boolean }
|
|
368
|
+
def is_authenticated(args = {}, originator: nil)
|
|
369
|
+
raise UnsupportedActionError, 'is_authenticated'
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# Waits until the user is authenticated.
|
|
373
|
+
#
|
|
374
|
+
# @param args [Hash] empty hash
|
|
375
|
+
# @param originator [String, nil] FQDN of the originating application
|
|
376
|
+
# @return [Hash] { authenticated: true }
|
|
377
|
+
def wait_for_authentication(args = {}, originator: nil)
|
|
378
|
+
raise UnsupportedActionError, 'wait_for_authentication'
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
# rubocop:enable Lint/UnusedMethodArgument
|
|
382
|
+
end
|
|
383
|
+
end
|
|
384
|
+
end
|