-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from airgap-it/develop
Develop
- Loading branch information
Showing
23 changed files
with
159 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"packages": ["packages/*"], | ||
"version": "3.1.3" | ||
"version": "3.1.4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-blockchain-substrate", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
@@ -34,7 +34,7 @@ | |
"url": "https://github.com/airgap-it/beacon-sdk/issues" | ||
}, | ||
"dependencies": { | ||
"@airgap/beacon-types": "^3.1.3", | ||
"@airgap/beacon-ui": "^3.1.3" | ||
"@airgap/beacon-types": "^3.1.4", | ||
"@airgap/beacon-ui": "^3.1.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-blockchain-tezos-sapling", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
@@ -34,7 +34,7 @@ | |
"url": "https://github.com/airgap-it/beacon-sdk/issues" | ||
}, | ||
"dependencies": { | ||
"@airgap/beacon-types": "^3.1.3", | ||
"@airgap/beacon-ui": "^3.1.3" | ||
"@airgap/beacon-types": "^3.1.4", | ||
"@airgap/beacon-ui": "^3.1.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-blockchain-tezos", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
@@ -34,7 +34,7 @@ | |
"url": "https://github.com/airgap-it/beacon-sdk/issues" | ||
}, | ||
"dependencies": { | ||
"@airgap/beacon-types": "^3.1.3", | ||
"@airgap/beacon-ui": "^3.1.3" | ||
"@airgap/beacon-types": "^3.1.4", | ||
"@airgap/beacon-ui": "^3.1.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-core", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
@@ -34,8 +34,8 @@ | |
"url": "https://github.com/airgap-it/beacon-sdk/issues" | ||
}, | ||
"dependencies": { | ||
"@airgap/beacon-types": "^3.1.3", | ||
"@airgap/beacon-utils": "^3.1.2", | ||
"@airgap/beacon-types": "^3.1.4", | ||
"@airgap/beacon-utils": "^3.1.4", | ||
"@types/libsodium-wrappers": "0.7.9", | ||
"bs58check": "2.1.2", | ||
"libsodium-wrappers": "0.7.9" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export const SDK_VERSION: string = '3.1.3' | ||
export const SDK_VERSION: string = '3.1.4' | ||
export const BEACON_VERSION: string = '3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import * as chai from 'chai' | ||
import * as chaiAsPromised from 'chai-as-promised' | ||
import 'mocha' | ||
import * as sinon from 'sinon' | ||
|
||
import { getDAppClientInstance } from '../../src/utils/get-instance' | ||
|
||
// use chai-as-promised plugin | ||
chai.use(chaiAsPromised) | ||
const expect = chai.expect | ||
|
||
describe(`getDAppClientInstance`, () => { | ||
beforeEach(async () => { | ||
sinon.restore() | ||
}) | ||
|
||
it(`should get an instance`, async () => { | ||
const instance = getDAppClientInstance({ name: 'test' }) | ||
|
||
expect(instance).to.not.be.undefined | ||
}) | ||
|
||
it(`should get the same instance`, async () => { | ||
const instance1 = getDAppClientInstance({ name: 'test' }) | ||
const instance2 = getDAppClientInstance({ name: 'test' }) | ||
|
||
expect(instance1).to.equal(instance2) | ||
}) | ||
|
||
it(`should get the same instance with different config`, async () => { | ||
const instance1 = getDAppClientInstance({ name: 'test' }) | ||
const instance2 = getDAppClientInstance({ name: 'test1' }) | ||
|
||
expect(instance1).to.equal(instance2) | ||
}) | ||
|
||
it(`should get a different instance if reset is set`, async () => { | ||
const instance1 = getDAppClientInstance({ name: 'test' }) | ||
const instance2 = getDAppClientInstance({ name: 'test1' }, true) | ||
|
||
expect(instance1).to.not.equal(instance2) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-dapp", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
@@ -35,10 +35,10 @@ | |
"url": "https://github.com/airgap-it/beacon-sdk/issues" | ||
}, | ||
"dependencies": { | ||
"@airgap/beacon-core": "^3.1.3", | ||
"@airgap/beacon-transport-matrix": "^3.1.3", | ||
"@airgap/beacon-transport-postmessage": "^3.1.3", | ||
"@airgap/beacon-ui": "^3.1.3", | ||
"@airgap/beacon-core": "^3.1.4", | ||
"@airgap/beacon-transport-matrix": "^3.1.4", | ||
"@airgap/beacon-transport-postmessage": "^3.1.4", | ||
"@airgap/beacon-ui": "^3.1.4", | ||
"qrcode-generator": "1.4.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { DAppClient, DAppClientOptions } from '..' | ||
|
||
let _instance: DAppClient | undefined | ||
|
||
/** Get a DAppClient instance. Will make sure only one dAppClient exists. After the first instance has been created, the config will be ignored, unless "reset" is set */ | ||
export const getDAppClientInstance = (config: DAppClientOptions, reset?: boolean): DAppClient => { | ||
if (_instance && reset) { | ||
_instance.disconnect() | ||
_instance = undefined | ||
} | ||
|
||
if (_instance) { | ||
return _instance | ||
} | ||
|
||
if (!_instance) { | ||
_instance = new DAppClient(config) | ||
} | ||
|
||
return _instance | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Network, NetworkType } from '@airgap/beacon-types' | ||
import { BlockExplorer } from './block-explorer' | ||
|
||
export class TzktBlockExplorer extends BlockExplorer { | ||
constructor( | ||
public readonly rpcUrls: { [key in NetworkType]: string } = { | ||
[NetworkType.MAINNET]: 'https://tzkt.io', | ||
[NetworkType.GHOSTNET]: 'https://ghostnet.tzkt.io', | ||
[NetworkType.MONDAYNET]: 'https://mondaynet.tzkt.io', | ||
[NetworkType.DAILYNET]: 'https://dailynet.tzkt.io', | ||
[NetworkType.DELPHINET]: 'https://delphinet.tzkt.io', | ||
[NetworkType.EDONET]: 'https://edonet.tzkt.io', | ||
[NetworkType.FLORENCENET]: 'https://florencenet.tzkt.io', | ||
[NetworkType.GRANADANET]: 'https://granadanet.tzkt.io', | ||
[NetworkType.HANGZHOUNET]: 'https://hangzhounet.tzkt.io', | ||
[NetworkType.ITHACANET]: 'https://ithacanet.tzkt.io', | ||
[NetworkType.JAKARTANET]: 'https://jakartanet.tzkt.io', | ||
[NetworkType.KATHMANDUNET]: 'https://kathmandunet.tzkt.io', | ||
[NetworkType.CUSTOM]: 'https://kathmandunet.tzkt.io' | ||
} | ||
) { | ||
super(rpcUrls) | ||
} | ||
|
||
public async getAddressLink(address: string, network: Network): Promise<string> { | ||
const blockExplorer = await this.getLinkForNetwork(network) | ||
|
||
return `${blockExplorer}/${address}` | ||
} | ||
public async getTransactionLink(transactionId: string, network: Network): Promise<string> { | ||
const blockExplorer = await this.getLinkForNetwork(network) | ||
|
||
return `${blockExplorer}/${transactionId}` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-sdk", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
@@ -35,15 +35,15 @@ | |
"url": "https://github.com/airgap-it/beacon-sdk/issues" | ||
}, | ||
"dependencies": { | ||
"@airgap/beacon-blockchain-substrate": "^3.1.3", | ||
"@airgap/beacon-blockchain-tezos": "^3.1.3", | ||
"@airgap/beacon-core": "^3.1.3", | ||
"@airgap/beacon-dapp": "^3.1.3", | ||
"@airgap/beacon-transport-matrix": "^3.1.3", | ||
"@airgap/beacon-transport-postmessage": "^3.1.3", | ||
"@airgap/beacon-types": "^3.1.3", | ||
"@airgap/beacon-ui": "^3.1.3", | ||
"@airgap/beacon-utils": "^3.1.2", | ||
"@airgap/beacon-wallet": "^3.1.3" | ||
"@airgap/beacon-blockchain-substrate": "^3.1.4", | ||
"@airgap/beacon-blockchain-tezos": "^3.1.4", | ||
"@airgap/beacon-core": "^3.1.4", | ||
"@airgap/beacon-dapp": "^3.1.4", | ||
"@airgap/beacon-transport-matrix": "^3.1.4", | ||
"@airgap/beacon-transport-postmessage": "^3.1.4", | ||
"@airgap/beacon-types": "^3.1.4", | ||
"@airgap/beacon-ui": "^3.1.4", | ||
"@airgap/beacon-utils": "^3.1.4", | ||
"@airgap/beacon-wallet": "^3.1.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-transport-matrix", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
@@ -34,8 +34,8 @@ | |
"url": "https://github.com/airgap-it/beacon-sdk/issues" | ||
}, | ||
"dependencies": { | ||
"@airgap/beacon-core": "^3.1.3", | ||
"@airgap/beacon-utils": "^3.1.2", | ||
"@airgap/beacon-core": "^3.1.4", | ||
"@airgap/beacon-utils": "^3.1.4", | ||
"axios": "0.24.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-transport-postmessage", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
@@ -34,9 +34,9 @@ | |
"url": "https://github.com/airgap-it/beacon-sdk/issues" | ||
}, | ||
"dependencies": { | ||
"@airgap/beacon-core": "^3.1.3", | ||
"@airgap/beacon-types": "^3.1.3", | ||
"@airgap/beacon-utils": "^3.1.2", | ||
"@airgap/beacon-core": "^3.1.4", | ||
"@airgap/beacon-types": "^3.1.4", | ||
"@airgap/beacon-utils": "^3.1.4", | ||
"@types/libsodium-wrappers": "0.7.9", | ||
"libsodium-wrappers": "0.7.9" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@airgap/beacon-types", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "> TODO: description", | ||
"author": "Andreas Gassmann <[email protected]>", | ||
"homepage": "https://walletbeacon.io", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.