Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release #798

Merged
merged 30 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c8ec5b8
chore: beta release
IsaccoSordo Jul 22, 2024
fc45a36
fix: constant
IsaccoSordo Jul 22, 2024
0db45b0
fix: p2p sendOperation failure
IsaccoSordo Jul 27, 2024
f8591a6
chore: beta release
IsaccoSordo Jul 27, 2024
ad08ad1
chore: updated constat
IsaccoSordo Jul 27, 2024
64d8ceb
fix: await transport
IsaccoSordo Aug 8, 2024
7ea9b71
chore: update wc
IsaccoSordo Aug 8, 2024
f89af23
fix: mobile request lost
IsaccoSordo Aug 8, 2024
1059a36
fix: bc on mobile
IsaccoSordo Aug 8, 2024
a34174a
fix: added error message
IsaccoSordo Aug 12, 2024
6d900c4
fix: improved connection strategy to relayer
IsaccoSordo Aug 12, 2024
3d1871b
chore: change variable name
IsaccoSordo Aug 12, 2024
b81f105
fix: order
IsaccoSordo Aug 12, 2024
5a4b35e
fix: error
IsaccoSordo Aug 12, 2024
da9f367
feat: add key
IsaccoSordo Aug 12, 2024
7fc059c
fix: add error message
IsaccoSordo Aug 12, 2024
5a657bb
fix: condition
IsaccoSordo Aug 12, 2024
581f41a
fix: boolean condition in render
IsaccoSordo Aug 12, 2024
7293e4a
fix: error message
IsaccoSordo Aug 12, 2024
2b1a2d7
fix: unlock hybrid view
IsaccoSordo Aug 12, 2024
764ce9f
fix: retries
IsaccoSordo Aug 12, 2024
8b0d394
fix: const
IsaccoSordo Aug 12, 2024
32dd0a1
fix: update message
IsaccoSordo Aug 30, 2024
752f1a2
fix: add rate limiter on makeRequestBC
IsaccoSordo Sep 2, 2024
1a95c84
fix: error message
IsaccoSordo Sep 2, 2024
b87a01f
fix: typo
IsaccoSordo Sep 2, 2024
d0c4a59
chore: release
IsaccoSordo Sep 3, 2024
491655a
fix: constant
IsaccoSordo Sep 3, 2024
0f2128c
fix: removed spread
IsaccoSordo Sep 3, 2024
5559a82
Merge pull request #805 from airgap-it/feat/wc_error_notification
jsamol Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.2.2",
"version": "4.3.0",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
273 changes: 135 additions & 138 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
"@airgap/beacon-ui": "file:packages/beacon-ui",
"@airgap/beacon-utils": "file:packages/beacon-utils",
"@airgap/beacon-wallet": "file:packages/beacon-wallet",
"@walletconnect/sign-client": "2.11.2",
"@walletconnect/types": "2.11.2",
"@walletconnect/utils": "2.11.2",
"@walletconnect/sign-client": "2.14.0",
"@walletconnect/types": "2.14.0",
"@walletconnect/utils": "2.14.0",
"@web3modal/standalone": "2.0.0",
"stream-browserify": "^3.0.0"
},
Expand Down
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.2.2",
"version": "4.3.0",
"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.2.2",
"@airgap/beacon-ui": "4.2.2"
"@airgap/beacon-types": "4.3.0",
"@airgap/beacon-ui": "4.3.0"
}
}
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.2.2",
"version": "4.3.0",
"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.2.2",
"@airgap/beacon-ui": "4.2.2"
"@airgap/beacon-types": "4.3.0",
"@airgap/beacon-ui": "4.3.0"
}
}
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.2.2",
"version": "4.3.0",
"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.2.2",
"@airgap/beacon-ui": "4.2.2"
"@airgap/beacon-types": "4.3.0",
"@airgap/beacon-ui": "4.3.0"
}
}
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.2.2",
"version": "4.3.0",
"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.2.2",
"@airgap/beacon-utils": "4.2.2",
"@airgap/beacon-types": "4.3.0",
"@airgap/beacon-utils": "4.3.0",
"@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.2.2'
export const SDK_VERSION: string = '4.3.0'
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.2.2",
"version": "4.3.0",
"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,11 +35,11 @@
"url": "https://github.com/airgap-it/beacon-sdk/issues"
},
"dependencies": {
"@airgap/beacon-core": "4.2.2",
"@airgap/beacon-transport-matrix": "4.2.2",
"@airgap/beacon-transport-postmessage": "4.2.2",
"@airgap/beacon-transport-walletconnect": "4.2.2",
"@airgap/beacon-ui": "4.2.2",
"@airgap/beacon-core": "4.3.0",
"@airgap/beacon-transport-matrix": "4.3.0",
"@airgap/beacon-transport-postmessage": "4.3.0",
"@airgap/beacon-transport-walletconnect": "4.3.0",
"@airgap/beacon-ui": "4.3.0",
"broadcast-channel": "^7.0.0"
}
}
44 changes: 34 additions & 10 deletions packages/beacon-dapp/src/dapp-client/DAppClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,14 @@ export class DAppClient extends Client {
}
}

private prepareRequest(message: any, isV3 = false) {
private async prepareRequest(message: any, isV3 = false) {
if (!this.multiTabChannel.isLeader()) {
return
}

// block until the transport is ready
await this._transport.promise

this.openRequestsOtherTabs.add(message.id)
isV3
? this.makeRequestV3(message.data, message.id)
Expand Down Expand Up @@ -1071,6 +1074,14 @@ export class DAppClient extends Client {
})
}

private async checkMakeRequest() {
const isResolved = this._transport.isResolved()
const isWCInstance = isResolved && (await this.transport) instanceof WalletConnectTransport
const isLeader = this.multiTabChannel.isLeader()

return !isResolved || (isResolved && (!isWCInstance || (isWCInstance && isLeader)))
}

/**
* Will remove the account from the local storage and set a new active account if necessary.
*
Expand Down Expand Up @@ -1359,7 +1370,7 @@ export class DAppClient extends Client {

const logId = `makeRequestV3 ${Date.now()}`
logger.time(true, logId)
const res = this.multiTabChannel.isLeader()
const res = (await this.checkMakeRequest())
? this.makeRequestV3<
BlockchainRequestV3<string>,
BeaconMessageWrapper<BlockchainResponseV3<string>>
Expand Down Expand Up @@ -1428,9 +1439,7 @@ export class DAppClient extends Client {
logger.time(true, logId)

const res =
this.multiTabChannel.isLeader() ||
!this._activeAccount.isResolved() ||
!(await this.getActiveAccount())
(await this.checkMakeRequest()) || !(await this.getActiveAccount())
? this.makeRequest<PermissionRequest, PermissionResponse>(request)
: this.makeRequestBC<PermissionRequest, PermissionResponse>(request)

Expand Down Expand Up @@ -1508,7 +1517,7 @@ export class DAppClient extends Client {
this.sendMetrics('performance-metrics/save', await this.buildPayload('message', 'start'))
const logId = `makeRequest ${Date.now()}`
logger.time(true, logId)
const res = this.multiTabChannel.isLeader()
const res = (await this.checkMakeRequest())
? this.makeRequest<ProofOfEventChallengeRequest, ProofOfEventChallengeResponse>(request)
: this.makeRequestBC<ProofOfEventChallengeRequest, ProofOfEventChallengeResponse>(request)

Expand Down Expand Up @@ -1575,7 +1584,7 @@ export class DAppClient extends Client {
const logId = `makeRequest ${Date.now()}`
logger.time(true, logId)

const res = this.multiTabChannel.isLeader()
const res = (await this.checkMakeRequest())
? this.makeRequest<
SimulatedProofOfEventChallengeRequest,
SimulatedProofOfEventChallengeResponse
Expand Down Expand Up @@ -1675,7 +1684,7 @@ export class DAppClient extends Client {
this.sendMetrics('performance-metrics/save', await this.buildPayload('message', 'start'))
const logId = `makeRequest ${Date.now()}`
logger.time(true, logId)
const res = this.multiTabChannel.isLeader()
const res = (await this.checkMakeRequest())
? this.makeRequest<SignPayloadRequest, SignPayloadResponse>(request)
: this.makeRequestBC<SignPayloadRequest, SignPayloadResponse>(request)

Expand Down Expand Up @@ -1791,7 +1800,7 @@ export class DAppClient extends Client {
const logId = `makeRequest ${Date.now()}`
logger.time(true, logId)

const res = this.multiTabChannel.isLeader()
const res = (await this.checkMakeRequest())
? this.makeRequest<OperationRequest, OperationResponse>(request)
: this.makeRequestBC<OperationRequest, OperationResponse>(request)

Expand Down Expand Up @@ -1851,7 +1860,7 @@ export class DAppClient extends Client {
this.sendMetrics('performance-metrics/save', await this.buildPayload('message', 'start'))
const logId = `makeRequest ${Date.now()}`
logger.time(true, logId)
const res = this.multiTabChannel.isLeader()
const res = (await this.checkMakeRequest())
? this.makeRequest<BroadcastRequest, BroadcastResponse>(request)
: this.makeRequestBC<BroadcastRequest, BroadcastResponse>(request)

Expand Down Expand Up @@ -2509,6 +2518,14 @@ export class DAppClient extends Client {
return
}

if (await this.addRequestAndCheckIfRateLimited()) {
this.events
.emit(BeaconEvent.LOCAL_RATE_LIMIT_REACHED)
.catch((emitError) => console.warn(emitError))

throw new Error('rate limit reached')
}

const id = await generateGUID()

this.multiTabChannel.postMessage({
Expand All @@ -2517,6 +2534,13 @@ export class DAppClient extends Client {
id
})

if (
request.type !== BeaconMessageType.PermissionRequest ||
(this._activeAccount.isResolved() && (await this._activeAccount.promise))
) {
this.tryToAppSwitch()
}

this.events
.emit(messageEvents[BeaconMessageType.PermissionRequest].sent, {
walletInfo: await this.getWalletInfo(),
Expand Down
22 changes: 11 additions & 11 deletions packages/beacon-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-sdk",
"version": "4.2.2",
"version": "4.3.0",
"description": "The `beacon-sdk` simplifies and abstracts the communication between dApps and wallets over different transport layers.",
"author": "Andreas Gassmann <[email protected]>",
"homepage": "https://walletbeacon.io",
Expand Down Expand Up @@ -35,15 +35,15 @@
"url": "https://github.com/airgap-it/beacon-sdk/issues"
},
"dependencies": {
"@airgap/beacon-blockchain-substrate": "4.2.2",
"@airgap/beacon-blockchain-tezos": "4.2.2",
"@airgap/beacon-core": "4.2.2",
"@airgap/beacon-dapp": "4.2.2",
"@airgap/beacon-transport-matrix": "4.2.2",
"@airgap/beacon-transport-postmessage": "4.2.2",
"@airgap/beacon-types": "4.2.2",
"@airgap/beacon-ui": "4.2.2",
"@airgap/beacon-utils": "4.2.2",
"@airgap/beacon-wallet": "4.2.2"
"@airgap/beacon-blockchain-substrate": "4.3.0",
"@airgap/beacon-blockchain-tezos": "4.3.0",
"@airgap/beacon-core": "4.3.0",
"@airgap/beacon-dapp": "4.3.0",
"@airgap/beacon-transport-matrix": "4.3.0",
"@airgap/beacon-transport-postmessage": "4.3.0",
"@airgap/beacon-types": "4.3.0",
"@airgap/beacon-ui": "4.3.0",
"@airgap/beacon-utils": "4.3.0",
"@airgap/beacon-wallet": "4.3.0"
}
}
6 changes: 3 additions & 3 deletions packages/beacon-transport-matrix/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-transport-matrix",
"version": "4.2.2",
"version": "4.3.0",
"description": "This package contains methods to facilitate communication over the Beacon network, a decentralised P2P network that is based on the matrix protocol.",
"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-core": "4.2.2",
"@airgap/beacon-utils": "4.2.2",
"@airgap/beacon-core": "4.3.0",
"@airgap/beacon-utils": "4.3.0",
"axios": "^1.6.2"
}
}
8 changes: 4 additions & 4 deletions packages/beacon-transport-postmessage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-transport-postmessage",
"version": "4.2.2",
"version": "4.3.0",
"description": "This package contains methods to facilitate communication over the postmessage interface of the browser to talk to browser extensions.",
"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-core": "4.2.2",
"@airgap/beacon-types": "4.2.2",
"@airgap/beacon-utils": "4.2.2"
"@airgap/beacon-core": "4.3.0",
"@airgap/beacon-types": "4.3.0",
"@airgap/beacon-utils": "4.3.0"
}
}
10 changes: 5 additions & 5 deletions packages/beacon-transport-walletconnect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airgap/beacon-transport-walletconnect",
"version": "4.2.2",
"version": "4.3.0",
"description": "This package contains methods to facilitate communication over the WalletConnect network.",
"author": "Papers AG",
"homepage": "https://walletbeacon.io",
Expand Down Expand Up @@ -34,9 +34,9 @@
"url": "https://github.com/airgap-it/beacon-sdk/issues"
},
"dependencies": {
"@airgap/beacon-core": "4.2.2",
"@airgap/beacon-types": "4.2.2",
"@airgap/beacon-utils": "4.2.2",
"@walletconnect/sign-client": "2.11.2"
"@airgap/beacon-core": "4.3.0",
"@airgap/beacon-types": "4.3.0",
"@airgap/beacon-utils": "4.3.0",
"@walletconnect/sign-client": "2.14.0"
}
}
Loading
Loading