3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NEMのアドレスがマルチシグであるかを確認するコード

Last updated at Posted at 2018-01-27

使い方

python3が必要です。
引数(NEMADDRSS)に入れたアドレスのマルチシグ状況を返します。

$ python app.py NEMADDRESS
{'cosignatoriesCount': 2, 'minCosignatories': 2}

cosignatoriesCount: マルチシグの署名者の数
minCosignatories: 最低限必要な署名の数
上記例は、マルチシグ署名アドレスが2つあり、そのうち2つが署名しなければ送金できない。

コード

app.py
import json
import requests
import random
import sys

argvs = sys.argv

# 接続するノードを選択
def apiRequest(path, param, value):
    nisList = ['78.47.162.99', '47.91.94.195', '138.201.186.71', '89.107.56.153', '47.254.134.237']
    nis = nisList[random.randrange(len(nisList))]
    r = requests.get("http://{}:7890".format(nis) + path + param + value)
    f = json.loads(r.text)
    return f

# apiでアカウントデータを取得
def getAccountData(nemAddress):
    path = "/account/get"
    result = apiRequest(path, "?address=", nemAddress)
    result = result['account']['multisigInfo']
    return result

print(getAccountData(argvs[1]))

参考

NEM NIS API Version 1.22/ Requesting the account data
取引所などのアドレスと思われるもの一覧

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?