Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@cvbb/sdk

Package Overview
Dependencies
37
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.8 to 1.0.1

dist/components/BaseQRCode.d.ts

7

dist/index.d.ts

@@ -1,2 +0,5 @@

export { CoboVaultSDK } from './base';
export { CVXRPSdk } from './xrp';
declare const _default: {
read: import("./types").Read;
play: import("./types").Play;
};
export default _default;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CVXRPSdk = exports.CoboVaultSDK = void 0;
var base_1 = require("./base");
Object.defineProperty(exports, "CoboVaultSDK", { enumerable: true, get: function () { return base_1.CoboVaultSDK; } });
var xrp_1 = require("./xrp");
Object.defineProperty(exports, "CVXRPSdk", { enumerable: true, get: function () { return xrp_1.CVXRPSdk; } });
const service_1 = __importDefault(require("./service"));
service_1.default.bootstrap();
exports.default = service_1.default.makeService();
//# sourceMappingURL=index.js.map
{
"name": "@cvbb/sdk",
"version": "0.1.8",
"version": "1.0.1",
"description": "Cobo Vault SDK",

@@ -9,3 +9,3 @@ "author": "aaronisme <aarondongchen@gmail.com>",

"main": "dist/index.js",
"types": "src/index.ts",
"types": "dist/index.d.ts",
"directories": {

@@ -16,3 +16,2 @@ "lib": "lib",

"files": [
"lib",
"dist"

@@ -27,3 +26,3 @@ ],

"build": "npm run clean && npx tsc -p tsconfig.json -outDir ./dist",
"test": "jest"
"build:watch": "npm run clean && npx tsc -w -p tsconfig.json -outDir ./dist"
},

@@ -34,3 +33,13 @@ "bugs": {

"dependencies": {
"@cvbb/bc-ur": "^0.2.9"
"@cvbb/bc-ur": "^0.2.10",
"@types/qrcode.react": "^1.0.1",
"@types/react-dom": "^17.0.1",
"@types/react-modal": "^3.12.0",
"@types/react-qr-reader": "^2.1.3",
"qrcode.react": "^1.0.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-modal": "^3.12.1",
"react-qr-reader": "^2.2.1",
"rxjs": "^6.6.3"
},

@@ -40,3 +49,3 @@ "publishConfig": {

},
"gitHead": "476105b5dbc398efd1ca0bc7b672560f39a90b3a"
"gitHead": "5afcf90b2b47d23aecfa56c73f6a0054da4cc8df"
}

@@ -7,19 +7,23 @@ # `@cvbb/sdk`

currently we use UR to encode data. check this for detail info about [UR](https://github.com/CoboVault/Research/blob/master/papers/bcr-0005-ur.md)
currently we use UR to encode data. check this for detail info about [UR](https://github.com/CoboVault/Research/blob/master/papers/bcr-0005-ur.md)
this library is designed by chain
## Usage
## Usage
this is an example for XRP
```
const {CVXRPSdk} = require('@cvbb/sdk');
import sdk from '@cvbb/sdk';
const read = async () => {
const result = await sdk.read();
}
const sdk = new CVXRPSdk()
const play = async () => {
await sdk.play("any data string");
}
const txdata= '{"TransactionType":"Payment","Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn","Destination":"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX","Amount":{"currency":"USD","value":"1","issuer":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"},"Fee":"12","Flags":2147483648,"Sequence":2}'
```
const dataFragmets = sdk.encodeDataForQR(txData)
// [ 'ur:bytes/tyqsq7ez23exzmnnv93hg6t0de28jur9ygazy5rp09kk2mn5ygkzystrvdhh2mn5ygazyunxx9pxj3m9tpmhw5t0dyu95vn4v4r9j4z9tpfhwa22t9n9vvj2wphzytpzg3jhxarfdeshg6t0dc3r5gnjvy6kujejx394setw89q5sannv3r9gj6g2dq5u6twtfek24mw2p34sg3vyfqk6mm4de6zywnmyf3h2unjv4hxx7fz8g39256yygkzyanpd36k2g36ygcjytpzd9ehxat9wg3r5gnjvcc5y628v4v8wa63da5nsk3jw4j5vk25g4v9xam4ffvkv43jffcxugna9s3yvet9ygazyvfjygkzy3nvv9nhxg36xgcngde58qenvdpc9s39xet3w4jkucm9ygarylgjvkpch' ]
// each item in the list should be put into one QRCode image.
## API
```
| Name | Parameters | result | Description |
| ---- | ----------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| read | | Promise<{type: 'text' &#124; 'json' &#124; 'ur', data: string} &#124; null> | Open a modal and read qrcode with camera, will return null when click Close button |
| play | data: string, options?: {refreshSpeed?: number} | Promise<void> | Open a modal and display a dynamic qrcode, will resolve when click Finish button |

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc