Class: NftmakerApi::Client::Projects
- Inherits:
-
Object
- Object
- NftmakerApi::Client::Projects
- Defined in:
- lib/nftmaker_api/client/projects.rb
Instance Method Summary collapse
- #create(name:, policy_expires: true, policy_locks_at: Time.now.advance(months: 6), address_expires_in: 10) ⇒ Object
-
#initialize(client) ⇒ Projects
constructor
A new instance of Projects.
- #list ⇒ Object
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 |
#list ⇒ Object
14 15 16 |
# File 'lib/nftmaker_api/client/projects.rb', line 14 def list @client.get "ListProjects/#{@client.api_key}" end |