@tech-bureau/mijin-catapult-tools 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env/dev.ts +23 -0
- package/.env/prod.ts +23 -0
- package/.github/workflows/main.yml +37 -0
- package/.prettierrc.json +5 -0
- package/LICENSE +21 -0
- package/README.md +646 -0
- package/bin/mijin-catapult-tools.js +3 -0
- package/dist/main.js +2 -0
- package/jest.config.js +8 -0
- package/package.json +55 -0
- package/src/__tests__/service/AccountServices.spec.ts +63 -0
- package/src/__tests__/service/CertificateServices.spec.ts +20 -0
- package/src/__tests__/service/MessageServices.spec.ts +48 -0
- package/src/__tests__/service/MosaicServices.spec.ts +61 -0
- package/src/cli.ts +18 -0
- package/src/commands/account/account.ts +16 -0
- package/src/commands/account/accountGenerate.ts +19 -0
- package/src/commands/account/accountInfo.ts +16 -0
- package/src/commands/mosaic/mosaic.ts +16 -0
- package/src/commands/mosaic/mosaicCreate.ts +20 -0
- package/src/commands/mosaic/mosaicInfo.ts +13 -0
- package/src/commands/transaction/transaction.ts +18 -0
- package/src/commands/transaction/transactionStatus.ts +13 -0
- package/src/commands/transaction/transfer.ts +16 -0
- package/src/commands/votingkey/votingkey.ts +18 -0
- package/src/commands/votingkey/votingkeyCreate.ts +15 -0
- package/src/commands/votingkey/votingkeyInfo.ts +13 -0
- package/src/commands/votingkey/votingkeyUpdate.ts +15 -0
- package/src/infrastructure/account/accountGenerate.ts +183 -0
- package/src/infrastructure/account/accountInfo.ts +154 -0
- package/src/infrastructure/mosaic/mosaicCreate.ts +149 -0
- package/src/infrastructure/mosaic/mosaicInfo.ts +40 -0
- package/src/infrastructure/transaction/transactionStatus.ts +57 -0
- package/src/infrastructure/transaction/transfer.ts +168 -0
- package/src/infrastructure/voting/votingCreate.ts +88 -0
- package/src/infrastructure/voting/votingInfo.ts +44 -0
- package/src/infrastructure/voting/votingUpdate.ts +94 -0
- package/src/service/AccountServices.ts +68 -0
- package/src/service/CertificateServices.ts +165 -0
- package/src/service/CmdServices.ts +17 -0
- package/src/service/Logger.ts +26 -0
- package/src/service/MessageServices.ts +17 -0
- package/src/service/MosaicServices.ts +62 -0
- package/src/service/RepositoryFactory.ts +107 -0
- package/src/service/TransactionServices.ts +268 -0
- package/src/service/VotingServices.ts +184 -0
- package/src/types/AccountInfo.ts +19 -0
- package/src/types/AccountType.ts +9 -0
- package/src/types/ConfigFile.ts +24 -0
- package/src/types/Environment.ts +5 -0
- package/src/types/IAccountOption.ts +16 -0
- package/src/types/ILinkOption.ts +3 -0
- package/src/types/IMosaicOption.ts +18 -0
- package/src/types/ITransactionOption.ts +5 -0
- package/src/types/ITransferOption.ts +9 -0
- package/src/types/IVotingOption.ts +21 -0
- package/src/types/index.ts +9 -0
- package/src/utils.ts +38 -0
- package/tsconfig.json +24 -0
- package/webpack.config.js +24 -0
package/jest.config.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tech-bureau/mijin-catapult-tools",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"description": "This tool is for easy operation of mijin Catapult(v.2)",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "dist/main.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "jest",
|
|
9
|
+
"build:dev": "rm -rf ./dist && NODE_ENV=dev webpack --mode development",
|
|
10
|
+
"build:tsc": "rm -rf ./dist && tsc -b",
|
|
11
|
+
"build": "rm -rf ./dist && NODE_ENV=prod webpack --mode production"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"mijin-catapult-tools": "./bin/mijin-catapult-tools.js"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/tech-bureau-jp/mijin-catapult-tools.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mijin",
|
|
22
|
+
"catapult",
|
|
23
|
+
"symbol"
|
|
24
|
+
],
|
|
25
|
+
"author": "Techbureau, corp.",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/tech-bureau-jp/mijin-catapult-tools/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/tech-bureau-jp/mijin-catapult-tools#readme",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@noble/ed25519": "^1.7.1",
|
|
33
|
+
"@tech-bureau/symbol-sdk": "^2.0.3-comsa-2023011801",
|
|
34
|
+
"commander": "9.5.0",
|
|
35
|
+
"config": "^3.3.4",
|
|
36
|
+
"js-sha3": "git+https://github.com/Propine/js-sha3.git",
|
|
37
|
+
"node-forge": "git+https://github.com/dugrema/forge.git#ed25519",
|
|
38
|
+
"utf8": "^3.0.0",
|
|
39
|
+
"winston": "^3.3.3"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/commander": "^2.12.2",
|
|
43
|
+
"@types/jest": "^29.2.0",
|
|
44
|
+
"@types/node": "^14.14.31",
|
|
45
|
+
"@types/node-forge": "^1.3.0",
|
|
46
|
+
"bufferutil": "^4.0.3",
|
|
47
|
+
"jest": "^29.2.1",
|
|
48
|
+
"ts-jest": "^29.0.3",
|
|
49
|
+
"ts-loader": "^8.0.17",
|
|
50
|
+
"typescript": "^4.3.5",
|
|
51
|
+
"utf-8-validate": "^5.0.4",
|
|
52
|
+
"webpack": "^5.24.2",
|
|
53
|
+
"webpack-cli": "^4.5.0"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import AccountServices from '../../service/AccountServices'
|
|
2
|
+
import { NetworkType, RepositoryFactoryHttp } from '@tech-bureau/symbol-sdk'
|
|
3
|
+
|
|
4
|
+
const config = {
|
|
5
|
+
url: 'http://localhost:3000',
|
|
6
|
+
workAccount: {
|
|
7
|
+
publicKey: '3F27354F4AB597815CC0AE5DCF0A76B84972B9DC4C2C8B3444A5B7B33CDCCC8B',
|
|
8
|
+
privateKey: '43798BEA15F8AEBEDD5E0A118E22CF92961C9828DA5CF6D4934B8E90ABEBF810',
|
|
9
|
+
address: 'MCSY5DDP3BPAZBBAGTVQIOGOSPPVW44MUNRYS6Y',
|
|
10
|
+
},
|
|
11
|
+
balanceAccount: {
|
|
12
|
+
publicKey: '',
|
|
13
|
+
privateKey: '',
|
|
14
|
+
address: '',
|
|
15
|
+
},
|
|
16
|
+
mainAccount: {
|
|
17
|
+
publicKey: '6FD0C210197575FCD0D107A1D7659A1C1C50B772D8A20DE5087BA9CF3B219AED',
|
|
18
|
+
privateKey: 'EA23C6C6B51A792787E1C9B0F3853BE6A67E1A5A582B2C0C0574DC081519202F',
|
|
19
|
+
address: 'MD5TU6DJ6ASYD6FZ6JPUXSYQBWOMX62ZU6BQVIY',
|
|
20
|
+
},
|
|
21
|
+
keylink: {
|
|
22
|
+
vrf: {
|
|
23
|
+
publicKey: '594CE57AF061552E2579DB4E3D72E6734A51233A1D673E251DB9E5D746D625B5',
|
|
24
|
+
privateKey: '6223A626A49F9B0AD8C604FC0FDC958A7A6CAF7E423ED6F3CC3FBC05F1876337',
|
|
25
|
+
address: 'MD6E6WAON6MUBLFHQSWSSGD74T6N3MWT6FFLDVQ',
|
|
26
|
+
},
|
|
27
|
+
voting: {
|
|
28
|
+
publicKey: '2DB728332ADCA6FE4424C21C7E0FC4831955744B3C86EB957318C9D467C8CD9D',
|
|
29
|
+
privateKey: '67F0FE4040B10F03230C8134327301B270693CF4D6A99DEFE835A0DCC8A0CCFD',
|
|
30
|
+
address: 'MBG6SPNMS6INNPI5MKIF6XINEKAWNAJ5EVK6V6Y',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
describe('start create account test', () => {
|
|
36
|
+
it('Create Account from PrivateKey function', async () => {
|
|
37
|
+
const account = AccountServices.createAccount(config.mainAccount.privateKey, NetworkType.MIJIN_TEST)
|
|
38
|
+
expect(account).toBeDefined()
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('Create Account from PublicKey function', async () => {
|
|
42
|
+
const account = AccountServices.createPublicAccount(config.mainAccount.publicKey, NetworkType.MIJIN_TEST)
|
|
43
|
+
expect(account).toBeDefined()
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('Create Accounts from PublicKey function', async () => {
|
|
47
|
+
const account = AccountServices.createPublicAccountArray(
|
|
48
|
+
[config.mainAccount.publicKey, config.keylink.voting.publicKey, config.keylink.vrf.publicKey],
|
|
49
|
+
NetworkType.MIJIN_TEST
|
|
50
|
+
)
|
|
51
|
+
expect(account).toBeDefined()
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('Create Address from Raw Address function', async () => {
|
|
55
|
+
const address = AccountServices.createAddress(config.mainAccount.address)
|
|
56
|
+
expect(address).toBeDefined()
|
|
57
|
+
|
|
58
|
+
// const accountRepository = new RepositoryFactoryHttp(config.url).createAccountRepository()
|
|
59
|
+
|
|
60
|
+
// const addressInfo = await AccountServices.addressInfo(address, accountRepository)
|
|
61
|
+
// expect(addressInfo).toBeDefined()
|
|
62
|
+
})
|
|
63
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import CertificateServices from '../../service/CertificateServices'
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
commonName: 'mijin.io',
|
|
5
|
+
nodeName: 'node',
|
|
6
|
+
days: 3650,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const certificateServices = new CertificateServices()
|
|
10
|
+
|
|
11
|
+
describe('start create certificate test', () => {
|
|
12
|
+
it('Create Certificate function', async () => {
|
|
13
|
+
const cert = certificateServices.create(config.commonName, config.nodeName, config.days)
|
|
14
|
+
expect(cert).toBeDefined()
|
|
15
|
+
expect(cert.ca.privateKey).toHaveLength(64)
|
|
16
|
+
expect(cert.ca.publicKey).toHaveLength(64)
|
|
17
|
+
expect(cert.client.privateKey).toHaveLength(64)
|
|
18
|
+
expect(cert.client.publicKey).toHaveLength(64)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import MessageServices from '../../service/MessageServices'
|
|
2
|
+
import AccountServices from '../../service/AccountServices'
|
|
3
|
+
import { NetworkType } from '@tech-bureau/symbol-sdk'
|
|
4
|
+
|
|
5
|
+
const config = {
|
|
6
|
+
url: 'http://localhost:3000',
|
|
7
|
+
workAccount: {
|
|
8
|
+
publicKey: '3F27354F4AB597815CC0AE5DCF0A76B84972B9DC4C2C8B3444A5B7B33CDCCC8B',
|
|
9
|
+
privateKey: '43798BEA15F8AEBEDD5E0A118E22CF92961C9828DA5CF6D4934B8E90ABEBF810',
|
|
10
|
+
address: 'MCSY5DDP3BPAZBBAGTVQIOGOSPPVW44MUNRYS6Y',
|
|
11
|
+
},
|
|
12
|
+
balanceAccount: {
|
|
13
|
+
publicKey: '',
|
|
14
|
+
privateKey: '',
|
|
15
|
+
address: '',
|
|
16
|
+
},
|
|
17
|
+
mainAccount: {
|
|
18
|
+
publicKey: '6FD0C210197575FCD0D107A1D7659A1C1C50B772D8A20DE5087BA9CF3B219AED',
|
|
19
|
+
privateKey: 'EA23C6C6B51A792787E1C9B0F3853BE6A67E1A5A582B2C0C0574DC081519202F',
|
|
20
|
+
address: 'MD5TU6DJ6ASYD6FZ6JPUXSYQBWOMX62ZU6BQVIY',
|
|
21
|
+
},
|
|
22
|
+
keylink: {
|
|
23
|
+
vrf: {
|
|
24
|
+
publicKey: '594CE57AF061552E2579DB4E3D72E6734A51233A1D673E251DB9E5D746D625B5',
|
|
25
|
+
privateKey: '6223A626A49F9B0AD8C604FC0FDC958A7A6CAF7E423ED6F3CC3FBC05F1876337',
|
|
26
|
+
address: 'MD6E6WAON6MUBLFHQSWSSGD74T6N3MWT6FFLDVQ',
|
|
27
|
+
},
|
|
28
|
+
voting: {
|
|
29
|
+
publicKey: '2DB728332ADCA6FE4424C21C7E0FC4831955744B3C86EB957318C9D467C8CD9D',
|
|
30
|
+
privateKey: '67F0FE4040B10F03230C8134327301B270693CF4D6A99DEFE835A0DCC8A0CCFD',
|
|
31
|
+
address: 'MBG6SPNMS6INNPI5MKIF6XINEKAWNAJ5EVK6V6Y',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
describe('start message test', () => {
|
|
37
|
+
it('Create Message Plain function', async () => {
|
|
38
|
+
const message = MessageServices.createPlain('test')
|
|
39
|
+
expect(message).toBeDefined()
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('Create Message Encrypt function', async () => {
|
|
43
|
+
const account = AccountServices.createAccount(config.mainAccount.privateKey, NetworkType.MIJIN_TEST)
|
|
44
|
+
const message = MessageServices.createEncrypt('test', account.publicAccount, config.workAccount.privateKey)
|
|
45
|
+
|
|
46
|
+
expect(message).toBeDefined()
|
|
47
|
+
})
|
|
48
|
+
})
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import MosaicServices from '../../service/MosaicServices'
|
|
2
|
+
import AccountServices from '../../service/AccountServices'
|
|
3
|
+
import { Mosaic, NetworkType } from '@tech-bureau/symbol-sdk'
|
|
4
|
+
|
|
5
|
+
const config = {
|
|
6
|
+
url: 'http://localhost:3000',
|
|
7
|
+
workAccount: {
|
|
8
|
+
publicKey: '65AB2F5671F285325E0A196651566D3770A1A809C4C169DDFED157E86F63ABA1',
|
|
9
|
+
privateKey: '1E33ACC3CD9F7BB01D1EDD0F560F2D9635D7E6F98D7BFB3EA7EF7EDA5303FB80',
|
|
10
|
+
address: 'MD2NEFQ75FKV5HDOTLTZNEE5SYRRMIAYFYJKA3Q',
|
|
11
|
+
},
|
|
12
|
+
balanceAccount: {
|
|
13
|
+
publicKey: '',
|
|
14
|
+
privateKey: '',
|
|
15
|
+
address: '',
|
|
16
|
+
},
|
|
17
|
+
mainAccount: {
|
|
18
|
+
publicKey: 'CF4250FA98A00C2B201D3BCB4CF5B7965C41DFBD6D331CB56F16BCC03DB79B4C',
|
|
19
|
+
privateKey: 'BFC70F2FC37D1CD31F60CE3DC11DD9CF3E0DAEA2B5D960F3456FB63AA0AC83C2',
|
|
20
|
+
address: 'MDAHM3BQQTLIA4WHWN572U35ZJG2ULVJWYCSG5I',
|
|
21
|
+
},
|
|
22
|
+
keylink: {
|
|
23
|
+
vrf: {
|
|
24
|
+
publicKey: '4DC4AFDC04F0271CFFB2B65B0A5E505184EC5AD81892B7541397D2F85F1533D3',
|
|
25
|
+
privateKey: '495656E00893DD1FB8AEF833FF1F60ED2D1D7EF050213EE4DADCC7CC01493ADF',
|
|
26
|
+
address: 'MBR6DL2MMFAG2ASPU5N4HSZPK6I6IEDKB747BRQ',
|
|
27
|
+
},
|
|
28
|
+
voting: {
|
|
29
|
+
publicKey: '937E1684027FB86BAFF47146C98F166767BD3BE3C00E1BF47657C72EBE2C3500',
|
|
30
|
+
privateKey: '1393923A4CE0547D713C9D6C5C327F23ADFB6CCEE344E173528C9119F9654F65',
|
|
31
|
+
address: 'MAL6PBEOZ4KQD4RKTUHCFA2CO2FYYGGMY77KFEA',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
test1Account: {
|
|
35
|
+
publicKey: '49CEF8886711941127EFA8492829748D523F5C6CD4B17EA45759AFEC37BA4C22',
|
|
36
|
+
privateKey: 'D60BA72D4AA73D0845F1742F95C6CEC2F5576DE0C9AA3C4AC764C362AC93ED2C',
|
|
37
|
+
address: 'MDBZDEIYKPLEYGJ7S55TLTXH3R5JZDKP2TPLOUQ',
|
|
38
|
+
},
|
|
39
|
+
test2Account: {
|
|
40
|
+
publicKey: 'A0E0D1D095E22E49A8E679AA470A1A0B10714C27E6471F6C99D982A7FF8A025B',
|
|
41
|
+
privateKey: 'F141362C6F636FCE21BE72C2E42779202F54A91AF14A9BF6140FAA3FCC641944',
|
|
42
|
+
address: 'MAURGUI3OOJ6NF7OUYYEWS6QTAIFLJFK4EQGWZA',
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const mosaicRawId = '13CD4D0575AD0250'
|
|
47
|
+
|
|
48
|
+
describe('start mosaic test', () => {
|
|
49
|
+
it('Create Mosaic Id function', async () => {
|
|
50
|
+
const nonce = MosaicServices.createMosaicNonce()
|
|
51
|
+
const address = AccountServices.createAddress(config.workAccount.address)
|
|
52
|
+
const mosaicId = MosaicServices.createMosaicId(nonce, address)
|
|
53
|
+
|
|
54
|
+
expect(mosaicId).toBeDefined()
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('Create Mosaic function', async () => {
|
|
58
|
+
const mosaic = MosaicServices.create(mosaicRawId, 1)
|
|
59
|
+
expect(mosaic).toBeDefined()
|
|
60
|
+
})
|
|
61
|
+
})
|
package/src/cli.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import account from './commands/account/account'
|
|
3
|
+
import voting from './commands/votingkey/votingkey'
|
|
4
|
+
import transaction from './commands/transaction/transaction'
|
|
5
|
+
;(async () => {
|
|
6
|
+
const program = new Command()
|
|
7
|
+
|
|
8
|
+
program
|
|
9
|
+
.name('mijin-catapult-tools')
|
|
10
|
+
.description('This tool allows you to easily operate mijin Catapult')
|
|
11
|
+
.version('0.0.1')
|
|
12
|
+
|
|
13
|
+
program.addCommand(account())
|
|
14
|
+
program.addCommand(voting())
|
|
15
|
+
program.addCommand(transaction())
|
|
16
|
+
|
|
17
|
+
await program.parseAsync(process.argv)
|
|
18
|
+
})()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import accountInfo from './accountInfo'
|
|
3
|
+
import accountGenerate from './accountGenerate'
|
|
4
|
+
|
|
5
|
+
const account = () => {
|
|
6
|
+
const program = new Command('account')
|
|
7
|
+
|
|
8
|
+
program.description('Account Info or Generate')
|
|
9
|
+
|
|
10
|
+
program.addCommand(accountInfo)
|
|
11
|
+
program.addCommand(accountGenerate)
|
|
12
|
+
|
|
13
|
+
return program
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default account
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import account from '../../infrastructure/account/accountGenerate'
|
|
3
|
+
const program = new Command()
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('generate')
|
|
7
|
+
.description('Generate Account')
|
|
8
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
9
|
+
.option('-n, --nodename <nodeName>', 'Specify the input of node Name for CA', 'node')
|
|
10
|
+
.option('-c, --certsdir <certDirectory>', 'Specify the input of Cert Directory(Output)')
|
|
11
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File')
|
|
12
|
+
.option('-w, --writefile <config.json>', 'Specify the input of Write Config File')
|
|
13
|
+
.option('-p, --privatekey <privateKey>', 'Specify the input of Balance Account Private Key')
|
|
14
|
+
.option('-a, --address <privateKey>', 'Specify the input of Address')
|
|
15
|
+
.option('-m, --message <message>', 'Specify the input of Transaction Message(Plain Only)')
|
|
16
|
+
.option('-s, --service', 'Specify the input Service Mode', false)
|
|
17
|
+
.action(account)
|
|
18
|
+
|
|
19
|
+
export default program
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import account from '../../infrastructure/account/accountInfo'
|
|
3
|
+
|
|
4
|
+
const program = new Command()
|
|
5
|
+
|
|
6
|
+
program
|
|
7
|
+
.name('info')
|
|
8
|
+
.description('Get Account Info')
|
|
9
|
+
.option('-t, --type <work|balance|vrf|voting|other>', 'Specify the type of Account', 'balance')
|
|
10
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
11
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File')
|
|
12
|
+
.option('-a, --address <privateKey>', 'Specify the input of Address')
|
|
13
|
+
.option('-s, --service', 'Specify the input Service Mode', false)
|
|
14
|
+
.action(account)
|
|
15
|
+
|
|
16
|
+
export default program
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import mosaicCreate from './mosaicCreate'
|
|
3
|
+
import mosaicInfo from './mosaicInfo'
|
|
4
|
+
|
|
5
|
+
const mosaic = () => {
|
|
6
|
+
const program = new Command('mosaic')
|
|
7
|
+
|
|
8
|
+
program.description('Mosaic Transaction Announce or Info')
|
|
9
|
+
|
|
10
|
+
program.addCommand(mosaicCreate)
|
|
11
|
+
program.addCommand(mosaicInfo)
|
|
12
|
+
|
|
13
|
+
return program
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default mosaic
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import mosaic from '../../infrastructure/mosaic/mosaicCreate'
|
|
3
|
+
const program = new Command()
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('create')
|
|
7
|
+
.description('Create Mosaic and Announce Mosaic Transaction')
|
|
8
|
+
.option('-o, --owner <work|balance|main|test1|test2|other>', 'Specify the input of from Account', 'other')
|
|
9
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
10
|
+
.option('-s, --supply <supply>', 'Specify the input of Mosaic Supply', '1')
|
|
11
|
+
.option('-d, --divisibility <divisibility>', 'Specify the input of Mosaic divisibility', '0')
|
|
12
|
+
.option('--supplymutable <supplymutable>', 'Specify the input of Mosaic Flags option supply Mutable', true)
|
|
13
|
+
.option('--transferable <transferable>', 'Specify the input of Mosaic Flags option Transferable', true)
|
|
14
|
+
.option('--restrictable <restrictable>', 'Specify the input of Mosaic Flags option Restrictable', true)
|
|
15
|
+
.option('--revokable <revokable>', 'Specify the input of Mosaic Flags option Revokable', false)
|
|
16
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File')
|
|
17
|
+
.option('-p, --privatekey <privateKey>', 'Specify the input of Mosaic Owener Account Private Key')
|
|
18
|
+
.action(mosaic)
|
|
19
|
+
|
|
20
|
+
export default program
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import mosaic from '../../infrastructure/mosaic/mosaicInfo'
|
|
3
|
+
const program = new Command()
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('info')
|
|
7
|
+
.description('Get Mosaic Info')
|
|
8
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
9
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File')
|
|
10
|
+
.option('-m, --mosaicrawId <mosaicrawId>', 'Specify the input of Mosaic Id')
|
|
11
|
+
.action(mosaic)
|
|
12
|
+
|
|
13
|
+
export default program
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import transfer from './transfer'
|
|
3
|
+
import status from './transactionStatus'
|
|
4
|
+
import mosaic from '../mosaic/mosaic'
|
|
5
|
+
|
|
6
|
+
const votingkey = () => {
|
|
7
|
+
const program = new Command('transaction')
|
|
8
|
+
|
|
9
|
+
program.description('Transaction Announce or Info')
|
|
10
|
+
|
|
11
|
+
program.addCommand(transfer)
|
|
12
|
+
program.addCommand(status)
|
|
13
|
+
program.addCommand(mosaic())
|
|
14
|
+
|
|
15
|
+
return program
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default votingkey
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import transactionStatus from '../../infrastructure/transaction/transactionStatus'
|
|
3
|
+
const program = new Command()
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('status')
|
|
7
|
+
.description('Get Transaction Status')
|
|
8
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
9
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File', 'config.json')
|
|
10
|
+
.option('-t, --transactionhash <transactionHash>', 'Specify the input of Transaction Hash')
|
|
11
|
+
.action(transactionStatus)
|
|
12
|
+
|
|
13
|
+
export default program
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import transfer from '../../infrastructure/transaction/transfer'
|
|
3
|
+
const program = new Command()
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('transfer')
|
|
7
|
+
.description('Announce Transfer Transaction')
|
|
8
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
9
|
+
.option('-f --from <work|balance|Privatekey>', 'Specify the input of from Account')
|
|
10
|
+
.option('-d --dest <work|balance|Address>', 'Specify the input of to Destination Address')
|
|
11
|
+
.option('-m --mosaic <mosaic>', 'Specify the input of Mosaic Id', 'cat.currency')
|
|
12
|
+
.option('-a --amount <amount>', 'Specify the input of transaction type', '0')
|
|
13
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File', 'config.json')
|
|
14
|
+
.action(transfer)
|
|
15
|
+
|
|
16
|
+
export default program
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import votingCreate from './votingkeyCreate'
|
|
3
|
+
import votingInfo from './votingkeyInfo'
|
|
4
|
+
import votingUpdate from './votingkeyUpdate'
|
|
5
|
+
|
|
6
|
+
const votingkey = () => {
|
|
7
|
+
const program = new Command('votingkey')
|
|
8
|
+
|
|
9
|
+
program.description('Votingkey Create or Info or Update')
|
|
10
|
+
|
|
11
|
+
program.addCommand(votingCreate)
|
|
12
|
+
program.addCommand(votingInfo)
|
|
13
|
+
program.addCommand(votingUpdate)
|
|
14
|
+
|
|
15
|
+
return program
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default votingkey
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import voting from '../../infrastructure/voting/votingCreate'
|
|
3
|
+
const program = new Command()
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('create')
|
|
7
|
+
.description('Create Votingkey')
|
|
8
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
9
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File')
|
|
10
|
+
.option('-s, --startepoch <72>', 'Specify the input of Voting Start Epoch', '72')
|
|
11
|
+
.option('-e, --endepoch <1>', 'Specify the input of Voting Stop Epoch', '26280')
|
|
12
|
+
.option('-d, --savedir <dir>', 'Specify the input of Save Voting Key Directory', 'current')
|
|
13
|
+
.action(voting)
|
|
14
|
+
|
|
15
|
+
export default program
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import voting from '../../infrastructure/voting/votingInfo'
|
|
3
|
+
const program = new Command()
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('info')
|
|
7
|
+
.description('Get Votingkey')
|
|
8
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
9
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File')
|
|
10
|
+
.option('-d, --savedir <dir>', 'Specify the input of Save Voting Key Directory', 'current')
|
|
11
|
+
.action(voting)
|
|
12
|
+
|
|
13
|
+
export default program
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from 'commander'
|
|
2
|
+
import voting from '../../infrastructure/voting/votingUpdate'
|
|
3
|
+
const program = new Command()
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('update')
|
|
7
|
+
.description('Update Votingkey')
|
|
8
|
+
.option('-u, --url <mijinCatapultURL>', 'Specify the input of mijin URL')
|
|
9
|
+
.option('-r, --readfile <config.json>', 'Specify the input of Read Config File')
|
|
10
|
+
.option('-s, --startepoch <72>', 'Specify the input of Voting Start Epoch', '72')
|
|
11
|
+
.option('-e, --endepoch <1>', 'Specify the input of Voting Stop Epoch', '26280')
|
|
12
|
+
.option('-d, --savedir <dir>', 'Specify the input of Save Voting Key Directory', 'current')
|
|
13
|
+
.action(voting)
|
|
14
|
+
|
|
15
|
+
export default program
|