@tezos-x/octez.connect-sdk 4.8.2 → 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 +14 -71
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/octez.connect.min.js +1 -1126
- package/package.json +18 -17
- package/LICENCE +0 -19
- package/dist/walletbeacon.min.js +0 -1126
package/README.md
CHANGED
|
@@ -1,80 +1,23 @@
|
|
|
1
|
-
# octez.connect
|
|
1
|
+
# `@tezos-x/octez.connect-sdk`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://trilitech.github.io/octez.connect-sdk/)
|
|
5
|
-
[](https://github.com/trilitech/octez.connect/actions?query=workflow%3A%22Build%2C+Test+and+Analyze%22+branch%3Amain)
|
|
6
|
-
[](https://github.com/prettier/prettier)
|
|
3
|
+
octez.connect SDK umbrella package for Tezos dApp and wallet communication across supported transports.
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
This is a primary package in the Trilitech-maintained octez.connect SDK line and may be installed directly.
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
## Install
|
|
11
8
|
|
|
12
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -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"]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -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"]}
|