@kyuzan/annapurna-sdk-js
v1.1.0
Published
Annapurna NFT Platform Client SDK
Downloads
93
Keywords
Readme
@KyuzanInc/mint-sdk-js
Kyuzan Inc. MINT の SDK
Source Code
Getting Started
Install
% npm i @kyuzan/annapurna-sdk-js
API Documentation
AccessToken と ProjectId の取得
Kyuzan に連絡
本番用、開発用単位でプロジェクトを生成して運用する想定。 現状は Kyuzan が用意する、
NFT のマスターデータ入稿
Kyuzan に連絡
About ETH
通常の NFT ショップなどは ETH は、ether という単位で取引される。(日本円でいうと円
)
ETH にとって wei が最小単位である。(銭)
1ether === 1000000000000000000wei
ETH in SDK
SDK では基本的には、number
型を用いて ether 単位で通貨を扱う。
一部、BigNumber
クラスとして通貨を扱っている。wei をnumber
型で扱うと、環境によってはオーバーフローを起こすため、BigNumber
クラスを用いて表現しているためだ。
SDK では通貨のユーティリティーとして以下を提供している。
SDK.formatEther
を用いると、BigNumber
から ether 単位に変換したstring
を取得できるSDK.parseEther
を用いると、ether の文字列からwei
を表現したBigNumber
を取得できる
How to Get ETH for Rinkeby(Test Env)
テスト環境で使える ETH の入手方法は以下の通り
- ウォレットのアドレスをメモ
- https://faucet.rinkeby.io/ のサイトにアクセス
- Tweet リンクをクリック
0x0000.....
部分を 1 でメモしたアドレスに置換する- Tweet
- Tweet の URL をコピーしサイトの Input に貼り付ける
- Give me Ether ボタンを押す
- しばらくすると入金される
Developing SDK
- [ ] - want: 同時入札による競り負けエラーは、sdk 側で判別できるように
- [ ] CI: test
- [ ] CI: npm publish(ドキュメント生成・test・semver)
- [ ] SDK を用いた MINT ローカル開発手順
- [ ] Backend との IF。OpenAPI を用いた、ドキュメント・型・クライアントの自動生成