Class: IOTA::API::Commands

Inherits:
Object
  • Object
show all
Defined in:
lib/iota/api/commands.rb

Instance Method Summary collapse

Instance Method Details

#addNeighbors(uris) ⇒ Object


45
46
47
48
49
50
# File 'lib/iota/api/commands.rb', line 45

def addNeighbors(uris)
  {
    command: 'addNeighbors',
    uris: uris
  }
end

#attachToTangle(trunkTransaction, branchTransaction, minWeightMagnitude, trytes) ⇒ Object


70
71
72
73
74
75
76
77
78
# File 'lib/iota/api/commands.rb', line 70

def attachToTangle(trunkTransaction, branchTransaction, minWeightMagnitude, trytes)
  {
    command: 'attachToTangle',
    trunkTransaction: trunkTransaction,
    branchTransaction: branchTransaction,
    minWeightMagnitude: minWeightMagnitude,
    trytes: trytes
  }
end

#broadcastTransactions(trytes) ⇒ Object


84
85
86
87
88
89
# File 'lib/iota/api/commands.rb', line 84

def broadcastTransactions(trytes)
  {
    command: 'broadcastTransactions',
    trytes: trytes
  }
end

#checkConsistency(tails) ⇒ Object


98
99
100
101
102
103
# File 'lib/iota/api/commands.rb', line 98

def checkConsistency(tails)
  {
    command: 'checkConsistency',
    tails: tails
  }
end

#findTransactions(searchValues) ⇒ Object


4
5
6
7
8
9
10
11
12
# File 'lib/iota/api/commands.rb', line 4

def findTransactions(searchValues)
  command = {
    command: 'findTransactions'
  }

  searchValues.each { |k, v| command[k.to_sym] = v }

  command
end

#getBalances(addresses, threshold) ⇒ Object


14
15
16
17
18
19
20
# File 'lib/iota/api/commands.rb', line 14

def getBalances(addresses, threshold)
  {
    command: 'getBalances',
    addresses: addresses,
    threshold: threshold
  }
end

#getInclusionStates(transactions, tips) ⇒ Object


29
30
31
32
33
34
35
# File 'lib/iota/api/commands.rb', line 29

def getInclusionStates(transactions, tips)
  {
    command: 'getInclusionStates',
    transactions: transactions,
    tips: tips
  }
end

#getNeighborsObject


41
42
43
# File 'lib/iota/api/commands.rb', line 41

def getNeighbors
  { command: 'getNeighbors' }
end

#getNodeInfoObject


37
38
39
# File 'lib/iota/api/commands.rb', line 37

def getNodeInfo
  { command: 'getNodeInfo'}
end

#getTipsObject


59
60
61
# File 'lib/iota/api/commands.rb', line 59

def getTips
  { command: 'getTips' }
end

#getTransactionsToApprove(depth, reference = nil) ⇒ Object


63
64
65
66
67
68
# File 'lib/iota/api/commands.rb', line 63

def getTransactionsToApprove(depth, reference = nil)
  {
    command: 'getTransactionsToApprove',
    depth: depth
  }.merge(reference.nil? ? {} : { reference: reference })
end

#getTrytes(hashes) ⇒ Object


22
23
24
25
26
27
# File 'lib/iota/api/commands.rb', line 22

def getTrytes(hashes)
  {
    command: 'getTrytes',
    hashes: hashes
  }
end

#interruptAttachingToTangleObject


80
81
82
# File 'lib/iota/api/commands.rb', line 80

def interruptAttachingToTangle
  { command: 'interruptAttachingToTangle' }
end

#removeNeighbors(uris) ⇒ Object


52
53
54
55
56
57
# File 'lib/iota/api/commands.rb', line 52

def removeNeighbors(uris)
  {
    command: 'removeNeighbors',
    uris: uris
  }
end

#storeTransactions(trytes) ⇒ Object


91
92
93
94
95
96
# File 'lib/iota/api/commands.rb', line 91

def storeTransactions(trytes)
  {
    command: 'storeTransactions',
    trytes: trytes
  }
end

#wereAddressesSpentFrom(addresses) ⇒ Object


105
106
107
108
109
110
# File 'lib/iota/api/commands.rb', line 105

def wereAddressesSpentFrom(addresses)
  {
    command: 'wereAddressesSpentFrom',
    addresses: addresses
  }
end