Class: NftmakerApi::Client::Projects

Inherits:
Object
  • Object
show all
Defined in:
lib/nftmaker_api/client/projects.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Projects

Returns a new instance of Projects.



3
4
5
# File 'lib/nftmaker_api/client/projects.rb', line 3

def initialize(client)
  @client = client
end

Instance Method Details

#create(name:, policy_expires: true, policy_locks_at: Time.now.advance(months: 6), address_expires_in: 10) ⇒ Object



7
8
9
10
11
12
# File 'lib/nftmaker_api/client/projects.rb', line 7

def create(name:, policy_expires: true, policy_locks_at: Time.now.advance(months: 6), address_expires_in: 10)
  body = {projectname: name, maxNftSupply: 1, policyExpires: policy_expires, addressExpiretime: address_expires_in}
  body.merge!({ policyLocksDateTime: policy_locks_at.iso8601 }) if policy_expires

  @client.post "/CreateProject/#{@client.api_key}", body.to_json
end

#listObject



14
15
16
# File 'lib/nftmaker_api/client/projects.rb', line 14

def list
  @client.get "ListProjects/#{@client.api_key}"
end