Class: Sibit::Fake
- Inherits:
-
Object
- Object
- Sibit::Fake
- Defined in:
- lib/sibit/fake.rb
Overview
Fake API.
- Author
Yegor Bugayenko (yegor256@gmail.com)
- Copyright
Copyright (c) 2019-2026 Yegor Bugayenko
- License
MIT
Instance Method Summary collapse
- #balance(_address) ⇒ Object
- #block(hash) ⇒ Object
- #fees ⇒ Object
- #height(_hash) ⇒ Object
- #latest ⇒ Object
- #next_of(_hash) ⇒ Object
- #price(_cur = 'USD') ⇒ Object
- #push(_hex) ⇒ Object
- #utxos(_sources) ⇒ Object
Instance Method Details
#balance(_address) ⇒ Object
30 31 32 |
# File 'lib/sibit/fake.rb', line 30 def balance(_address) 100_000_000 end |
#block(hash) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/sibit/fake.rb', line 52 def block(hash) { provider: self.class.name, hash: hash, orphan: false, next: hash, previous: hash, txns: [ { hash: hash, outputs: [ { address: '1HqhZx8U18TYS5paraTM1MzUQWb7ZbcG9u', value: 1000 } ] } ] } end |
#fees ⇒ Object
26 27 28 |
# File 'lib/sibit/fake.rb', line 26 def fees { S: 12, M: 45, L: 100, XL: 200 } end |
#height(_hash) ⇒ Object
22 23 24 |
# File 'lib/sibit/fake.rb', line 22 def height(_hash) 1 end |
#latest ⇒ Object
48 49 50 |
# File 'lib/sibit/fake.rb', line 48 def latest '00000000000000000008df8a6e1b61d1136803ac9791b8725235c9f780b4ed71' end |
#next_of(_hash) ⇒ Object
18 19 20 |
# File 'lib/sibit/fake.rb', line 18 def next_of(_hash) nil end |
#price(_cur = 'USD') ⇒ Object
14 15 16 |
# File 'lib/sibit/fake.rb', line 14 def price(_cur = 'USD') 4_000 end |
#push(_hex) ⇒ Object
46 |
# File 'lib/sibit/fake.rb', line 46 def push(_hex); end |
#utxos(_sources) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/sibit/fake.rb', line 34 def utxos(_sources) [ { hash: '5de641d3867eb8fec3eb1a5ef2b44df39b54e0b3bb664ab520f2ae26a5b18ffc', index: 0, value: 100_000_000, confirmations: 6, script: '76a914c48a1737b35a9f9d9e3b624a910f1e22f7e80bbc88ac' } ] end |