@airgap/beacon-transport-postmessage
Advanced tools
Comparing version 0.0.1-beta.7 to 0.0.1-beta.8
@@ -26,21 +26,2 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -84,3 +65,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
exports.PostMessageClient = void 0; | ||
var sodium = __importStar(require("libsodium-wrappers")); | ||
var libsodium_wrappers_1 = require("libsodium-wrappers"); | ||
var beacon_core_1 = require("@airgap/beacon-core"); | ||
@@ -189,4 +170,3 @@ var beacon_utils_1 = require("@airgap/beacon-utils"); | ||
payload = Buffer.from(data.payload, 'hex'); | ||
if (!(payload.length >= | ||
sodium.crypto_secretbox_NONCEBYTES + sodium.crypto_secretbox_MACBYTES)) return [3 /*break*/, 7]; | ||
if (!(payload.length >= libsodium_wrappers_1.crypto_secretbox_NONCEBYTES + libsodium_wrappers_1.crypto_secretbox_MACBYTES)) return [3 /*break*/, 7]; | ||
_j.label = 3; | ||
@@ -193,0 +173,0 @@ case 3: |
@@ -1,2 +0,2 @@ | ||
import * as sodium from 'libsodium-wrappers'; | ||
import { KeyPair } from 'libsodium-wrappers'; | ||
import { PostMessagePairingRequest, ExtendedPostMessagePairingResponse, Extension, StorageKey, TransportType } from '@airgap/beacon-types'; | ||
@@ -13,3 +13,3 @@ import { Storage } from '@airgap/beacon-types'; | ||
readonly type: TransportType; | ||
constructor(name: string, keyPair: sodium.KeyPair, storage: Storage, storageKey: K); | ||
constructor(name: string, keyPair: KeyPair, storage: Storage, storageKey: K); | ||
static isAvailable(): Promise<boolean>; | ||
@@ -16,0 +16,0 @@ static getAvailableExtensions(): Promise<Extension[]>; |
@@ -10,3 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import * as sodium from 'libsodium-wrappers'; | ||
import { crypto_secretbox_NONCEBYTES, crypto_secretbox_MACBYTES } from 'libsodium-wrappers'; | ||
import { windowRef, Serializer, getSenderId, MessageBasedClient } from '@airgap/beacon-core'; | ||
@@ -74,4 +74,3 @@ import { openCryptobox } from '@airgap/beacon-utils'; | ||
const payload = Buffer.from(data.payload, 'hex'); | ||
if (payload.length >= | ||
sodium.crypto_secretbox_NONCEBYTES + sodium.crypto_secretbox_MACBYTES) { | ||
if (payload.length >= crypto_secretbox_NONCEBYTES + crypto_secretbox_MACBYTES) { | ||
try { | ||
@@ -78,0 +77,0 @@ const pairingResponse = JSON.parse(yield openCryptobox(payload, this.keyPair.publicKey, this.keyPair.privateKey)); |
@@ -1,2 +0,2 @@ | ||
import * as sodium from 'libsodium-wrappers'; | ||
import { KeyPair } from 'libsodium-wrappers'; | ||
import { PostMessagePairingRequest, ExtendedPostMessagePairingResponse, Extension, StorageKey, TransportType } from '@airgap/beacon-types'; | ||
@@ -13,3 +13,3 @@ import { Storage } from '@airgap/beacon-types'; | ||
readonly type: TransportType; | ||
constructor(name: string, keyPair: sodium.KeyPair, storage: Storage, storageKey: K); | ||
constructor(name: string, keyPair: KeyPair, storage: Storage, storageKey: K); | ||
static isAvailable(): Promise<boolean>; | ||
@@ -16,0 +16,0 @@ static getAvailableExtensions(): Promise<Extension[]>; |
{ | ||
"name": "@airgap/beacon-transport-postmessage", | ||
"version": "0.0.1-beta.7", | ||
"version": "0.0.1-beta.8", | ||
"description": "> TODO: description", | ||
@@ -37,9 +37,9 @@ "author": "Andreas Gassmann <andreas@andreasgassmann.ch>", | ||
"dependencies": { | ||
"@airgap/beacon-core": "^0.0.1-beta.7", | ||
"@airgap/beacon-types": "^0.0.1-beta.7", | ||
"@airgap/beacon-utils": "^0.0.1-beta.7", | ||
"@airgap/beacon-core": "^0.0.1-beta.8", | ||
"@airgap/beacon-types": "^0.0.1-beta.8", | ||
"@airgap/beacon-utils": "^0.0.1-beta.8", | ||
"@types/libsodium-wrappers": "0.7.9", | ||
"libsodium-wrappers": "0.7.9" | ||
}, | ||
"gitHead": "0ea37ab7d4ee6ec01156a915434e43a0982a365c" | ||
"gitHead": "3d993abfd36cfb265295e19093569aff970374a5" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
58603
824