diff --git a/README.md b/README.md index 97e4bfc..44022bd 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ import { ThanosWallet } from "@thanos-wallet/dapp"; // that tracks current permission in real-time. console.info(permission); - // prints "{ pkh: string, rpc: string }" if permission exists, "null" - if not. + // prints "{ rpc: string, pkh: string, publicKey: string }" if permission exists, "null" - if not. const wallet = new ThanosWallet("My Super DApp", permission); diff --git a/docs/README.md b/docs/README.md index 7ab1a99..d67adf2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -67,7 +67,7 @@ Ƭ **ThanosDAppMessage**: *[ThanosDAppRequest](README.md#thanosdapprequest) | [ThanosDAppResponse](README.md#thanosdappresponse)* -*Defined in [types.ts:1](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L1)* +*Defined in [types.ts:1](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L1)* ___ @@ -75,7 +75,7 @@ ___ Ƭ **ThanosDAppNetwork**: *"mainnet" | "delphinet" | "carthagenet" | "sandbox" | object* -*Defined in [types.ts:112](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L112)* +*Defined in [types.ts:114](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L114)* ___ @@ -83,7 +83,7 @@ ___ Ƭ **ThanosDAppPermission**: *object | null* -*Defined in [types.ts:107](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L107)* +*Defined in [types.ts:108](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L108)* Misc @@ -93,7 +93,7 @@ ___ Ƭ **ThanosDAppRequest**: *[ThanosDAppGetCurrentPermissionRequest](interfaces/thanosdappgetcurrentpermissionrequest.md) | [ThanosDAppPermissionRequest](interfaces/thanosdapppermissionrequest.md) | [ThanosDAppOperationRequest](interfaces/thanosdappoperationrequest.md) | [ThanosDAppSignRequest](interfaces/thanosdappsignrequest.md) | [ThanosDAppBroadcastRequest](interfaces/thanosdappbroadcastrequest.md)* -*Defined in [types.ts:3](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L3)* +*Defined in [types.ts:3](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L3)* ___ @@ -101,23 +101,23 @@ ___ Ƭ **ThanosDAppResponse**: *[ThanosDAppGetCurrentPermissionResponse](interfaces/thanosdappgetcurrentpermissionresponse.md) | [ThanosDAppPermissionResponse](interfaces/thanosdapppermissionresponse.md) | [ThanosDAppOperationResponse](interfaces/thanosdappoperationresponse.md) | [ThanosDAppSignResponse](interfaces/thanosdappsignresponse.md) | [ThanosDAppBroadcastResponse](interfaces/thanosdappbroadcastresponse.md)* -*Defined in [types.ts:10](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L10)* +*Defined in [types.ts:10](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L10)* ## Functions ### assertConnected -▸ **assertConnected**(`pkh?`: undefined | string): *asserts pkh* +▸ **assertConnected**(`perm`: [ThanosDAppPermission](README.md#thanosdapppermission)): *asserts perm* -*Defined in [taquito-wallet.ts:105](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L105)* +*Defined in [taquito-wallet.ts:106](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L106)* **Parameters:** Name | Type | ------ | ------ | -`pkh?` | undefined | string | +`perm` | [ThanosDAppPermission](README.md#thanosdapppermission) | -**Returns:** *asserts pkh* +**Returns:** *asserts perm* ___ @@ -125,7 +125,7 @@ ___ ▸ **assertResponse**(`condition`: any): *asserts condition* -*Defined in [client.ts:193](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L193)* +*Defined in [client.ts:197](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L197)* **Parameters:** @@ -141,7 +141,7 @@ ___ ▸ **createError**(`payload`: any): *[ThanosWalletError](classes/thanoswalleterror.md)‹›* -*Defined in [client.ts:174](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L174)* +*Defined in [client.ts:178](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L178)* **Parameters:** @@ -157,7 +157,7 @@ ___ ▸ **formatOpParams**(`op`: any): *any* -*Defined in [taquito-wallet.ts:111](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L111)* +*Defined in [taquito-wallet.ts:112](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L112)* **Parameters:** @@ -173,7 +173,7 @@ ___ ▸ **getCurrentPermission**(): *Promise‹null | object›* -*Defined in [client.ts:81](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L81)* +*Defined in [client.ts:81](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L81)* **Returns:** *Promise‹null | object›* @@ -183,7 +183,7 @@ ___ ▸ **isAvailable**(): *Promise‹boolean›* -*Defined in [client.ts:14](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L14)* +*Defined in [client.ts:14](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L14)* **Returns:** *Promise‹boolean›* @@ -193,7 +193,7 @@ ___ ▸ **onAvailabilityChange**(`callback`: function): *(Anonymous function)* -*Defined in [client.ts:41](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L41)* +*Defined in [client.ts:41](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L41)* **Parameters:** @@ -215,7 +215,7 @@ ___ ▸ **onPermissionChange**(`callback`: function): *(Anonymous function)* -*Defined in [client.ts:61](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L61)* +*Defined in [client.ts:61](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L61)* **Parameters:** @@ -237,7 +237,7 @@ ___ ▸ **permissionsAreEqual**(`aPerm`: [ThanosDAppPermission](README.md#thanosdapppermission), `bPerm`: [ThanosDAppPermission](README.md#thanosdapppermission)): *boolean* -*Defined in [client.ts:166](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L166)* +*Defined in [client.ts:170](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L170)* **Parameters:** @@ -254,7 +254,7 @@ ___ ▸ **request**(`payload`: [ThanosDAppRequest](README.md#thanosdapprequest)): *Promise‹[ThanosDAppGetCurrentPermissionResponse](interfaces/thanosdappgetcurrentpermissionresponse.md) | [ThanosDAppPermissionResponse](interfaces/thanosdapppermissionresponse.md) | [ThanosDAppOperationResponse](interfaces/thanosdappoperationresponse.md) | [ThanosDAppSignResponse](interfaces/thanosdappsignresponse.md) | [ThanosDAppBroadcastResponse](interfaces/thanosdappbroadcastresponse.md)›* -*Defined in [client.ts:135](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L135)* +*Defined in [client.ts:139](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L139)* **Parameters:** @@ -270,7 +270,7 @@ ___ ▸ **requestBroadcast**(`signedOpBytes`: string): *Promise‹string›* -*Defined in [client.ts:126](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L126)* +*Defined in [client.ts:130](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L130)* **Parameters:** @@ -286,7 +286,7 @@ ___ ▸ **requestOperation**(`sourcePkh`: string, `opParams`: any): *Promise‹string›* -*Defined in [client.ts:106](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L106)* +*Defined in [client.ts:110](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L110)* **Parameters:** @@ -303,7 +303,7 @@ ___ ▸ **requestPermission**(`network`: [ThanosDAppNetwork](README.md#thanosdappnetwork), `appMeta`: [ThanosDAppMetadata](interfaces/thanosdappmetadata.md), `force`: boolean): *Promise‹object›* -*Defined in [client.ts:91](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L91)* +*Defined in [client.ts:91](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L91)* **Parameters:** @@ -321,7 +321,7 @@ ___ ▸ **requestSign**(`sourcePkh`: string, `payload`: string): *Promise‹string›* -*Defined in [client.ts:116](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L116)* +*Defined in [client.ts:120](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L120)* **Parameters:** @@ -338,7 +338,7 @@ ___ ▸ **send**(`msg`: [ThanosPageMessage](interfaces/thanospagemessage.md)): *void* -*Defined in [client.ts:199](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L199)* +*Defined in [client.ts:203](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L203)* **Parameters:** diff --git a/docs/classes/invalidparamsthanoswalleterror.md b/docs/classes/invalidparamsthanoswalleterror.md index 8638d6c..59bcd18 100644 --- a/docs/classes/invalidparamsthanoswalleterror.md +++ b/docs/classes/invalidparamsthanoswalleterror.md @@ -27,7 +27,7 @@ *Overrides [ThanosWalletError](thanoswalleterror.md).[message](thanoswalleterror.md#message)* -*Defined in [client.ts:220](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L220)* +*Defined in [client.ts:224](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L224)* ___ @@ -37,4 +37,4 @@ ___ *Overrides [ThanosWalletError](thanoswalleterror.md).[name](thanoswalleterror.md#name)* -*Defined in [client.ts:219](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L219)* +*Defined in [client.ts:223](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L223)* diff --git a/docs/classes/notconnectedthanoswalleterror.md b/docs/classes/notconnectedthanoswalleterror.md index 11a076e..54719ee 100644 --- a/docs/classes/notconnectedthanoswalleterror.md +++ b/docs/classes/notconnectedthanoswalleterror.md @@ -27,7 +27,7 @@ *Overrides [ThanosWalletError](thanoswalleterror.md).[message](thanoswalleterror.md#message)* -*Defined in [taquito-wallet.ts:101](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L101)* +*Defined in [taquito-wallet.ts:102](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L102)* ___ @@ -37,4 +37,4 @@ ___ *Overrides [ThanosWalletError](thanoswalleterror.md).[name](thanoswalleterror.md#name)* -*Defined in [taquito-wallet.ts:100](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L100)* +*Defined in [taquito-wallet.ts:101](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L101)* diff --git a/docs/classes/notfoundthanoswalleterror.md b/docs/classes/notfoundthanoswalleterror.md index 6d7a4d3..970404d 100644 --- a/docs/classes/notfoundthanoswalleterror.md +++ b/docs/classes/notfoundthanoswalleterror.md @@ -27,7 +27,7 @@ *Overrides [ThanosWalletError](thanoswalleterror.md).[message](thanoswalleterror.md#message)* -*Defined in [client.ts:215](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L215)* +*Defined in [client.ts:219](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L219)* ___ @@ -37,4 +37,4 @@ ___ *Overrides [ThanosWalletError](thanoswalleterror.md).[name](thanoswalleterror.md#name)* -*Defined in [client.ts:214](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L214)* +*Defined in [client.ts:218](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L218)* diff --git a/docs/classes/notgrantedthanoswalleterror.md b/docs/classes/notgrantedthanoswalleterror.md index 67b7968..2aa1d72 100644 --- a/docs/classes/notgrantedthanoswalleterror.md +++ b/docs/classes/notgrantedthanoswalleterror.md @@ -27,7 +27,7 @@ *Overrides [ThanosWalletError](thanoswalleterror.md).[message](thanoswalleterror.md#message)* -*Defined in [client.ts:210](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L210)* +*Defined in [client.ts:214](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L214)* ___ @@ -37,4 +37,4 @@ ___ *Overrides [ThanosWalletError](thanoswalleterror.md).[name](thanoswalleterror.md#name)* -*Defined in [client.ts:209](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L209)* +*Defined in [client.ts:213](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L213)* diff --git a/docs/classes/thanoswallet.md b/docs/classes/thanoswallet.md index d6f4b4e..f77bf44 100644 --- a/docs/classes/thanoswallet.md +++ b/docs/classes/thanoswallet.md @@ -19,8 +19,7 @@ ### Properties * [appName](thanoswallet.md#private-appname) -* [pkh](thanoswallet.md#private-optional-pkh) -* [rpc](thanoswallet.md#optional-rpc) +* [permission](thanoswallet.md#permission) * [getCurrentPermission](thanoswallet.md#static-getcurrentpermission) * [isAvailable](thanoswallet.md#static-isavailable) * [onAvailabilityChange](thanoswallet.md#static-onavailabilitychange) @@ -38,6 +37,7 @@ * [mapDelegateParamsToWalletParams](thanoswallet.md#mapdelegateparamstowalletparams) * [mapOriginateParamsToWalletParams](thanoswallet.md#maporiginateparamstowalletparams) * [mapTransferParamsToWalletParams](thanoswallet.md#maptransferparamstowalletparams) +* [reconnect](thanoswallet.md#reconnect) * [sendOperations](thanoswallet.md#sendoperations) * [sign](thanoswallet.md#sign) * [toTezos](thanoswallet.md#totezos) @@ -48,7 +48,7 @@ \+ **new ThanosWallet**(`appName`: string, `existingPermission?`: [ThanosDAppPermission](../README.md#thanosdapppermission)): *[ThanosWallet](thanoswallet.md)* -*Defined in [taquito-wallet.ts:33](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L33)* +*Defined in [taquito-wallet.ts:32](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L32)* **Parameters:** @@ -65,23 +65,15 @@ Name | Type | • **appName**: *string* -*Defined in [taquito-wallet.ts:36](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L36)* +*Defined in [taquito-wallet.ts:35](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L35)* ___ -### `Private` `Optional` pkh +### permission -• **pkh**? : *undefined | string* +• **permission**: *[ThanosDAppPermission](../README.md#thanosdapppermission)* = null -*Defined in [taquito-wallet.ts:32](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L32)* - -___ - -### `Optional` rpc - -• **rpc**? : *undefined | string* - -*Defined in [taquito-wallet.ts:33](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L33)* +*Defined in [taquito-wallet.ts:32](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L32)* ___ @@ -89,7 +81,7 @@ ___ ▪ **getCurrentPermission**: *[getCurrentPermission](../README.md#getcurrentpermission)* = getCurrentPermission -*Defined in [taquito-wallet.ts:29](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L29)* +*Defined in [taquito-wallet.ts:29](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L29)* ___ @@ -97,7 +89,7 @@ ___ ▪ **isAvailable**: *[isAvailable](../README.md#isavailable)* = isAvailable -*Defined in [taquito-wallet.ts:27](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L27)* +*Defined in [taquito-wallet.ts:27](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L27)* ___ @@ -105,7 +97,7 @@ ___ ▪ **onAvailabilityChange**: *[onAvailabilityChange](../README.md#onavailabilitychange)* = onAvailabilityChange -*Defined in [taquito-wallet.ts:28](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L28)* +*Defined in [taquito-wallet.ts:28](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L28)* ___ @@ -113,7 +105,7 @@ ___ ▪ **onPermissionChange**: *[onPermissionChange](../README.md#onpermissionchange)* = onPermissionChange -*Defined in [taquito-wallet.ts:30](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L30)* +*Defined in [taquito-wallet.ts:30](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L30)* ## Accessors @@ -121,7 +113,7 @@ ___ • **get connected**(): *boolean* -*Defined in [taquito-wallet.ts:45](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L45)* +*Defined in [taquito-wallet.ts:43](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L43)* **Returns:** *boolean* @@ -131,7 +123,7 @@ ___ ▸ **broadcast**(`signedOpBytes`: string): *Promise‹string›* -*Defined in [taquito-wallet.ts:93](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L93)* +*Defined in [taquito-wallet.ts:94](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L94)* **Parameters:** @@ -147,7 +139,7 @@ ___ ▸ **connect**(`network`: [ThanosDAppNetwork](../README.md#thanosdappnetwork), `opts`: object): *Promise‹void›* -*Defined in [taquito-wallet.ts:56](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L56)* +*Defined in [taquito-wallet.ts:54](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L54)* **Parameters:** @@ -167,7 +159,7 @@ ___ ▸ **getPKH**(): *Promise‹string›* -*Defined in [taquito-wallet.ts:66](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L66)* +*Defined in [taquito-wallet.ts:67](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L67)* **Returns:** *Promise‹string›* @@ -177,7 +169,7 @@ ___ ▸ **mapDelegateParamsToWalletParams**(`params`: WalletDelegateParams): *Promise‹RPCDelegateOperation›* -*Defined in [taquito-wallet.ts:79](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L79)* +*Defined in [taquito-wallet.ts:80](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L80)* **Parameters:** @@ -193,7 +185,7 @@ ___ ▸ **mapOriginateParamsToWalletParams**(`params`: WalletOriginateParams): *Promise‹RPCOriginationOperation›* -*Defined in [taquito-wallet.ts:75](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L75)* +*Defined in [taquito-wallet.ts:76](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L76)* **Parameters:** @@ -209,7 +201,7 @@ ___ ▸ **mapTransferParamsToWalletParams**(`params`: WalletTransferParams): *Promise‹RPCTransferOperation›* -*Defined in [taquito-wallet.ts:71](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L71)* +*Defined in [taquito-wallet.ts:72](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L72)* **Parameters:** @@ -221,11 +213,27 @@ Name | Type | ___ +### reconnect + +▸ **reconnect**(`network`: [ThanosDAppNetwork](../README.md#thanosdappnetwork)): *Promise‹void›* + +*Defined in [taquito-wallet.ts:63](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L63)* + +**Parameters:** + +Name | Type | +------ | ------ | +`network` | [ThanosDAppNetwork](../README.md#thanosdappnetwork) | + +**Returns:** *Promise‹void›* + +___ + ### sendOperations ▸ **sendOperations**(`opParams`: any[]): *Promise‹string›* -*Defined in [taquito-wallet.ts:83](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L83)* +*Defined in [taquito-wallet.ts:84](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L84)* **Parameters:** @@ -241,7 +249,7 @@ ___ ▸ **sign**(`payload`: string): *Promise‹string›* -*Defined in [taquito-wallet.ts:88](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L88)* +*Defined in [taquito-wallet.ts:89](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L89)* **Parameters:** @@ -257,6 +265,6 @@ ___ ▸ **toTezos**(): *TezosToolkit‹›* -*Defined in [taquito-wallet.ts:49](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/taquito-wallet.ts#L49)* +*Defined in [taquito-wallet.ts:47](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/taquito-wallet.ts#L47)* **Returns:** *TezosToolkit‹›* diff --git a/docs/classes/thanoswalleterror.md b/docs/classes/thanoswalleterror.md index 6dd9d6b..5134add 100644 --- a/docs/classes/thanoswalleterror.md +++ b/docs/classes/thanoswalleterror.md @@ -31,7 +31,7 @@ • **message**: *string* = "An unknown error occured. Please try again or report it" -*Defined in [client.ts:205](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L205)* +*Defined in [client.ts:209](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L209)* ___ @@ -39,4 +39,4 @@ ___ • **name**: *string* = "ThanosWalletError" -*Defined in [client.ts:204](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/client.ts#L204)* +*Defined in [client.ts:208](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/client.ts#L208)* diff --git a/docs/enums/thanosdapperrortype.md b/docs/enums/thanosdapperrortype.md index 92b2ff3..cb4b8f8 100644 --- a/docs/enums/thanosdapperrortype.md +++ b/docs/enums/thanosdapperrortype.md @@ -18,7 +18,7 @@ Errors • **InvalidParams**: = "INVALID_PARAMS" -*Defined in [types.ts:100](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L100)* +*Defined in [types.ts:101](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L101)* ___ @@ -26,7 +26,7 @@ ___ • **NotFound**: = "NOT_FOUND" -*Defined in [types.ts:99](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L99)* +*Defined in [types.ts:100](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L100)* ___ @@ -34,4 +34,4 @@ ___ • **NotGranted**: = "NOT_GRANTED" -*Defined in [types.ts:98](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L98)* +*Defined in [types.ts:99](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L99)* diff --git a/docs/enums/thanosdappmessagetype.md b/docs/enums/thanosdappmessagetype.md index e61bdce..3a8f194 100644 --- a/docs/enums/thanosdappmessagetype.md +++ b/docs/enums/thanosdappmessagetype.md @@ -23,7 +23,7 @@ • **BroadcastRequest**: = "BROADCAST_REQUEST" -*Defined in [types.ts:30](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L30)* +*Defined in [types.ts:30](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L30)* ___ @@ -31,7 +31,7 @@ ___ • **BroadcastResponse**: = "BROADCAST_RESPONSE" -*Defined in [types.ts:31](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L31)* +*Defined in [types.ts:31](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L31)* ___ @@ -39,7 +39,7 @@ ___ • **GetCurrentPermissionRequest**: = "GET_CURRENT_PERMISSION_REQUEST" -*Defined in [types.ts:22](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L22)* +*Defined in [types.ts:22](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L22)* ___ @@ -47,7 +47,7 @@ ___ • **GetCurrentPermissionResponse**: = "GET_CURRENT_PERMISSION_RESPONSE" -*Defined in [types.ts:23](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L23)* +*Defined in [types.ts:23](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L23)* ___ @@ -55,7 +55,7 @@ ___ • **OperationRequest**: = "OPERATION_REQUEST" -*Defined in [types.ts:26](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L26)* +*Defined in [types.ts:26](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L26)* ___ @@ -63,7 +63,7 @@ ___ • **OperationResponse**: = "OPERATION_RESPONSE" -*Defined in [types.ts:27](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L27)* +*Defined in [types.ts:27](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L27)* ___ @@ -71,7 +71,7 @@ ___ • **PermissionRequest**: = "PERMISSION_REQUEST" -*Defined in [types.ts:24](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L24)* +*Defined in [types.ts:24](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L24)* ___ @@ -79,7 +79,7 @@ ___ • **PermissionResponse**: = "PERMISSION_RESPONSE" -*Defined in [types.ts:25](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L25)* +*Defined in [types.ts:25](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L25)* ___ @@ -87,7 +87,7 @@ ___ • **SignRequest**: = "SIGN_REQUEST" -*Defined in [types.ts:28](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L28)* +*Defined in [types.ts:28](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L28)* ___ @@ -95,4 +95,4 @@ ___ • **SignResponse**: = "SIGN_RESPONSE" -*Defined in [types.ts:29](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L29)* +*Defined in [types.ts:29](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L29)* diff --git a/docs/enums/thanospagemessagetype.md b/docs/enums/thanospagemessagetype.md index 7893bfd..2cba75b 100644 --- a/docs/enums/thanospagemessagetype.md +++ b/docs/enums/thanospagemessagetype.md @@ -16,7 +16,7 @@ • **ErrorResponse**: = "THANOS_PAGE_ERROR_RESPONSE" -*Defined in [types.ts:132](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L132)* +*Defined in [types.ts:134](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L134)* ___ @@ -24,7 +24,7 @@ ___ • **Request**: = "THANOS_PAGE_REQUEST" -*Defined in [types.ts:130](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L130)* +*Defined in [types.ts:132](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L132)* ___ @@ -32,4 +32,4 @@ ___ • **Response**: = "THANOS_PAGE_RESPONSE" -*Defined in [types.ts:131](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L131)* +*Defined in [types.ts:133](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L133)* diff --git a/docs/interfaces/thanosdappbroadcastrequest.md b/docs/interfaces/thanosdappbroadcastrequest.md index 6692cee..bab54ee 100644 --- a/docs/interfaces/thanosdappbroadcastrequest.md +++ b/docs/interfaces/thanosdappbroadcastrequest.md @@ -21,7 +21,7 @@ • **signedOpBytes**: *string* -*Defined in [types.ts:86](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L86)* +*Defined in [types.ts:87](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L87)* ___ @@ -31,4 +31,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:85](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L85)* +*Defined in [types.ts:86](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L86)* diff --git a/docs/interfaces/thanosdappbroadcastresponse.md b/docs/interfaces/thanosdappbroadcastresponse.md index 883a510..65593ff 100644 --- a/docs/interfaces/thanosdappbroadcastresponse.md +++ b/docs/interfaces/thanosdappbroadcastresponse.md @@ -21,7 +21,7 @@ • **opHash**: *string* -*Defined in [types.ts:91](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L91)* +*Defined in [types.ts:92](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L92)* ___ @@ -31,4 +31,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:90](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L90)* +*Defined in [types.ts:91](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L91)* diff --git a/docs/interfaces/thanosdappgetcurrentpermissionrequest.md b/docs/interfaces/thanosdappgetcurrentpermissionrequest.md index ba6900d..a8091a8 100644 --- a/docs/interfaces/thanosdappgetcurrentpermissionrequest.md +++ b/docs/interfaces/thanosdappgetcurrentpermissionrequest.md @@ -24,4 +24,4 @@ Messages *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:40](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L40)* +*Defined in [types.ts:40](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L40)* diff --git a/docs/interfaces/thanosdappgetcurrentpermissionresponse.md b/docs/interfaces/thanosdappgetcurrentpermissionresponse.md index 1ae0e7f..1d243e1 100644 --- a/docs/interfaces/thanosdappgetcurrentpermissionresponse.md +++ b/docs/interfaces/thanosdappgetcurrentpermissionresponse.md @@ -21,7 +21,7 @@ • **permission**: *[ThanosDAppPermission](../README.md#thanosdapppermission)* -*Defined in [types.ts:46](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L46)* +*Defined in [types.ts:46](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L46)* ___ @@ -31,4 +31,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:45](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L45)* +*Defined in [types.ts:45](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L45)* diff --git a/docs/interfaces/thanosdappmessagebase.md b/docs/interfaces/thanosdappmessagebase.md index 1be6c4a..c01c753 100644 --- a/docs/interfaces/thanosdappmessagebase.md +++ b/docs/interfaces/thanosdappmessagebase.md @@ -38,4 +38,4 @@ • **type**: *[ThanosDAppMessageType](../enums/thanosdappmessagetype.md)* -*Defined in [types.ts:18](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L18)* +*Defined in [types.ts:18](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L18)* diff --git a/docs/interfaces/thanosdappmetadata.md b/docs/interfaces/thanosdappmetadata.md index abb9082..a0700f1 100644 --- a/docs/interfaces/thanosdappmetadata.md +++ b/docs/interfaces/thanosdappmetadata.md @@ -18,4 +18,4 @@ • **name**: *string* -*Defined in [types.ts:120](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L120)* +*Defined in [types.ts:122](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L122)* diff --git a/docs/interfaces/thanosdappoperationrequest.md b/docs/interfaces/thanosdappoperationrequest.md index a7100c5..b049eb7 100644 --- a/docs/interfaces/thanosdappoperationrequest.md +++ b/docs/interfaces/thanosdappoperationrequest.md @@ -22,7 +22,7 @@ • **opParams**: *any[]* -*Defined in [types.ts:65](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L65)* +*Defined in [types.ts:66](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L66)* ___ @@ -30,7 +30,7 @@ ___ • **sourcePkh**: *string* -*Defined in [types.ts:64](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L64)* +*Defined in [types.ts:65](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L65)* ___ @@ -40,4 +40,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:63](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L63)* +*Defined in [types.ts:64](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L64)* diff --git a/docs/interfaces/thanosdappoperationresponse.md b/docs/interfaces/thanosdappoperationresponse.md index a5990fc..d3357cd 100644 --- a/docs/interfaces/thanosdappoperationresponse.md +++ b/docs/interfaces/thanosdappoperationresponse.md @@ -21,7 +21,7 @@ • **opHash**: *string* -*Defined in [types.ts:70](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L70)* +*Defined in [types.ts:71](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L71)* ___ @@ -31,4 +31,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:69](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L69)* +*Defined in [types.ts:70](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L70)* diff --git a/docs/interfaces/thanosdapppermissionrequest.md b/docs/interfaces/thanosdapppermissionrequest.md index 28255a0..12e69ce 100644 --- a/docs/interfaces/thanosdapppermissionrequest.md +++ b/docs/interfaces/thanosdapppermissionrequest.md @@ -23,7 +23,7 @@ • **appMeta**: *[ThanosDAppMetadata](thanosdappmetadata.md)* -*Defined in [types.ts:52](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L52)* +*Defined in [types.ts:52](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L52)* ___ @@ -31,7 +31,7 @@ ___ • **force**? : *undefined | false | true* -*Defined in [types.ts:53](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L53)* +*Defined in [types.ts:53](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L53)* ___ @@ -39,7 +39,7 @@ ___ • **network**: *[ThanosDAppNetwork](../README.md#thanosdappnetwork)* -*Defined in [types.ts:51](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L51)* +*Defined in [types.ts:51](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L51)* ___ @@ -49,4 +49,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:50](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L50)* +*Defined in [types.ts:50](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L50)* diff --git a/docs/interfaces/thanosdapppermissionresponse.md b/docs/interfaces/thanosdapppermissionresponse.md index a467772..5432df2 100644 --- a/docs/interfaces/thanosdapppermissionresponse.md +++ b/docs/interfaces/thanosdapppermissionresponse.md @@ -13,6 +13,7 @@ ### Properties * [pkh](thanosdapppermissionresponse.md#pkh) +* [publicKey](thanosdapppermissionresponse.md#publickey) * [rpc](thanosdapppermissionresponse.md#rpc) * [type](thanosdapppermissionresponse.md#type) @@ -22,7 +23,15 @@ • **pkh**: *string* -*Defined in [types.ts:58](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L58)* +*Defined in [types.ts:58](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L58)* + +___ + +### publicKey + +• **publicKey**: *string* + +*Defined in [types.ts:59](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L59)* ___ @@ -30,7 +39,7 @@ ___ • **rpc**: *string* -*Defined in [types.ts:59](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L59)* +*Defined in [types.ts:60](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L60)* ___ @@ -40,4 +49,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:57](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L57)* +*Defined in [types.ts:57](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L57)* diff --git a/docs/interfaces/thanosdappsignrequest.md b/docs/interfaces/thanosdappsignrequest.md index 7529a98..37e5949 100644 --- a/docs/interfaces/thanosdappsignrequest.md +++ b/docs/interfaces/thanosdappsignrequest.md @@ -22,7 +22,7 @@ • **payload**: *string* -*Defined in [types.ts:76](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L76)* +*Defined in [types.ts:77](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L77)* ___ @@ -30,7 +30,7 @@ ___ • **sourcePkh**: *string* -*Defined in [types.ts:75](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L75)* +*Defined in [types.ts:76](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L76)* ___ @@ -40,4 +40,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:74](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L74)* +*Defined in [types.ts:75](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L75)* diff --git a/docs/interfaces/thanosdappsignresponse.md b/docs/interfaces/thanosdappsignresponse.md index a58f2c5..759246e 100644 --- a/docs/interfaces/thanosdappsignresponse.md +++ b/docs/interfaces/thanosdappsignresponse.md @@ -21,7 +21,7 @@ • **signature**: *string* -*Defined in [types.ts:81](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L81)* +*Defined in [types.ts:82](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L82)* ___ @@ -31,4 +31,4 @@ ___ *Overrides [ThanosDAppMessageBase](thanosdappmessagebase.md).[type](thanosdappmessagebase.md#type)* -*Defined in [types.ts:80](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L80)* +*Defined in [types.ts:81](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L81)* diff --git a/docs/interfaces/thanospagemessage.md b/docs/interfaces/thanospagemessage.md index 6b71382..6354f3e 100644 --- a/docs/interfaces/thanospagemessage.md +++ b/docs/interfaces/thanospagemessage.md @@ -20,7 +20,7 @@ • **payload**: *any* -*Defined in [types.ts:125](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L125)* +*Defined in [types.ts:127](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L127)* ___ @@ -28,7 +28,7 @@ ___ • **reqId**? : *string | number* -*Defined in [types.ts:126](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L126)* +*Defined in [types.ts:128](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L128)* ___ @@ -36,4 +36,4 @@ ___ • **type**: *[ThanosPageMessageType](../enums/thanospagemessagetype.md)* -*Defined in [types.ts:124](https://github.com/madfish-solutions/thanoswallet-dapp/blob/f20b824/src/types.ts#L124)* +*Defined in [types.ts:126](https://github.com/madfish-solutions/thanoswallet-dapp/blob/1e90ae9/src/types.ts#L126)* diff --git a/src/client.ts b/src/client.ts index b04c71f..5868918 100644 --- a/src/client.ts +++ b/src/client.ts @@ -100,7 +100,11 @@ export async function requestPermission( force, }); assertResponse(res.type === ThanosDAppMessageType.PermissionResponse); - return { pkh: res.pkh, rpc: res.rpc }; + return { + rpc: res.rpc, + pkh: res.pkh, + publicKey: res.publicKey, + }; } export async function requestOperation(sourcePkh: string, opParams: any) { diff --git a/src/taquito-wallet.ts b/src/taquito-wallet.ts index e3cfd33..177d415 100644 --- a/src/taquito-wallet.ts +++ b/src/taquito-wallet.ts @@ -29,38 +29,35 @@ export class ThanosWallet implements WalletProvider { static getCurrentPermission = getCurrentPermission; static onPermissionChange = onPermissionChange; - private pkh?: string; - public rpc?: string; + permission: ThanosDAppPermission = null; constructor( private appName: string, existingPermission?: ThanosDAppPermission ) { if (existingPermission) { - this.pkh = existingPermission.pkh; - this.rpc = existingPermission.rpc; + this.permission = existingPermission; } } get connected() { - return Boolean(this.pkh); + return Boolean(this.permission); } toTezos() { - assertConnected(this.pkh); - const tezos = new TezosToolkit(this.rpc!); + assertConnected(this.permission); + const tezos = new TezosToolkit(this.permission.rpc); tezos.setProvider({ wallet: this }); return tezos; } async connect(network: ThanosDAppNetwork, opts = { forcePermission: false }) { - const { pkh, rpc } = await requestPermission( + const perm = await requestPermission( network, { name: this.appName }, opts.forcePermission ); - this.pkh = pkh; - this.rpc = rpc; + this.permission = perm; } reconnect(network: ThanosDAppNetwork) { @@ -68,8 +65,8 @@ export class ThanosWallet implements WalletProvider { } async getPKH() { - assertConnected(this.pkh); - return this.pkh; + assertConnected(this.permission); + return this.permission.pkh; } async mapTransferParamsToWalletParams(params: WalletTransferParams) { @@ -85,17 +82,17 @@ export class ThanosWallet implements WalletProvider { } async sendOperations(opParams: any[]) { - assertConnected(this.pkh); - return requestOperation(this.pkh, opParams.map(formatOpParams)); + assertConnected(this.permission); + return requestOperation(this.permission.pkh, opParams.map(formatOpParams)); } async sign(payload: string) { - assertConnected(this.pkh); - return requestSign(this.pkh, payload); + assertConnected(this.permission); + return requestSign(this.permission.pkh, payload); } async broadcast(signedOpBytes: string) { - assertConnected(this.pkh); + assertConnected(this.permission); return requestBroadcast(signedOpBytes); } } @@ -106,8 +103,8 @@ export class NotConnectedThanosWalletError extends ThanosWalletError { "You need to connect ThanosWallet by calling thanosWallet.connect() first"; } -function assertConnected(pkh?: string): asserts pkh { - if (!pkh) { +function assertConnected(perm: ThanosDAppPermission): asserts perm { + if (!perm) { throw new NotConnectedThanosWalletError(); } } diff --git a/src/types.ts b/src/types.ts index d287baf..6bd0f7a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -56,6 +56,7 @@ export interface ThanosDAppPermissionRequest extends ThanosDAppMessageBase { export interface ThanosDAppPermissionResponse extends ThanosDAppMessageBase { type: ThanosDAppMessageType.PermissionResponse; pkh: string; + publicKey: string; rpc: string; } @@ -105,8 +106,9 @@ export enum ThanosDAppErrorType { */ export type ThanosDAppPermission = { - pkh: string; rpc: string; + pkh: string; + publicKey: string; } | null; export type ThanosDAppNetwork =