Skip to content

Commit

Permalink
Merge pull request #33 from CaiXiao-cobo/main
Browse files Browse the repository at this point in the history
update version readme and changelog
  • Loading branch information
CoboZhu authored Oct 27, 2023
2 parents d2bf385 + 94f2a78 commit 2749406
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 24 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [v0.38.0] (2023-10-26)
[v0.38.0]: https://github.com/CoboGlobal/cobo-js-api/compare/v0.37.0...v0.38.0
### Added
- Add New API: MPC Wallet add Update Address Description API.https://github.com/CoboGlobal/cobo-js-api/pull/34
### Changed
- Add New Params: Custodial Wallet New Withdraw Request and MPC Wallet Create Transaction API add remark param. https://github.com/CoboGlobal/cobo-js-api/pull/32

## [v0.37.0] (2023-07-27)
[v0.37.0]: https://github.com/CoboGlobal/cobo-js-api/compare/v0.36.0...v0.37.0
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ add dependency in `package.json`
```
"dependencies": {
...
"cobo-custody": "https://github.com/CoboGlobal/cobo-js-api/releases/download/v0.37.0/release.tgz"
"cobo-custody": "https://github.com/CoboGlobal/cobo-js-api/releases/download/v0.38.0/release.tgz"
}
```

Expand Down Expand Up @@ -82,8 +82,8 @@ Please refer to the [link](https://doc.custody.cobo.com/en.html#api-authenticati
```js
const { Client } = require('cobo-custody');
const { LocalSigner } = require('cobo-custody');
const {DEVELOP,PROD} = require('cobo-custody');
const client = new Client(API_SIGNER, DEVELOP, true)
const {DEV,PROD} = require('cobo-custody');
const client = new Client(API_SIGNER, DEV, true)
```


Expand Down
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {LocalSigner} from "./src/LocalSigner";
import {Web3Client} from "./src/Web3Client";
import {MPCClient} from "./src/MPCClient";

import {PROD, DEVELOP} from "./src/Env";
import {PROD, DEV} from "./src/Env";
import { ApiResponse } from "./src/Base";

export {PROD, DEVELOP}
export {PROD, DEV}

export {Client, LocalSigner, Web3Client, MPCClient};
export {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cobo-custody",
"version": "0.32.0",
"version": "0.38.0",
"description": "",
"main": "out/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Client {
/***
*
* @param signer api signer
* @param env DEVELOP or PROD
* @param env DEV or PROD
* @param debug
*/
constructor(signer: Signer, env: Env, debug: boolean = false) {
Expand Down
2 changes: 1 addition & 1 deletion src/Env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export class Env {
}
}

export const DEVELOP = new Env("https://api.dev.cobo.com", "03596da539963fb1dd29d5859e25903eb76b9f7ed2d58516e29c9f80c201ff2c1b");
export const DEV = new Env("https://api.dev.cobo.com", "03596da539963fb1dd29d5859e25903eb76b9f7ed2d58516e29c9f80c201ff2c1b");
export const PROD = new Env("https://api.custody.cobo.com", "02c3e5bacf436fbf4da78597e791579f022a2e85073ae36c54a361ff97f2811376");
2 changes: 1 addition & 1 deletion src/MPCClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class MPCClient {
/***
*
* @param signer api signer
* @param env DEVELOP or PROD
* @param env DEV or PROD
* @param debug
*/
constructor(signer: Signer, env: Env, debug: boolean = false) {
Expand Down
2 changes: 1 addition & 1 deletion src/Web3Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Web3Client {
/***
*
* @param signer api signer
* @param env DEVELOP or PROD
* @param env DEV or PROD
* @param debug
*/
constructor(signer: Signer, env: Env, debug: boolean = false) {
Expand Down
12 changes: 6 additions & 6 deletions test/Client.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import {Client, LocalSigner} from "..";
import {DEVELOP} from "./config";
import {DEV} from "./config";
import {PROD} from "./config";
import {DEVELOP_TEST_DATA} from "./config";
import {DEV_TEST_DATA} from "./config";
import {PROD_TEST_DATA} from "./config";

var apiSecret:string = 'apiSecret';
var clientEnv:any = DEVELOP;
var testData:any = DEVELOP_TEST_DATA
var clientEnv:any = DEV;
var testData:any = DEV_TEST_DATA

if(process.argv.length > 3){
const paramEnv = process.argv.filter((x) => x.startsWith('-env='))[0].split('=')[1];
const env = paramEnv ? paramEnv : 'develop';
clientEnv = env==='prod' ? PROD: DEVELOP;
clientEnv = env==='prod' ? PROD: DEV;
const paramApiSecret = process.argv.filter((x) => x.startsWith('-secretKey='))[0].split('=')[1]
apiSecret = paramApiSecret ? paramApiSecret: 'apiSecret'
testData = env==='prod' ? PROD_TEST_DATA: DEVELOP_TEST_DATA;
testData = env==='prod' ? PROD_TEST_DATA: DEV_TEST_DATA;
}

jest.setTimeout(10000);
Expand Down
6 changes: 3 additions & 3 deletions test/MPCClient.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {LocalSigner} from "../src/LocalSigner";
import {MPCClient} from "../src/MPCClient";
import {DEVELOP} from "./config";
import {DEV} from "./config";
import {PROD} from "./config";

var mpcApiSecret:string = 'apiSecret';
var clientEnv:any = DEVELOP;
var clientEnv:any = DEV;

if(process.argv.length > 3){
const paramEnv = process.argv.filter((x) => x.startsWith('-env='))[0].split('=')[1];
const env = paramEnv ? paramEnv : 'develop';
clientEnv = env==='prod' ? PROD: DEVELOP;
clientEnv = env==='prod' ? PROD: DEV;
const paramApiSecret = process.argv.filter((x) => x.startsWith('-mpcSecretKey='))[0].split('=')[1]
mpcApiSecret = paramApiSecret ? paramApiSecret: 'mpcApiSecret'
}
Expand Down
6 changes: 3 additions & 3 deletions test/Web3Client.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {LocalSigner} from "../src/LocalSigner";
import {Web3Client} from "../src/Web3Client";
import {DEVELOP} from "./config";
import {DEV} from "./config";
import {PROD} from "./config";

var web3ApiSecret:string = 'apiSecret';
var clientEnv:any = DEVELOP;
var clientEnv:any = DEV;

if(process.argv.length > 3){
const paramEnv = process.argv.filter((x) => x.startsWith('-env='))[0].split('=')[1];
const env = paramEnv ? paramEnv : 'develop';
clientEnv = env==='prod' ? PROD: DEVELOP;
clientEnv = env==='prod' ? PROD: DEV;
const paramApiSecret = process.argv.filter((x) => x.startsWith('-web3SecretKey='))[0].split('=')[1]
web3ApiSecret = paramApiSecret ? paramApiSecret: web3ApiSecret
}
Expand Down
4 changes: 2 additions & 2 deletions test/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {Env} from "../src/Env";

export const PROD = new Env("https://api.custody.cobo.com", "02c3e5bacf436fbf4da78597e791579f022a2e85073ae36c54a361ff97f2811376");
export const DEVELOP = new Env("https://api.dev.cobo.com", "03596da539963fb1dd29d5859e25903eb76b9f7ed2d58516e29c9f80c201ff2c1b");
export const DEV = new Env("https://api.dev.cobo.com", "03596da539963fb1dd29d5859e25903eb76b9f7ed2d58516e29c9f80c201ff2c1b");

export const DEVELOP_TEST_DATA : { [key: string]: any } = {
export const DEV_TEST_DATA : { [key: string]: any } = {
"cobo_id":"20220314181458000331767000003732",
"tx_id":"0x1c4d137bc2a2ee8f22cbdf9e90405974e72e65d922f42eb81d9f7a05d0f64fc6",
"withdraw_id":"web_send_by_user_915_1647252768642",
Expand Down

0 comments on commit 2749406

Please sign in to comment.