@offckb/cli 0.3.0-canary-0ceb8cb.0 → 0.3.0-canary-ca3bc27.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/dist/cli.js +5 -1
- package/dist/cmd/deploy.d.ts +1 -0
- package/dist/cmd/deploy.js +3 -2
- package/dist/cmd/deposit.d.ts +1 -0
- package/dist/cmd/deposit.js +3 -2
- package/dist/cmd/transfer-all.d.ts +1 -0
- package/dist/cmd/transfer-all.js +3 -2
- package/dist/cmd/transfer.d.ts +1 -0
- package/dist/cmd/transfer.js +3 -2
- package/package.json +1 -1
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
|
|
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')
|
package/dist/cmd/deploy.d.ts
CHANGED
package/dist/cmd/deploy.js
CHANGED
|
@@ -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
|
|
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;
|
package/dist/cmd/deposit.d.ts
CHANGED
package/dist/cmd/deposit.js
CHANGED
|
@@ -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
|
|
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
|
}
|
package/dist/cmd/transfer-all.js
CHANGED
|
@@ -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,
|
package/dist/cmd/transfer.d.ts
CHANGED
|
@@ -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>;
|
package/dist/cmd/transfer.js
CHANGED
|
@@ -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,
|