Socket
Book a DemoInstallSign in
Socket

mixin_sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixin_sdk

0.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

MixinSdk

Ruby版本的MixinApi

Installation

Add this line to your application's Gemfile:

gem 'mixin_sdk', github: 'xueshaojie/mixin_sdk', branch: 'master'

And then execute:

$ gem install mixin_sdk

Usage

如果使用rails可以放到 config/initializers/mixin_sdk.rb

  MixinSdk.configuration do |config|
    config.client_id = your_client_id
    config.session_id = your_session_id
    config.private_key = your_private_key
    config.pin_token = your_pin_token
  end

如果不是rails中

  require 'mixin_sdk'

  MixinSdk.configuration do |config|
    config.client_id = your_client_id
    config.session_id = your_session_id
    config.private_key = your_private_key
    config.pin_token = your_pin_token
  end

使用示例 get方法的示例

  def read_profile
    MixinSdk.mixin("get", "me")
  end

  def update_profile
    MixinSdk.mixin("get", "assets")
  end

使用示例 post方法的示例

  def update_profile
    options = {
      full_name: "价格提醒助手"
    }.to_json
    MixinSdk.mixin("post", "me", options)
  end

  def tran_to_user
    options = {
      asset_id: "965e5c6e-434c-3fa9-b780-c50f43cd955c",
      opponent_id: "c4d975b4-36ee-4ff5-8e08-13a86d495904",
      amount: "1",
      pin: MixinSdk.encrypt_pin("123456"), # pin_code = "123456"
      trace_id: SecureRandom.uuid,
      memo: "transfer"
    }.to_json
    MixinSdk.mixin("post", "transfers", options)
  end

需要结合Mixin的开发文档来使用。例如,查看接口名称、请求类型、参数。

References

Mixin开发文档 mixin_bot(ruby) mixin-node (nodejs)

License

MIT License.

FAQs

Package last updated on 31 Oct 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.