Skip to content

Commit

Permalink
Merge pull request #714 from airgap-it/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
AndreasGassmann authored Jan 29, 2024
2 parents 012c625 + afafcfc commit 95e3855
Show file tree
Hide file tree
Showing 21 changed files with 146 additions and 122 deletions.
Binary file removed assets/logos/ios-autonomy.png
Binary file not shown.
Binary file added assets/logos/ios-feralfile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.1.0",
"version": "4.1.1",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
102 changes: 51 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/beacon-blockchain-substrate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-blockchain-substrate",
"version": "4.1.0",
"version": "4.1.1",
"description": "This package adds support for `substrate` based blockchains. It can be used in combination with the `@airgap/beacon-dapp` or `@airgap/beacon-wallet` packages.",
"author": "Andreas Gassmann <[email protected]>",
"homepage": "https://walletbeacon.io",
Expand Down Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/airgap-it/beacon-sdk/issues"
},
"dependencies": {
"@airgap/beacon-types": "4.1.0",
"@airgap/beacon-ui": "4.1.0"
"@airgap/beacon-types": "4.1.1",
"@airgap/beacon-ui": "4.1.1"
}
}
6 changes: 3 additions & 3 deletions packages/beacon-blockchain-tezos-sapling/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-blockchain-tezos-sapling",
"version": "4.1.0",
"version": "4.1.1",
"description": "This package adds support for `tezos-sapling`, the sapling integration on the Tezos blockchain. It can be used in combination with the `@airgap/beacon-dapp` or `@airgap/beacon-wallet` packages.",
"author": "Andreas Gassmann <[email protected]>",
"homepage": "https://walletbeacon.io",
Expand Down Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/airgap-it/beacon-sdk/issues"
},
"dependencies": {
"@airgap/beacon-types": "4.1.0",
"@airgap/beacon-ui": "4.1.0"
"@airgap/beacon-types": "4.1.1",
"@airgap/beacon-ui": "4.1.1"
}
}
6 changes: 3 additions & 3 deletions packages/beacon-blockchain-tezos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-blockchain-tezos",
"version": "4.1.0",
"version": "4.1.1",
"description": "This package adds support for the `tezos` blockchain. It can be used in combination with the `@airgap/beacon-dapp` or `@airgap/beacon-wallet` packages.",
"author": "Andreas Gassmann <[email protected]>",
"homepage": "https://walletbeacon.io",
Expand Down Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/airgap-it/beacon-sdk/issues"
},
"dependencies": {
"@airgap/beacon-types": "4.1.0",
"@airgap/beacon-ui": "4.1.0"
"@airgap/beacon-types": "4.1.1",
"@airgap/beacon-ui": "4.1.1"
}
}
6 changes: 3 additions & 3 deletions packages/beacon-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-core",
"version": "4.1.0",
"version": "4.1.1",
"description": "This package contains internal methods that are used by both the dApp and wallet client.",
"author": "Andreas Gassmann <[email protected]>",
"homepage": "https://walletbeacon.io",
Expand Down Expand Up @@ -34,8 +34,8 @@
"url": "https://github.com/airgap-it/beacon-sdk/issues"
},
"dependencies": {
"@airgap/beacon-types": "4.1.0",
"@airgap/beacon-utils": "4.1.0",
"@airgap/beacon-types": "4.1.1",
"@airgap/beacon-utils": "4.1.1",
"@stablelib/ed25519": "^1.0.3",
"@stablelib/nacl": "^1.0.4",
"@stablelib/utf8": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-core/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const SDK_VERSION: string = '4.1.0'
export const SDK_VERSION: string = '4.1.1'
export const BEACON_VERSION: string = '3'

export const NOTIFICATION_ORACLE_URL: string =
Expand Down
12 changes: 6 additions & 6 deletions packages/beacon-dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-dapp",
"version": "4.1.0",
"version": "4.1.1",
"description": "Use this package on your dApp to instanciate a DAppClient object and communicate to wallets.",
"author": "Andreas Gassmann <[email protected]>",
"homepage": "https://walletbeacon.io",
Expand Down Expand Up @@ -35,10 +35,10 @@
"url": "https://github.com/airgap-it/beacon-sdk/issues"
},
"dependencies": {
"@airgap/beacon-core": "4.1.0",
"@airgap/beacon-transport-matrix": "4.1.0",
"@airgap/beacon-transport-postmessage": "4.1.0",
"@airgap/beacon-transport-walletconnect": "4.1.0",
"@airgap/beacon-ui": "4.1.0"
"@airgap/beacon-core": "4.1.1",
"@airgap/beacon-transport-matrix": "4.1.1",
"@airgap/beacon-transport-postmessage": "4.1.1",
"@airgap/beacon-transport-walletconnect": "4.1.1",
"@airgap/beacon-ui": "4.1.1"
}
}
39 changes: 31 additions & 8 deletions packages/beacon-dapp/src/dapp-client/DAppClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,13 @@ export class DAppClient extends Client {
})
}
}
private async channelClosedHandler() {
private async channelClosedHandler(type: TransportType) {
const transport = await this.transport

if (type && transport.type !== type) {
return
}

await this.events.emit(BeaconEvent.CHANNEL_CLOSED)
this.setActiveAccount(undefined)

Expand Down Expand Up @@ -756,12 +762,29 @@ export class DAppClient extends Client {
await this.events.emit(BeaconEvent.SHOW_PREPARE, { walletInfo })
}

public async hideUI(elements?: ('alert' | 'toast')[]): Promise<void> {
await this.events.emit(BeaconEvent.HIDE_UI, elements)
public async hideUI(elements: ('alert' | 'toast')[], type?: TransportType): Promise<void> {
await this.events.emit(BeaconEvent.HIDE_UI, ['alert', 'toast'])

if (elements?.includes('alert')) {
// if the sync was aborted from the wallet side
this._initPromise = undefined
if (elements.includes('alert')) {
// if the sync has been aborted
const transport = await this.transport

if (!type || transport.type === type) {
await Promise.all([
this.postMessageTransport?.disconnect(),
// p2pTransport.disconnect(), do not abort connection manually
this.walletConnectTransport?.disconnect()
])
this._initPromise = undefined
} else {
switch (type) {
case TransportType.WALLETCONNECT:
this.walletConnectTransport?.disconnect()
break
default:
this.postMessageTransport?.disconnect()
}
}
}
}

Expand Down Expand Up @@ -1793,7 +1816,7 @@ export class DAppClient extends Client {
!(await transport.hasPairings()) &&
!(await transport.hasSessions())
) {
await this.channelClosedHandler()
await this.channelClosedHandler(transport.type)
throw new Error('No active pairing nor session found')
}

Expand Down Expand Up @@ -1936,7 +1959,7 @@ export class DAppClient extends Client {
!(await transport.hasPairings()) &&
!(await transport.hasSessions())
) {
await this.channelClosedHandler()
await this.channelClosedHandler(transport.type)
throw new Error('No active pairing nor session found')
}

Expand Down
Loading

0 comments on commit 95e3855

Please sign in to comment.