Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phantasma

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phantasma

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Phantasma Ruby SDK

Phantasma - A Smart NFT Carbon Negative Blockchain for Gaming, dApp

This gem is community edition of Phantasma Blockchain SDK in Ruby.

Install

gem "phantasma", :git => "https://github.com/MysteriousNothing/phantasma.git"
# or RubyGems
gem "phantasma" 
Test API URL

https://testnet.phantasma.info

Live API URL

https://phantasma.gitbook.io/developers/overview/quick-start

The Ruby version does not use different classes, we use Ruby metaprogramming. This means adding new endpoint means updating ALLOWED_METHOD const in lib/phantasma/API/api.rb

Examples how to use API:
api = Phantasma::API::Request.new(url: 'https://testnet.phantasma.info')
api.get_account({account: '1231313'})
api.get_accounts({accounts: ['1231313']})
api.get_addresses_by_symbol({symbol: 'SOUL', extended: false})
api.look_up_name({name: 'SOUL'})
Examples how to use RPC call with API:
api = Phantasma::API::Request.new(url: 'https://testnet.phantasma.info')
api.rpc({"jsonrpc": "2.0", "method": "health", "id": "1", "params": [] })

Full API documentation is here:

docs/api_documentation.md

Generate documentation after API update:

ruby lib/phantasma/documentation.rb

Phantasma Documentation for API Endpoints with responses

https://testnet.phantasma.info/swagger/index.html

Helpers

Find missing or deprecated API endpoints by calling

Phantasma::API.find_missing_endpoints
Phantasma::API.find_deprecated_endpoints

Running tests

# All tests
rspec spec/
# Specific
rspec spec/API/api_spec.rb

Todo

  • Finish tests - 233 examples, 5 failures, 228 passed

  • RPC or eRPC(Google RPC, http2)

  • Phantasma VM in Ruby

  • Add API command line support

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/MysteriousNothing/phantasma.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 24 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc