@tezos-x/octez.connect-sdk 4.8.3 → 4.8.4

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
@@ -1,80 +1,23 @@
1
- # octez.connect SDK
1
+ # `@tezos-x/octez.connect-sdk`
2
2
 
3
- [![npm](https://img.shields.io/npm/v/@tezos-x/octez.connect-sdk.svg?colorB=brightgreen)](https://www.npmjs.com/package/@tezos-x/octez.connect-sdk)
4
- [![documentation](https://img.shields.io/badge/documentation-online-brightgreen.svg)](https://trilitech.github.io/octez.connect-sdk/)
5
- [![GitHub Action](https://github.com/trilitech/octez.connect/workflows/Build%2C%20Test%20and%20Analyze/badge.svg)](https://github.com/trilitech/octez.connect/actions?query=workflow%3A%22Build%2C+Test+and+Analyze%22+branch%3Amain)
6
- [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
3
+ octez.connect SDK umbrella package for Tezos dApp and wallet communication across supported transports.
7
4
 
8
- ## Intro
5
+ This is a primary package in the Trilitech-maintained octez.connect SDK line and may be installed directly.
9
6
 
10
- The `octez.connect-sdk` simplifies and abstracts the communication between dApps and wallets over different transport layers.
7
+ ## Install
11
8
 
12
- Developers that plan to develop complex smart contract interactions can use [Taquito](https://github.com/ecadlabs/taquito) with the `BeaconWallet`, which uses this SDK under the hood, but provides helpful methods to interact with contracts.
13
-
14
-
15
- ## Installation
16
-
17
- ```
18
- npm i --save @tezos-x/octez.connect-sdk
19
- ```
20
-
21
- ## Example DApp integration
22
-
23
- ```ts
24
- const client = new DAppClient({ name: 'My Sample DApp' })
25
-
26
- client
27
- .requestPermissions() // Send a permission request and automatically show UI to the user to select his favorite wallet
28
- .then((permissions) => {
29
- // Account that has been shared by the wallet
30
- console.log('got permissions', permissions)
31
- })
32
- .catch((error) => console.log(error))
33
- ```
34
-
35
- For a more complete example, take a look at the `example-dapp.html` file.
36
-
37
- ## Example Wallet integration
38
-
39
- ```ts
40
- const client = new WalletClient({ name: 'My Wallet' })
41
- await client.init() // Establish P2P connection
42
-
43
- client
44
- .connect(async (message) => {
45
- // Example: Handle PermissionRequest. A wallet should handle all request types
46
- if (message.type === BeaconMessageType.PermissionRequest) {
47
- // Show a UI to the user where he can confirm sharing an account with the DApp
48
-
49
- const response: PermissionResponseInput = {
50
- type: BeaconMessageType.PermissionResponse,
51
- network: message.network, // Use the same network that the user requested
52
- scopes: [PermissionScope.OPERATION_REQUEST], // Ignore the scopes that have been requested and instead give only operation permissions
53
- id: message.id,
54
- publicKey: 'tezos public key'
55
- }
56
-
57
- // Send response back to DApp
58
- await client.respond(response)
59
- }
60
- })
61
- .catch((error) => console.error('connect error', error))
9
+ ```sh
10
+ npm install @tezos-x/octez.connect-sdk
62
11
  ```
12
+ ## Package provenance
63
13
 
64
- For a more complete example, take a look at the `example-wallet.html` file.
14
+ This package is published from the Trilitech-maintained octez.connect repository:
15
+ [trilitech/octez.connect](https://github.com/trilitech/octez.connect)
65
16
 
66
- ## Adding a wallet to octez.connect-sdk
17
+ - Original Beacon lineage: [airgap-it/beacon-sdk](https://github.com/airgap-it/beacon-sdk)
18
+ - External maintenance line Trilitech may selectively import from: [ecadlabs/beacon-sdk-taquito-patches](https://github.com/ecadlabs/beacon-sdk-taquito-patches)
67
19
 
68
- Please create a PR and add your wallet [here](https://github.com/trilitech/octez.connect/blob/master/scripts/generate-wallet-list.ts).
69
-
70
- For iOS wallets, the wallet needs to define a custom url scheme to support the same-device functionality.
71
-
72
- ## Development
73
-
74
- ```
75
- $ npm i
76
- $ npm run build
77
- $ npm run test
78
- ```
20
+ ## Notes
79
21
 
80
- Once the SDK is built, you can open the `example-dapp.html` file in your browser and try out the basic functionality. To support browser extensions as well, the file should be viewed over a webserver. You can easily start one with `python -m SimpleHTTPServer 8000` and then open the file with `http://localhost:8000/example-dapp.html`.
22
+ - Trilitech publishes these packages under the `@tezos-x/octez.connect-*` scope
23
+ - Release notes, package policy, and the current package list live in the repository README
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8EAA2D;AAC3D,0EAAuD;AACvD,8DAA2C;AAC3C,8DAA2C;AAC3C,0EAAuD;AACvD,+EAA4D;AAC5D,iFAA8D;AAC9D,+DAA4C;AAC5C,4CAA4C;AAC5C,+DAA4C;AAC5C,gEAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8EAA2D;AAC3D,0EAAuD;AACvD,8DAA2C;AAC3C,8DAA2C;AAC3C,0EAAuD;AACvD,+EAA4D;AAC5D,iFAA8D;AAC9D,+DAA4C;AAC5C,4CAA4C;AAC5C,+DAA4C;AAC5C,gEAA6C","sourcesContent":["export * from '@tezos-x/octez.connect-blockchain-substrate'\nexport * from '@tezos-x/octez.connect-blockchain-tezos'\nexport * from '@tezos-x/octez.connect-core'\nexport * from '@tezos-x/octez.connect-dapp'\nexport * from '@tezos-x/octez.connect-transport-matrix'\nexport * from '@tezos-x/octez.connect-transport-postmessage'\nexport * from '@tezos-x/octez.connect-transport-walletconnect'\nexport * from '@tezos-x/octez.connect-types'\n// export * from '@tezos-x/octez.connect-ui'\nexport * from '@tezos-x/octez.connect-utils'\nexport * from '@tezos-x/octez.connect-wallet'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAA;AAC3D,cAAc,yCAAyC,CAAA;AACvD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yCAAyC,CAAA;AACvD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,gDAAgD,CAAA;AAC9D,cAAc,8BAA8B,CAAA;AAC5C,4CAA4C;AAC5C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAA;AAC3D,cAAc,yCAAyC,CAAA;AACvD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yCAAyC,CAAA;AACvD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,gDAAgD,CAAA;AAC9D,cAAc,8BAA8B,CAAA;AAC5C,4CAA4C;AAC5C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA","sourcesContent":["export * from '@tezos-x/octez.connect-blockchain-substrate'\nexport * from '@tezos-x/octez.connect-blockchain-tezos'\nexport * from '@tezos-x/octez.connect-core'\nexport * from '@tezos-x/octez.connect-dapp'\nexport * from '@tezos-x/octez.connect-transport-matrix'\nexport * from '@tezos-x/octez.connect-transport-postmessage'\nexport * from '@tezos-x/octez.connect-transport-walletconnect'\nexport * from '@tezos-x/octez.connect-types'\n// export * from '@tezos-x/octez.connect-ui'\nexport * from '@tezos-x/octez.connect-utils'\nexport * from '@tezos-x/octez.connect-wallet'\n"]}