sdk-connect-js
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "sdk-connect-js", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "SDK Connect for VChain", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# SDK Connect | ||
- [SDK Connect](#sdk-connect) | ||
- [Install package](#install-package) | ||
- [Usage](#usage) | ||
- [Import pkg](#import-pkg) | ||
- [Connect](#connect) | ||
- [Sign Transaction](#sign-transaction) | ||
## Install package | ||
``` | ||
npm install @v-chain/sdk-connect-js | ||
npm install sdk-connect-js | ||
``` | ||
@@ -11,4 +18,44 @@ | ||
### Import pkg | ||
```js | ||
import SDK from "sdk-connect-js"; | ||
``` | ||
### Connect | ||
```js | ||
const sdk = new SDK(SDK_ENDPOINT); | ||
// dApp: create connection | ||
var connectionId = await sdk.createConnection(); | ||
var embeddedLink = await sdk.getConnectionEmbeddedLink(connectionId); | ||
var qrCodeLink = await sdk.getConnectionQrCodeLink(connectionId); | ||
// Wallet: update connection address | ||
var connection = await sdk.submitConnectionAddress( | ||
connectionId, | ||
"0x52ec083d30192691872b60334bfdd1450c1826d9" | ||
); | ||
// dApp: get connection address | ||
var connectionAddress = await sdk.getConnectionAddress(connectionId); | ||
``` | ||
### Sign Transaction | ||
```js | ||
const sdk = new SDK(SDK_ENDPOINT); | ||
// dApp: create Tx | ||
const txUuid = await sdk.submitTx(/* RawTx */); | ||
const embeddedLink = await sdk.getEmbeddedLink(txUuid); | ||
const qrCodeLink = await sdk.getQrCodeLink(txUuid); | ||
// Wallet: sign Tx | ||
const rawTx = await sdk.getRawTx(txUuid); | ||
await sdk.submitSignedTx(txUuid, "0x123456789abcdef"); | ||
// dApp: continue process signed Tx | ||
const signedTx = await sdk.getSignedTx(txUuid); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17438
61