-
Notifications
You must be signed in to change notification settings - Fork 65
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 #362 from airgap-it/develop
Develop
- Loading branch information
Showing
51 changed files
with
732 additions
and
207 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
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,6 +1,4 @@ | ||
{ | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "3.1.1" | ||
"packages": ["packages/*"], | ||
"version": "3.1.2" | ||
} |
47 changes: 44 additions & 3 deletions
47
packages/beacon-blockchain-substrate/__tests__/beacon-protocol-substrate.spec.ts
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,7 +1,48 @@ | ||
'use strict' | ||
import { BeaconMessageType } from '@airgap/beacon-types' | ||
import * as chai from 'chai' | ||
import * as chaiAsPromised from 'chai-as-promised' | ||
import 'mocha' | ||
|
||
const beaconProtocolSubstrate = require('..') | ||
// use chai-as-promised plugin | ||
chai.use(chaiAsPromised) | ||
const expect = chai.expect | ||
|
||
import { SubstrateBlockchain, SubstratePermissionScope } from '../src' | ||
|
||
describe('@airgap/beacon-blockchain-substrate', () => { | ||
it('needs tests') | ||
it('should have wallets', async () => { | ||
const blockchain = new SubstrateBlockchain() | ||
|
||
const wallets = await blockchain.getWalletLists() | ||
|
||
expect(Array.isArray(wallets.desktopList)).to.be.true | ||
expect(Array.isArray(wallets.extensionList)).to.be.true | ||
expect(Array.isArray(wallets.iOSList)).to.be.true | ||
expect(Array.isArray(wallets.webList)).to.be.true | ||
}) | ||
|
||
it('should handle a permission response', async () => { | ||
const blockchain = new SubstrateBlockchain() | ||
|
||
const accountInfos = await blockchain.getAccountInfosFromPermissionResponse({ | ||
blockchainIdentifier: 'substrate', | ||
type: BeaconMessageType.PermissionResponse, | ||
blockchainData: { | ||
appMetadata: { senderId: 'sender', name: 'name' }, | ||
scopes: [SubstratePermissionScope.transfer], | ||
accounts: [ | ||
{ | ||
accountId: 'account', | ||
publicKey: 'pubKey', | ||
address: 'address' | ||
} | ||
] | ||
} | ||
}) | ||
|
||
expect(accountInfos.length).to.equal(1) | ||
expect(accountInfos[0].accountId).to.equal('account') | ||
expect(accountInfos[0].publicKey).to.equal('pubKey') | ||
expect(accountInfos[0].address).to.equal('address') | ||
}) | ||
}) |
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.1", | ||
"version": "3.1.2", | ||
"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.1", | ||
"@airgap/beacon-ui": "^3.1.1" | ||
"@airgap/beacon-types": "^3.1.2", | ||
"@airgap/beacon-ui": "^3.1.2" | ||
} | ||
} |
51 changes: 48 additions & 3 deletions
51
packages/beacon-blockchain-tezos-sapling/__tests__/beacon-protocol-tezos-sapling.spec.ts
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,7 +1,52 @@ | ||
'use strict' | ||
import { BeaconMessageType, NetworkType } from '@airgap/beacon-types' | ||
import * as chai from 'chai' | ||
import * as chaiAsPromised from 'chai-as-promised' | ||
import 'mocha' | ||
|
||
const beaconProtocoTezosSapling = require('..') | ||
// use chai-as-promised plugin | ||
chai.use(chaiAsPromised) | ||
const expect = chai.expect | ||
|
||
import { TezosSaplingBlockchain, TezosSaplingPermissionScope } from '../src' | ||
|
||
describe('@airgap/beacon-blockchain-tezos-sapling', () => { | ||
it('needs tests') | ||
it('should have wallets', async () => { | ||
const blockchain = new TezosSaplingBlockchain() | ||
|
||
const wallets = await blockchain.getWalletLists() | ||
|
||
expect(Array.isArray(wallets.desktopList)).to.be.true | ||
expect(Array.isArray(wallets.extensionList)).to.be.true | ||
expect(Array.isArray(wallets.iOSList)).to.be.true | ||
expect(Array.isArray(wallets.webList)).to.be.true | ||
}) | ||
|
||
it('should handle a permission response', async () => { | ||
const blockchain = new TezosSaplingBlockchain() | ||
|
||
const accountInfos = await blockchain.getAccountInfosFromPermissionResponse({ | ||
blockchainIdentifier: 'tezos-sapling', | ||
type: BeaconMessageType.PermissionResponse, | ||
blockchainData: { | ||
appMetadata: { senderId: 'sender', name: 'name' }, | ||
scopes: [TezosSaplingPermissionScope.transfer], | ||
accounts: [ | ||
{ | ||
accountId: 'account', | ||
address: 'zet1...', | ||
viewingKey: 'viewingKey...', | ||
network: { | ||
contract: 'KT1...', | ||
type: NetworkType.MAINNET | ||
} | ||
} | ||
] | ||
} | ||
}) | ||
|
||
expect(accountInfos.length).to.equal(1) | ||
expect(accountInfos[0].accountId).to.equal('account') | ||
expect(accountInfos[0].publicKey).to.equal('viewingKey...') | ||
expect(accountInfos[0].address).to.equal('zet1...') | ||
}) | ||
}) |
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.1", | ||
"version": "3.1.2", | ||
"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.1", | ||
"@airgap/beacon-ui": "^3.1.1" | ||
"@airgap/beacon-types": "^3.1.2", | ||
"@airgap/beacon-ui": "^3.1.2" | ||
} | ||
} |
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
5 changes: 4 additions & 1 deletion
5
packages/beacon-blockchain-tezos-sapling/src/types/message-type.ts
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,7 @@ | ||
export enum TezosSaplingMessageType { | ||
/** | ||
* This message type is used for transfers from one sapling address to another. | ||
*/ | ||
'transfer_request' = 'transfer_request' | ||
// shield, transfer, unshield? | ||
// In a later version, support for shield and unshield operations will most likely be added. | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/beacon-blockchain-tezos-sapling/src/types/permission-scope.ts
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,10 @@ | ||
export enum TezosSaplingPermissionScope { | ||
/** | ||
* The "viewing_key" permission is used to signal to the wallet that a dApp requests access to the viewing key. Sharing the viewing key will give up ALL privacy advantages of sapling, so this permission should only be granted in very specific cases. | ||
*/ | ||
'viewing_key' = 'viewing_key', | ||
/** | ||
* This permission allows wallets to do normal transfers from one sapling account to another. | ||
*/ | ||
'transfer' = 'transfer' | ||
} |
40 changes: 37 additions & 3 deletions
40
packages/beacon-blockchain-tezos/__tests__/beacon-protocol-tezos.spec.ts
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,7 +1,41 @@ | ||
'use strict' | ||
import { BeaconMessageType } from '@airgap/beacon-types' | ||
import * as chai from 'chai' | ||
import * as chaiAsPromised from 'chai-as-promised' | ||
import 'mocha' | ||
|
||
const beaconProtocolTezos = require('..') | ||
// use chai-as-promised plugin | ||
chai.use(chaiAsPromised) | ||
const expect = chai.expect | ||
|
||
import { TezosBlockchain } from '../src' | ||
|
||
describe('@airgap/beacon-blockchain-tezos', () => { | ||
it('needs tests') | ||
it('should have wallets', async () => { | ||
const blockchain = new TezosBlockchain() | ||
|
||
const wallets = await blockchain.getWalletLists() | ||
|
||
expect(Array.isArray(wallets.desktopList)).to.be.true | ||
expect(Array.isArray(wallets.extensionList)).to.be.true | ||
expect(Array.isArray(wallets.iOSList)).to.be.true | ||
expect(Array.isArray(wallets.webList)).to.be.true | ||
}) | ||
|
||
it('should handle a permission response', async () => { | ||
const blockchain = new TezosBlockchain() | ||
|
||
const accountInfos = await blockchain.getAccountInfosFromPermissionResponse({ | ||
blockchainIdentifier: 'tezos', | ||
type: BeaconMessageType.PermissionResponse, | ||
blockchainData: { | ||
appMetadata: { senderId: 'sender', name: 'name' }, | ||
scopes: ['test'] | ||
} | ||
}) | ||
|
||
expect(accountInfos.length).to.equal(1) | ||
expect(accountInfos[0].accountId).to.equal('') | ||
expect(accountInfos[0].publicKey).to.equal('') | ||
expect(accountInfos[0].address).to.equal('') | ||
}) | ||
}) |
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.1", | ||
"version": "3.1.2", | ||
"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.1", | ||
"@airgap/beacon-ui": "^3.1.1" | ||
"@airgap/beacon-types": "^3.1.2", | ||
"@airgap/beacon-ui": "^3.1.2" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
.../__tests__/get-account-identifier.spec.ts → ...sts__/util/get-account-identifier.spec.ts
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
Oops, something went wrong.