Class: TridentAssistant::API

Inherits:
Object
  • Object
show all
Includes:
Collectible, Collection, Metadata, MixinAsset, Order
Defined in:
lib/trident_assistant/api.rb,
lib/trident_assistant/api/order.rb,
lib/trident_assistant/api/metadata.rb,
lib/trident_assistant/api/collection.rb,
lib/trident_assistant/api/collectible.rb,
lib/trident_assistant/api/mixin_asset.rb

Overview

APIs of Trident server

Defined Under Namespace

Modules: Collectible, Collection, Metadata, MixinAsset, Order Classes: ArgumentError, ForbiddenError, UnauthorizedError

Constant Summary

Constants included from Order

Order::EXCHANGE_ASSET_ID, Order::MINIMUM_AMOUNT

Constants included from Collectible

Collectible::EXCHANGE_ASSET_ID, Collectible::MINIMUM_AMOUNT

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Order

#ask_order, #auction_order, #bid_order, #cancel_order, #fill_order, #order, #orders

Methods included from MixinAsset

#assets

Methods included from Metadata

#metadata, #upload_metadata

Methods included from Collection

#collection, #collections, #create_collection, #update_collection

Methods included from Collectible

#airdrop, #collectibles, #deposit, #transfer, #withdraw

Constructor Details

#initialize(**args) ⇒ API

Returns a new instance of API.



19
20
21
22
23
24
25
# File 'lib/trident_assistant/api.rb', line 19

def initialize(**args)
  @client = Client.new endpoint: args[:endpoint], debug: args[:debug]
  return if args[:keystore].blank?

  @keystore = TridentAssistant::Utils.parse_json args[:keystore]
  @mixin_bot = TridentAssistant::Utils.mixin_bot_from_keystore args[:keystore]
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



17
18
19
# File 'lib/trident_assistant/api.rb', line 17

def client
  @client
end

#keystoreObject (readonly)

Returns the value of attribute keystore.



17
18
19
# File 'lib/trident_assistant/api.rb', line 17

def keystore
  @keystore
end

#mixin_botObject (readonly)

Returns the value of attribute mixin_bot.



17
18
19
# File 'lib/trident_assistant/api.rb', line 17

def mixin_bot
  @mixin_bot
end