@offckb/cli 0.3.0-canary-0ceb8cb.0 → 0.3.0-canary-0e33d0a.0

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/README.md CHANGED
@@ -363,7 +363,7 @@ detail informations about each account are recorded in the `account/account.json
363
363
 
364
364
  ## About CCC
365
365
 
366
- `offckb` uses [CCC](https://github.com/ckb-ecofund/ccc) as the development framework to build the CKB dApp template projects.
366
+ `offckb` uses [CCC](https://github.com/ckb-devrel/ccc) as the development framework to build the CKB dApp template projects.
367
367
 
368
368
  ## FAQ
369
369
 
@@ -72,7 +72,7 @@ exports.defaultSettings = {
72
72
  contractsPath: path.resolve(exports.dataPath, 'mainnet/contracts'),
73
73
  },
74
74
  dappTemplate: {
75
- gitRepoUrl: `https://github.com/ckb-ecofund/offckb`,
75
+ gitRepoUrl: `https://github.com/ckb-devrel/offckb`,
76
76
  gitBranch: 'v0.3.x',
77
77
  gitFolder: 'templates/v3',
78
78
  downloadPath: path.resolve(exports.cachePath, 'download', 'dapp-template'),
package/dist/cli.js CHANGED
@@ -101,6 +101,7 @@ program
101
101
  .command('deposit [toAddress] [amountInCKB]')
102
102
  .description('Deposit CKB tokens to address, only devnet and testnet')
103
103
  .option('--network <network>', 'Specify the network to deposit to', 'devnet')
104
+ .option('-r, --proxy-rpc', 'Use Proxy RPC to connect to blockchain')
104
105
  .action((toAddress, amountInCKB, options) => __awaiter(void 0, void 0, void 0, function* () {
105
106
  return (0, deposit_1.deposit)(toAddress, amountInCKB, options);
106
107
  }));
@@ -108,7 +109,8 @@ program
108
109
  .command('transfer [toAddress] [amountInCKB]')
109
110
  .description('Transfer CKB tokens to address, only devnet and testnet')
110
111
  .option('--network <network>', 'Specify the network to transfer to', 'devnet')
111
- .option('--privkey <privkey>', 'Specify the private key to deploy scripts')
112
+ .option('--privkey <privkey>', 'Specify the private key to transfer CKB')
113
+ .option('-r, --proxy-rpc', 'Use Proxy RPC to connect to blockchain')
112
114
  .action((toAddress, amountInCKB, options) => __awaiter(void 0, void 0, void 0, function* () {
113
115
  return (0, transfer_1.transfer)(toAddress, amountInCKB, options);
114
116
  }));
@@ -117,6 +119,7 @@ program
117
119
  .description('Transfer All CKB tokens to address, only devnet and testnet')
118
120
  .option('--network <network>', 'Specify the network to transfer to', 'devnet')
119
121
  .option('--privkey <privkey>', 'Specify the private key to deploy scripts')
122
+ .option('-r, --proxy-rpc', 'Use Proxy RPC to connect to blockchain')
120
123
  .action((toAddress, options) => __awaiter(void 0, void 0, void 0, function* () {
121
124
  return (0, transfer_all_1.transferAll)(toAddress, options);
122
125
  }));
@@ -134,6 +137,7 @@ program
134
137
  .option('--target <target>', 'Specify the relative bin target folder to deploy to')
135
138
  .option('-t, --type-id', 'Specify if use upgradable type id to deploy the script')
136
139
  .option('--privkey <privkey>', 'Specify the private key to deploy scripts')
140
+ .option('-r, --proxy-rpc', 'Use Proxy RPC to connect to blockchain')
137
141
  .action((options) => (0, deploy_1.deploy)(options));
138
142
  program
139
143
  .command('my-scripts')
@@ -3,5 +3,6 @@ export interface DeployOptions extends NetworkOption {
3
3
  target: string | null | undefined;
4
4
  privkey?: string | null;
5
5
  typeId?: boolean;
6
+ proxyRpc?: boolean;
6
7
  }
7
8
  export declare function deploy(opt?: DeployOptions): Promise<void>;
@@ -20,12 +20,13 @@ const fs_1 = require("../util/fs");
20
20
  const validator_1 = require("../util/validator");
21
21
  const deploy_1 = require("../deploy");
22
22
  const ckb_1 = require("../sdk/ckb");
23
- function deploy(opt = { network: base_1.Network.devnet, typeId: false, target: null }) {
23
+ function deploy(opt = { network: base_1.Network.devnet, typeId: false, target: null, proxyRpc: false }) {
24
24
  var _a;
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
26
  const network = opt.network;
27
27
  (0, validator_1.validateNetworkOpt)(network);
28
- const ckb = new ckb_1.CKB({ network });
28
+ const isEnableProxyRpc = opt.proxyRpc;
29
+ const ckb = new ckb_1.CKB({ network, isEnableProxyRpc });
29
30
  // we use deployerAccount to deploy contract by default
30
31
  const privateKey = opt.privkey || account_1.deployerAccount.privkey;
31
32
  const enableTypeId = (_a = opt.typeId) !== null && _a !== void 0 ? _a : false;
@@ -1,4 +1,5 @@
1
1
  import { NetworkOption } from '../type/base';
2
2
  export interface DepositOptions extends NetworkOption {
3
+ proxyRpc?: boolean;
3
4
  }
4
5
  export declare function deposit(toAddress: string, amountInCKB: string, opt?: DepositOptions): Promise<void>;
@@ -16,11 +16,12 @@ const base_1 = require("../type/base");
16
16
  const link_1 = require("../util/link");
17
17
  const validator_1 = require("../util/validator");
18
18
  const request_1 = require("../util/request");
19
- function deposit(toAddress, amountInCKB, opt = { network: base_1.Network.devnet }) {
19
+ function deposit(toAddress, amountInCKB, opt = { network: base_1.Network.devnet, proxyRpc: false }) {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
21
  const network = opt.network;
22
22
  (0, validator_1.validateNetworkOpt)(network);
23
- const ckb = new ckb_1.CKB({ network });
23
+ const isEnableProxyRpc = opt.proxyRpc;
24
+ const ckb = new ckb_1.CKB({ network, isEnableProxyRpc });
24
25
  if (network === 'testnet') {
25
26
  return yield depositFromTestnetFaucet(toAddress, ckb);
26
27
  }
@@ -1,5 +1,6 @@
1
1
  import { NetworkOption } from '../type/base';
2
2
  export interface TransferAllOptions extends NetworkOption {
3
3
  privkey?: string | null;
4
+ proxyRpc?: boolean;
4
5
  }
5
6
  export declare function transferAll(toAddress: string, opt?: TransferAllOptions): Promise<void>;
@@ -14,15 +14,16 @@ const ckb_1 = require("../sdk/ckb");
14
14
  const base_1 = require("../type/base");
15
15
  const link_1 = require("../util/link");
16
16
  const validator_1 = require("../util/validator");
17
- function transferAll(toAddress, opt = { network: base_1.Network.devnet }) {
17
+ function transferAll(toAddress, opt = { network: base_1.Network.devnet, proxyRpc: false }) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  const network = opt.network;
20
20
  (0, validator_1.validateNetworkOpt)(network);
21
21
  if (opt.privkey == null) {
22
22
  throw new Error('--privkey is required!');
23
23
  }
24
+ const isEnableProxyRpc = opt.proxyRpc;
24
25
  const privateKey = opt.privkey;
25
- const ckb = new ckb_1.CKB({ network });
26
+ const ckb = new ckb_1.CKB({ network, isEnableProxyRpc });
26
27
  const txHash = yield ckb.transferAll({
27
28
  toAddress,
28
29
  privateKey,
@@ -1,5 +1,6 @@
1
1
  import { NetworkOption } from '../type/base';
2
2
  export interface TransferOptions extends NetworkOption {
3
3
  privkey?: string | null;
4
+ proxyRpc?: boolean;
4
5
  }
5
6
  export declare function transfer(toAddress: string, amountInCKB: string, opt?: TransferOptions): Promise<void>;
@@ -14,15 +14,16 @@ const ckb_1 = require("../sdk/ckb");
14
14
  const base_1 = require("../type/base");
15
15
  const link_1 = require("../util/link");
16
16
  const validator_1 = require("../util/validator");
17
- function transfer(toAddress, amountInCKB, opt = { network: base_1.Network.devnet }) {
17
+ function transfer(toAddress, amountInCKB, opt = { network: base_1.Network.devnet, proxyRpc: false }) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  const network = opt.network;
20
20
  (0, validator_1.validateNetworkOpt)(network);
21
21
  if (opt.privkey == null) {
22
22
  throw new Error('--privkey is required!');
23
23
  }
24
+ const isEnableProxyRpc = opt.proxyRpc;
24
25
  const privateKey = opt.privkey;
25
- const ckb = new ckb_1.CKB({ network });
26
+ const ckb = new ckb_1.CKB({ network, isEnableProxyRpc });
26
27
  const txHash = yield ckb.transfer({
27
28
  toAddress,
28
29
  amountInCKB,
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@offckb/cli",
3
- "version": "0.3.0-canary-0ceb8cb.0",
3
+ "version": "0.3.0-canary-0e33d0a.0",
4
4
  "description": "ckb development network for your first try",
5
5
  "author": "CKB EcoFund",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/ckb-ecofund/offckb.git"
9
+ "url": "git+https://github.com/ckb-devrel/offckb.git"
10
10
  },
11
11
  "main": "dist/cli.js",
12
12
  "bin": {