Skip to content

Instantly share code, notes, and snippets.

View daoka's full-sized avatar
🏠
Working from home

daokasweep daoka

🏠
Working from home
View GitHub Profile
@daoka
daoka / keybase.md
Created October 7, 2017 16:17
Keybase

Keybase proof

I hereby claim:

  • I am daoka on github.
  • I am daokasweep (https://keybase.io/daokasweep) on keybase.
  • I have a public key ASBounQUxgc1rDNAnVDW4_cU-i5nSEz5SkfX0jUosyMdYAo

To claim this, I am signing this object:

require 'rubygems'
require 'nis'
# turn on output request information
Nis.logger.level = Logger::DEBUG
PRIVATE_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
nis = Nis.new(host: '23.228.67.85')
keyPair = Nis::Keypair.new(PRIVATE_KEY)
@daoka
daoka / transfer_sample.json
Created June 9, 2018 16:12
NEM2 Transfer Transaction Sample with Node-Red
[
{
"id": "e00a6b2.2f87898",
"type": "transfer",
"z": "7c68421c.ffca4c",
"name": "",
"address": "",
"message": "",
"amount": "0",
"namespace": "",
@daoka
daoka / Doxyfile
Created January 6, 2019 13:38
Catapult Server Docs generated by doxygen
# Doxyfile 1.8.14
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
@daoka
daoka / roadmap.md
Last active February 24, 2019 16:30
今までの挙動 新しい挙動
モザイク名 ネームスペース + 自身の名前 ネームスペースのエイリアス
ID ネームスペース + 自身の名前 ナンスから生成される
有効期限 作成時にセットされる 永続か有効期限をセットする
@daoka
daoka / AddressLink.ts
Last active March 6, 2019 04:39
nem2-sdk(v0.10.2 beta) cow sandbox
@daoka
daoka / hd-wallets-sample.ts
Created May 15, 2019 01:25
nem2-hd-wallets test
import { MnemonicPassPhrase, ExtendedKey, Network, Wallet } from 'nem2-hd-wallets';
const mnemonic = MnemonicPassPhrase.createRandom();
console.log(mnemonic);
const bip32seed = mnemonic.toEntropy();
console.log(`seed: ${bip32seed}`);
const xKey = ExtendedKey.createFromSeed(bip32seed);
console.log(`xkey: ${xKey.toBase58()}`);
const wallet = new Wallet(xKey);
@daoka
daoka / AggregateBondTx.ts
Last active July 20, 2019 08:47
Aggregate Transaction (Elephant-1)
import { Listener, Account, NetworkType, PublicAccount, TransferTransaction, Deadline, PlainMessage, NetworkCurrencyMosaic, AggregateTransaction, HashLockTransaction, UInt64, TransactionHttp } from 'nem2-sdk';
import { filter, mergeMap } from 'rxjs/operators';
const nodeUrl = 'https://catapult-test.opening-line.jp:3001';
const transactionHttp = new TransactionHttp(nodeUrl);
const listener = new Listener(nodeUrl);
const aPrivateKey = 'Account_A_Private_Key';
const aAccount = Account.createFromPrivateKey(aPrivateKey, NetworkType.MIJIN_TEST);
@daoka
daoka / getAccountMosaics.ts
Created December 2, 2019 03:57
Get account holds mosaics
import * as dotenv from 'dotenv';
import { MosaicHttp, Account, NetworkType, MosaicService, AccountHttp } from 'nem2-sdk';
import { mergeMap } from 'rxjs/operators';
dotenv.config();
const endpoint = process.env.API_ENDPOINT;
const accountHttp = new AccountHttp(endpoint);
const mosaicHttp = new MosaicHttp(endpoint);
const mosaicService = new MosaicService(accountHttp, mosaicHttp);