New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

anchor-link

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchor-link - npm Package Compare versions

Comparing version 3.5.1 to 3.6.0

20

lib/anchor-link.d.ts
/**
* Anchor Link v3.5.1
* Anchor Link v3.6.0
* https://github.com/greymass/anchor-link

@@ -36,8 +36,8 @@ *

*/
import * as _greymass_eosio from '@greymass/eosio';
import { Name, PublicKey, PermissionLevel, NameType, PermissionLevelType, PublicKeyType, PrivateKeyType, Bytes, APIClient, AnyTransaction, AnyAction, Signature, Transaction, API, ABIDef, ABISerializable } from '@greymass/eosio';
export * from '@greymass/eosio';
import { CallbackPayload, ChainId, ChainIdType, SigningRequest, ResolvedSigningRequest, ResolvedTransaction, IdentityProof, AbiProvider, SigningRequestCreateArguments } from 'eosio-signing-request';
export * from 'eosio-signing-request';
export { CallbackPayload, ChainId, ChainIdType, ChainName, IdentityProof, IdentityProofType } from 'eosio-signing-request';
import * as _wharfkit_antelope from '@wharfkit/antelope';
import { Name, PublicKey, PermissionLevel, NameType, PermissionLevelType, PublicKeyType, PrivateKeyType, Bytes, APIClient, AnyTransaction, AnyAction, Signature, Transaction, API, ABIDef, ABISerializable } from '@wharfkit/antelope';
export * from '@wharfkit/antelope';
import { CallbackPayload, ChainId, ChainIdType, SigningRequest, ResolvedSigningRequest, ResolvedTransaction, IdentityProof, AbiProvider, SigningRequestCreateArguments } from '@wharfkit/signing-request';
export * from '@wharfkit/signing-request';
export { CallbackPayload, ChainId, ChainIdType, ChainName, IdentityProof, IdentityProofType } from '@wharfkit/signing-request';

@@ -120,3 +120,3 @@ /** Service that handles waiting for a ESR callback to be sent to an url. */

/** API client for the chain this session is valid on. */
get client(): _greymass_eosio.APIClient;
get client(): _wharfkit_antelope.APIClient;
/** Restore a previously serialized session. */

@@ -267,3 +267,3 @@ static restore(link: Link, data: SerializedLinkSession): LinkSession;

/**
* URL to EOSIO node to communicate with (or a @greymass/eosio APIClient instance).
* URL to EOSIO node to communicate with (or a @wharfkit/antelope APIClient instance).
*/

@@ -303,3 +303,3 @@ nodeUrl: string | APIClient;

/**
* URL to EOSIO node to communicate with or a `@greymass/eosio` APIClient instance.
* URL to EOSIO node to communicate with or a `@wharfkit/antelope` APIClient instance.
* @deprecated Use [[chains]] instead.

@@ -306,0 +306,0 @@ */

/**
* Anchor Link v3.5.1
* Anchor Link v3.6.0
* https://github.com/greymass/anchor-link

@@ -40,4 +40,4 @@ *

var zlib = require('pako');
var eosio = require('@greymass/eosio');
var eosioSigningRequest = require('eosio-signing-request');
var antelope = require('@wharfkit/antelope');
var signingRequest = require('@wharfkit/signing-request');
var makeFetch = require('fetch-ponyfill');

@@ -84,4 +84,4 @@ var miniaes = require('@greymass/miniaes');

var zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
var eosio__namespace = /*#__PURE__*/_interopNamespace(eosio);
var eosioSigningRequest__namespace = /*#__PURE__*/_interopNamespace(eosioSigningRequest);
var antelope__namespace = /*#__PURE__*/_interopNamespace(antelope);
var signingRequest__namespace = /*#__PURE__*/_interopNamespace(signingRequest);
var makeFetch__default = /*#__PURE__*/_interopDefaultLegacy(makeFetch);

@@ -133,40 +133,40 @@ var WebSocket__default = /*#__PURE__*/_interopDefaultLegacy(WebSocket);

let SealedMessage = class SealedMessage extends eosio.Struct {
let SealedMessage = class SealedMessage extends antelope.Struct {
};
tslib.__decorate([
eosio.Struct.field('public_key')
antelope.Struct.field('public_key')
], SealedMessage.prototype, "from", void 0);
tslib.__decorate([
eosio.Struct.field('uint64')
antelope.Struct.field('uint64')
], SealedMessage.prototype, "nonce", void 0);
tslib.__decorate([
eosio.Struct.field('bytes')
antelope.Struct.field('bytes')
], SealedMessage.prototype, "ciphertext", void 0);
tslib.__decorate([
eosio.Struct.field('uint32')
antelope.Struct.field('uint32')
], SealedMessage.prototype, "checksum", void 0);
SealedMessage = tslib.__decorate([
eosio.Struct.type('sealed_message')
antelope.Struct.type('sealed_message')
], SealedMessage);
let LinkCreate = class LinkCreate extends eosio.Struct {
let LinkCreate = class LinkCreate extends antelope.Struct {
};
tslib.__decorate([
eosio.Struct.field('name')
antelope.Struct.field('name')
], LinkCreate.prototype, "session_name", void 0);
tslib.__decorate([
eosio.Struct.field('public_key')
antelope.Struct.field('public_key')
], LinkCreate.prototype, "request_key", void 0);
tslib.__decorate([
eosio.Struct.field('string', { extension: true })
antelope.Struct.field('string', { extension: true })
], LinkCreate.prototype, "user_agent", void 0);
LinkCreate = tslib.__decorate([
eosio.Struct.type('link_create')
antelope.Struct.type('link_create')
], LinkCreate);
let LinkInfo = class LinkInfo extends eosio.Struct {
let LinkInfo = class LinkInfo extends antelope.Struct {
};
tslib.__decorate([
eosio.Struct.field('time_point_sec')
antelope.Struct.field('time_point_sec')
], LinkInfo.prototype, "expiration", void 0);
LinkInfo = tslib.__decorate([
eosio.Struct.type('link_info')
antelope.Struct.type('link_info')
], LinkInfo);

@@ -183,8 +183,8 @@

if (!nonce) {
nonce = eosio.UInt64.random();
nonce = antelope.UInt64.random();
}
const key = eosio.Checksum512.hash(eosio.Serializer.encode({ object: nonce }).appending(secret.array));
const key = antelope.Checksum512.hash(antelope.Serializer.encode({ object: nonce }).appending(secret.array));
const cbc = new miniaes.AES_CBC(key.array.slice(0, 32), key.array.slice(32, 48));
const ciphertext = eosio.Bytes.from(cbc.encrypt(eosio.Bytes.from(message, 'utf8').array));
const checksumView = new DataView(eosio.Checksum256.hash(key.array).array.buffer);
const ciphertext = antelope.Bytes.from(cbc.encrypt(antelope.Bytes.from(message, 'utf8').array));
const checksumView = new DataView(antelope.Checksum256.hash(key.array).array.buffer);
const checksum = checksumView.getUint32(0, true);

@@ -296,8 +296,8 @@ return SealedMessage.from({

this.link = link;
this.chainId = eosioSigningRequest.ChainId.from(data.chainId);
this.auth = eosio.PermissionLevel.from(data.auth);
this.publicKey = eosio.PublicKey.from(data.publicKey);
this.identifier = eosio.Name.from(data.identifier);
const privateKey = eosio.PrivateKey.from(data.requestKey);
this.channelKey = eosio.PublicKey.from(data.channel.key);
this.chainId = signingRequest.ChainId.from(data.chainId);
this.auth = antelope.PermissionLevel.from(data.auth);
this.publicKey = antelope.PublicKey.from(data.publicKey);
this.identifier = antelope.Name.from(data.identifier);
const privateKey = antelope.PrivateKey.from(data.requestKey);
this.channelKey = antelope.PublicKey.from(data.channel.key);
this.channelUrl = data.channel.url;

@@ -341,3 +341,3 @@ this.channelName = data.channel.name;

let payloadSent = false;
const payload = eosio.Serializer.encode({ object: this.encrypt(request) });
const payload = antelope.Serializer.encode({ object: this.encrypt(request) });
if (this.link.transport.sendSessionPayload) {

@@ -411,3 +411,3 @@ try {

this.channelUrl = res.payload.link_ch;
this.channelKey = eosio.PublicKey.from(res.payload.link_key);
this.channelKey = antelope.PublicKey.from(res.payload.link_key);
this.channelName = res.payload.link_name;

@@ -434,7 +434,7 @@ metadata.name = res.payload.link_name;

this.link = link;
this.auth = eosio.PermissionLevel.from(data.auth);
this.publicKey = eosio.PublicKey.from(data.publicKey);
this.chainId = eosioSigningRequest.ChainId.from(data.chainId);
this.auth = antelope.PermissionLevel.from(data.auth);
this.publicKey = antelope.PublicKey.from(data.publicKey);
this.chainId = signingRequest.ChainId.from(data.chainId);
this.metadata = metadata || {};
this.identifier = eosio.Name.from(data.identifier);
this.identifier = antelope.Name.from(data.identifier);
this.serialize = () => ({

@@ -633,5 +633,5 @@ type: this.type,

this.pendingAbis = new Map();
this.chainId = eosioSigningRequest.ChainId.from(chainId);
this.chainId = signingRequest.ChainId.from(chainId);
this.client =
typeof clientOrUrl === 'string' ? new eosio.APIClient({ url: clientOrUrl }) : clientOrUrl;
typeof clientOrUrl === 'string' ? new antelope.APIClient({ url: clientOrUrl }) : clientOrUrl;
}

@@ -757,3 +757,3 @@ /**

}
const id = eosioSigningRequest.ChainId.from(chain);
const id = signingRequest.ChainId.from(chain);
const rv = this.chains.find((c) => c.chainId.equals(id));

@@ -775,7 +775,7 @@ if (!rv) {

const c = chain || this.chains[0];
request = yield eosioSigningRequest.SigningRequest.create(Object.assign(Object.assign({}, args), { chainId: c.chainId, broadcast: false }), { abiProvider: c, zlib: zlib__default["default"] });
request = yield signingRequest.SigningRequest.create(Object.assign(Object.assign({}, args), { chainId: c.chainId, broadcast: false }), { abiProvider: c, zlib: zlib__default["default"] });
}
else {
// multi-chain request
request = yield eosioSigningRequest.SigningRequest.create(Object.assign(Object.assign({}, args), { chainId: null, chainIds: this.encodeChainIds ? this.chains.map((c) => c.chainId) : undefined, broadcast: false }),
request = yield signingRequest.SigningRequest.create(Object.assign(Object.assign({}, args), { chainId: null, chainIds: this.encodeChainIds ? this.chains.map((c) => c.chainId) : undefined, broadcast: false }),
// abi's will be pulled from the first chain and assumed to be identical on all chains

@@ -830,3 +830,3 @@ { abiProvider: this.chains[0], zlib: zlib__default["default"] });

const payload = callbackResponse;
const signer = eosio.PermissionLevel.from({
const signer = antelope.PermissionLevel.from({
actor: payload.sa,

@@ -837,3 +837,3 @@ permission: payload.sp,

.filter((key) => key.startsWith('sig') && key !== 'sig0')
.map((key) => eosio.Signature.from(payload[key]));
.map((key) => antelope.Signature.from(payload[key]));
let c;

@@ -853,3 +853,3 @@ if (!chain && this.chains.length > 1) {

// recreate transaction from request response
const resolved = yield eosioSigningRequest.ResolvedSigningRequest.fromPayload(payload, {
const resolved = yield signingRequest.ResolvedSigningRequest.fromPayload(payload, {
zlib: zlib__default["default"],

@@ -860,3 +860,3 @@ abiProvider: c,

const cosignerSig = resolved.request.getInfoKey('cosig', {
type: eosio.Signature,
type: antelope.Signature,
array: true,

@@ -877,3 +877,3 @@ });

if (broadcast) {
const signedTx = eosio.SignedTransaction.from(Object.assign(Object.assign({}, resolved.transaction), { signatures }));
const signedTx = antelope.SignedTransaction.from(Object.assign(Object.assign({}, resolved.transaction), { signatures }));
const res = yield c.client.v1.chain.push_transaction(signedTx);

@@ -974,5 +974,5 @@ result.processed = res.processed;

if (args.requestPermission) {
const perm = eosio.PermissionLevel.from(args.requestPermission);
if ((!perm.actor.equals(eosioSigningRequest.PlaceholderName) && !perm.actor.equals(proof.signer.actor)) ||
(!perm.permission.equals(eosioSigningRequest.PlaceholderPermission) &&
const perm = antelope.PermissionLevel.from(args.requestPermission);
if ((!perm.actor.equals(signingRequest.PlaceholderName) && !perm.actor.equals(proof.signer.actor)) ||
(!perm.permission.equals(signingRequest.PlaceholderPermission) &&
!perm.permission.equals(proof.signer.permission))) {

@@ -993,3 +993,3 @@ throw new IdentityError(`Identity proof singed by ${proof.signer}, expected: ${formatAuth(perm)} `);

return tslib.__awaiter(this, void 0, void 0, function* () {
const privateKey = eosio.PrivateKey.generate('K1');
const privateKey = antelope.PrivateKey.generate('K1');
const requestKey = privateKey.toPublic();

@@ -1053,3 +1053,3 @@ const createInfo = LinkCreate.from({

// both auth and chain id given, we can look up on specific key
key = this.sessionKey(identifier, formatAuth(eosio.PermissionLevel.from(auth)), String(eosioSigningRequest.ChainId.from(chainId)));
key = this.sessionKey(identifier, formatAuth(antelope.PermissionLevel.from(auth)), String(signingRequest.ChainId.from(chainId)));
}

@@ -1063,3 +1063,3 @@ else {

if (chainId) {
const id = eosioSigningRequest.ChainId.from(chainId);
const id = signingRequest.ChainId.from(chainId);
list = list.filter((item) => item.chainId.equals(id));

@@ -1111,4 +1111,4 @@ }

return list.map(({ auth, chainId }) => ({
auth: eosio.PermissionLevel.from(auth),
chainId: eosioSigningRequest.ChainId.from(chainId),
auth: antelope.PermissionLevel.from(auth),
chainId: signingRequest.ChainId.from(chainId),
}));

@@ -1159,3 +1159,3 @@ });

const c = chain ? this.getChain(chain) : this.chains[0];
let request = eosioSigningRequest.SigningRequest.fromTransaction(args.chainId, args.serializedTransaction, { abiProvider: c, zlib: zlib__default["default"] });
let request = signingRequest.SigningRequest.fromTransaction(args.chainId, args.serializedTransaction, { abiProvider: c, zlib: zlib__default["default"] });
const callback = this.callbackService.create();

@@ -1168,3 +1168,3 @@ request.setCallback(callback.url, true);

const { transaction, signatures } = yield this.sendRequest(request, callback, c, t);
const serializedTransaction = eosio.Serializer.encode({ object: transaction });
const serializedTransaction = antelope.Serializer.encode({ object: transaction });
return Object.assign(Object.assign({}, args), { serializedTransaction,

@@ -1206,3 +1206,3 @@ signatures });

sessionKey(identifier, ...suffix) {
return [String(eosio.Name.from(identifier)), ...suffix].join('-');
return [String(antelope.Name.from(identifier)), ...suffix].join('-');
}

@@ -1222,3 +1222,3 @@ /**

/** Package version. */
Link.version = '3.5.1'; // eslint-disable-line @typescript-eslint/no-inferrable-types
Link.version = '3.6.0'; // eslint-disable-line @typescript-eslint/no-inferrable-types
/**

@@ -1229,6 +1229,6 @@ * Format a EOSIO permission level in the format `actor@permission` taking placeholders into consideration.

function formatAuth(auth) {
const a = eosio.PermissionLevel.from(auth);
const actor = a.actor.equals(eosioSigningRequest.PlaceholderName) ? '<any>' : String(a.actor);
const a = antelope.PermissionLevel.from(auth);
const actor = a.actor.equals(signingRequest.PlaceholderName) ? '<any>' : String(a.actor);
let permission;
if (a.permission.equals(eosioSigningRequest.PlaceholderName) || a.permission.equals(eosioSigningRequest.PlaceholderPermission)) {
if (a.permission.equals(signingRequest.PlaceholderName) || a.permission.equals(signingRequest.PlaceholderPermission)) {
permission = '<any>';

@@ -1247,5 +1247,5 @@ }

'default': Link,
IdentityProof: eosioSigningRequest.IdentityProof,
ChainId: eosioSigningRequest.ChainId,
ChainName: eosioSigningRequest.ChainName,
IdentityProof: signingRequest.IdentityProof,
ChainId: signingRequest.ChainId,
ChainName: signingRequest.ChainName,
LinkChain: LinkChain,

@@ -1259,3 +1259,3 @@ Link: Link,

SessionError: SessionError
}, [eosioSigningRequest__namespace, eosio__namespace]);
}, [signingRequest__namespace, antelope__namespace]);

@@ -1262,0 +1262,0 @@ const AnchorLink = Link;

/**
* Anchor Link v3.5.1
* Anchor Link v3.6.0
* https://github.com/greymass/anchor-link

@@ -37,7 +37,7 @@ *

import zlib from 'pako';
import { Struct, UInt64, Checksum512, Serializer, Bytes, Checksum256, PermissionLevel, PublicKey, Name, PrivateKey, APIClient, Signature, SignedTransaction } from '@greymass/eosio';
export * from '@greymass/eosio';
import { ChainId, SigningRequest, ResolvedSigningRequest, PlaceholderName, PlaceholderPermission } from 'eosio-signing-request';
export * from 'eosio-signing-request';
export { ChainId, ChainName, IdentityProof } from 'eosio-signing-request';
import { Struct, UInt64, Checksum512, Serializer, Bytes, Checksum256, PermissionLevel, PublicKey, Name, PrivateKey, APIClient, Signature, SignedTransaction } from '@wharfkit/antelope';
export * from '@wharfkit/antelope';
import { ChainId, SigningRequest, ResolvedSigningRequest, PlaceholderName, PlaceholderPermission } from '@wharfkit/signing-request';
export * from '@wharfkit/signing-request';
export { ChainId, ChainName, IdentityProof } from '@wharfkit/signing-request';
import { __decorate } from 'tslib';

@@ -1169,3 +1169,3 @@ import makeFetch from 'fetch-ponyfill';

/** Package version. */
Link.version = '3.5.1'; // eslint-disable-line @typescript-eslint/no-inferrable-types
Link.version = '3.6.0'; // eslint-disable-line @typescript-eslint/no-inferrable-types
/**

@@ -1172,0 +1172,0 @@ * Format a EOSIO permission level in the format `actor@permission` taking placeholders into consideration.

{
"name": "anchor-link",
"version": "3.5.1",
"version": "3.6.0",
"description": "Library for authenticating and signing transactions using the Anchor Link protocol",

@@ -37,5 +37,5 @@ "license": "BSD-3-Clause",

"dependencies": {
"@greymass/eosio": "^0.6.0",
"@greymass/miniaes": "^1.0.0",
"eosio-signing-request": "^2.5.0",
"@wharfkit/antelope": "^1.0.7",
"@wharfkit/signing-request": "^3.2.0",
"fetch-ponyfill": "^7.1.0",

@@ -42,0 +42,0 @@ "isomorphic-ws": "^4.0.1",

@@ -20,2 +20,2 @@ export * from './link'

ChainName,
} from 'eosio-signing-request'
} from '@wharfkit/signing-request'

@@ -9,3 +9,3 @@ // export library

// expose dependencies
export * from 'eosio-signing-request'
export * from '@greymass/eosio'
export * from '@wharfkit/signing-request'
export * from '@wharfkit/antelope'
import {v4 as uuid} from 'uuid'
import {CallbackPayload} from 'eosio-signing-request'
import {CallbackPayload} from '@wharfkit/signing-request'
import WebSocket from 'isomorphic-ws'

@@ -4,0 +4,0 @@

@@ -1,3 +0,3 @@

import type {APIClient} from '@greymass/eosio'
import type {ChainIdType} from 'eosio-signing-request'
import type {APIClient} from '@wharfkit/antelope'
import type {ChainIdType} from '@wharfkit/signing-request'

@@ -18,3 +18,3 @@ import type {LinkCallbackService} from './link-callback'

/**
* URL to EOSIO node to communicate with (or a @greymass/eosio APIClient instance).
* URL to EOSIO node to communicate with (or a @wharfkit/antelope APIClient instance).
*/

@@ -55,3 +55,3 @@ nodeUrl: string | APIClient

/**
* URL to EOSIO node to communicate with or a `@greymass/eosio` APIClient instance.
* URL to EOSIO node to communicate with or a `@wharfkit/antelope` APIClient instance.
* @deprecated Use [[chains]] instead.

@@ -58,0 +58,0 @@ */

@@ -11,5 +11,5 @@ import {

Serializer,
} from '@greymass/eosio'
} from '@wharfkit/antelope'
import {ChainId, ChainIdType, SigningRequest} from 'eosio-signing-request'
import {ChainId, ChainIdType, SigningRequest} from '@wharfkit/signing-request'

@@ -16,0 +16,0 @@ import {SessionError} from './errors'

@@ -1,3 +0,3 @@

import type {Bytes} from '@greymass/eosio'
import type {SigningRequest} from 'eosio-signing-request'
import type {Bytes} from '@wharfkit/antelope'
import type {SigningRequest} from '@wharfkit/signing-request'

@@ -4,0 +4,0 @@ import type {TransactResult} from './link'

@@ -1,2 +0,2 @@

import {Bytes, Name, PublicKey, Struct, TimePointSec, UInt32, UInt64} from '@greymass/eosio'
import {Bytes, Name, PublicKey, Struct, TimePointSec, UInt32, UInt64} from '@wharfkit/antelope'

@@ -3,0 +3,0 @@ @Struct.type('sealed_message')

@@ -20,3 +20,3 @@ import zlib from 'pako'

Transaction,
} from '@greymass/eosio'
} from '@wharfkit/antelope'

@@ -35,3 +35,3 @@ import {

SigningRequestCreateArguments,
} from 'eosio-signing-request'
} from '@wharfkit/signing-request'

@@ -38,0 +38,0 @@ import {CancelError, IdentityError} from './errors'

@@ -11,4 +11,4 @@ import makeFetch from 'fetch-ponyfill'

UInt64,
} from '@greymass/eosio'
import {CallbackPayload, SigningRequest} from 'eosio-signing-request'
} from '@wharfkit/antelope'
import {CallbackPayload, SigningRequest} from '@wharfkit/signing-request'

@@ -15,0 +15,0 @@ import {SealedMessage} from './link-types'

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc