def _add_transfer_parser(subparsers):
     parser = subparsers.add_parser('transfer', help='Transfer ICX coin.', description='Transfer ICX coin.')
     parser.add_argument('-f', '--from', type=IconAddress(), help='From address.')
     parser.add_argument('to', type=IconAddress(), help='Recipient')
     parser.add_argument("value", type=loop, help='Amount of ICX coin in loop to transfer (1 icx = 1e18 loop)')
     parser.add_argument('-k', '--key-store', type=IconPath(), dest='keyStore',
                         help='Keystore file path. Used to generate "from" address and transaction signature')
     parser.add_argument('-n', '--nid', help='Network ID (default: 0x3)')
     parser.add_argument('-u', '--node-uri', dest='uri', help='URI of node (default: http://127.0.0.1:9000/api/v3)')
     parser.add_argument('-p', '--password', help='Keystore file\'s password', dest='password')
     parser.add_argument('-s', '--step-limit', dest='stepLimit', type=non_negative_num_type, help='Step limit')
     parser.add_argument('-c', '--config', type=IconPath(),
                         help=f'Configuration file path. This file defines the default values for '
                              f'"keyStore", "uri", "from" and "stepLimit". (default: {FN_CLI_CONF})')
示例#2
0
 def _add_deploy_parser(subparsers):
     parser = subparsers.add_parser('deploy',
                                    help='Deploy the SCORE',
                                    description='Deploy the SCORE')
     # IconPath's 'd' argument means directory
     parser.add_argument('project', type=IconPath('d'), help='Project name')
     parser.add_argument(
         '-u',
         '--node-uri',
         dest='uri',
         help='URI of node (default: http://127.0.0.1:9000/api/v3)')
     parser.add_argument('-t',
                         '--type',
                         choices=['tbears', 'zip'],
                         dest='contentType',
                         help='Deploy SCORE type (default: tbears)')
     parser.add_argument('-m',
                         '--mode',
                         choices=['install', 'update'],
                         help='Deploy mode (default: install)')
     # --from option only accept eoa address('hx')
     parser.add_argument('-f',
                         '--from',
                         type=IconAddress('hx'),
                         help='From address. i.e. SCORE owner address')
     # --to option is used only when update score, so eoa address('hx') need to be denied
     parser.add_argument('-o',
                         '--to',
                         type=IconAddress('cx'),
                         help='To address. i.e. SCORE address')
     # IconPath's 'r' argument means 'read file'
     parser.add_argument(
         '-k',
         '--key-store',
         type=IconPath('r'),
         dest='keyStore',
         help=
         'Keystore file path. Used to generate "from" address and transaction signature'
     )
     parser.add_argument('-n', '--nid', help='Network ID')
     parser.add_argument(
         '-c',
         '--config',
         type=IconPath(),
         help=f'deploy config path (default: {FN_CLI_CONF})')
     parser.add_argument('-p',
                         '--password',
                         help='keystore file\'s password',
                         dest='password')
 def _add_scoreapi_parser(subparsers):
     parser = subparsers.add_parser('scoreapi', help='Get SCORE\'s API using given SCORE address',
                                    description='Get SCORE\'s API using given SCORE address')
     parser.add_argument('address', type=IconAddress('cx'), help='SCORE address to query the API')
     parser.add_argument('-u', '--node-uri', dest='uri', help='URI of node (default: http://127.0.0.1:9000/api/v3)')
     parser.add_argument('-c', '--config', type=IconPath,
                         help=f'Configuration file path. This file defines the default value for '
                              f'"uri" (default: {FN_CLI_CONF})')
 def _add_balance_parser(subparsers):
     parser = subparsers.add_parser('balance',
                                    help='Get balance of given address in loop unit',
                                    description='Get balance of given address in loop unit')
     parser.add_argument('address', type=IconAddress(), help='Address to query the ICX balance')
     parser.add_argument('-u', '--node-uri', dest='uri', help='URI of node (default: http://127.0.0.1:9000/api/v3)')
     parser.add_argument('-c', '--config', type=IconPath(),
                         help=f'Configuration file path. This file defines the default value for '
                              f'"uri" (default: {FN_CLI_CONF})')