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

@mcintyre94/addresses

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcintyre94/addresses - npm Package Compare versions

Comparing version 2.0.0-experimental.a537d8d to 2.0.0-experimental.b4ad54e

33

dist/index.browser.js

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

import { mapEncoder, combineCodec } from '@mcintyre94/codecs-core';
import { getStringEncoder, getStringDecoder, getBase58Encoder, getBase58Decoder } from '@mcintyre94/codecs-strings';
import { assertKeyExporterIsAvailable, assertDigestCapabilityIsAvailable } from '@mcintyre94/assertions';
import { mapEncoder, combineCodec } from '@solana/codecs-core';
import { getStringEncoder, getStringDecoder, getBase58Encoder, getBase58Decoder } from '@solana/codecs-strings';
import { assertKeyExporterIsAvailable, assertDigestCapabilityIsAvailable } from '@solana/assertions';

@@ -59,21 +59,13 @@ // src/address.ts

}
function getAddressEncoder(config) {
function getAddressEncoder() {
return mapEncoder(
getStringEncoder({
description: config?.description ?? "Address",
encoding: getMemoizedBase58Encoder(),
size: 32
}),
getStringEncoder({ encoding: getMemoizedBase58Encoder(), size: 32 }),
(putativeAddress) => address(putativeAddress)
);
}
function getAddressDecoder(config) {
return getStringDecoder({
description: config?.description ?? "Address",
encoding: getMemoizedBase58Decoder(),
size: 32
});
function getAddressDecoder() {
return getStringDecoder({ encoding: getMemoizedBase58Decoder(), size: 32 });
}
function getAddressCodec(config) {
return combineCodec(getAddressEncoder(config), getAddressDecoder(config));
function getAddressCodec() {
return combineCodec(getAddressEncoder(), getAddressDecoder());
}

@@ -249,3 +241,3 @@ function getAddressComparator() {

}
return base58EncodedAddressCodec.decode(addressBytes)[0];
return base58EncodedAddressCodec.decode(addressBytes);
}

@@ -289,3 +281,3 @@ async function getProgramDerivedAddress({

const addressBytes = new Uint8Array(addressBytesBuffer);
return decode(addressBytes)[0];
return decode(addressBytes);
}

@@ -298,4 +290,3 @@ async function getAddressFromPublicKey(publicKey) {

const publicKeyBytes = await crypto.subtle.exportKey("raw", publicKey);
const [base58EncodedAddress] = getAddressDecoder().decode(new Uint8Array(publicKeyBytes));
return base58EncodedAddress;
return getAddressDecoder().decode(new Uint8Array(publicKeyBytes));
}

@@ -302,0 +293,0 @@

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

import { mapEncoder, combineCodec } from '@mcintyre94/codecs-core';
import { getStringEncoder, getStringDecoder, getBase58Encoder, getBase58Decoder } from '@mcintyre94/codecs-strings';
import { assertKeyExporterIsAvailable, assertDigestCapabilityIsAvailable } from '@mcintyre94/assertions';
import { mapEncoder, combineCodec } from '@solana/codecs-core';
import { getStringEncoder, getStringDecoder, getBase58Encoder, getBase58Decoder } from '@solana/codecs-strings';
import { assertKeyExporterIsAvailable, assertDigestCapabilityIsAvailable } from '@solana/assertions';

@@ -59,21 +59,13 @@ // src/address.ts

}
function getAddressEncoder(config) {
function getAddressEncoder() {
return mapEncoder(
getStringEncoder({
description: config?.description ?? "Address",
encoding: getMemoizedBase58Encoder(),
size: 32
}),
getStringEncoder({ encoding: getMemoizedBase58Encoder(), size: 32 }),
(putativeAddress) => address(putativeAddress)
);
}
function getAddressDecoder(config) {
return getStringDecoder({
description: config?.description ?? "Address",
encoding: getMemoizedBase58Decoder(),
size: 32
});
function getAddressDecoder() {
return getStringDecoder({ encoding: getMemoizedBase58Decoder(), size: 32 });
}
function getAddressCodec(config) {
return combineCodec(getAddressEncoder(config), getAddressDecoder(config));
function getAddressCodec() {
return combineCodec(getAddressEncoder(), getAddressDecoder());
}

@@ -249,3 +241,3 @@ function getAddressComparator() {

}
return base58EncodedAddressCodec.decode(addressBytes)[0];
return base58EncodedAddressCodec.decode(addressBytes);
}

@@ -289,3 +281,3 @@ async function getProgramDerivedAddress({

const addressBytes = new Uint8Array(addressBytesBuffer);
return decode(addressBytes)[0];
return decode(addressBytes);
}

@@ -298,4 +290,3 @@ async function getAddressFromPublicKey(publicKey) {

const publicKeyBytes = await crypto.subtle.exportKey("raw", publicKey);
const [base58EncodedAddress] = getAddressDecoder().decode(new Uint8Array(publicKeyBytes));
return base58EncodedAddress;
return getAddressDecoder().decode(new Uint8Array(publicKeyBytes));
}

@@ -302,0 +293,0 @@

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

import { mapEncoder, combineCodec } from '@mcintyre94/codecs-core';
import { getStringEncoder, getStringDecoder, getBase58Encoder, getBase58Decoder } from '@mcintyre94/codecs-strings';
import { assertKeyExporterIsAvailable, assertDigestCapabilityIsAvailable } from '@mcintyre94/assertions';
import { mapEncoder, combineCodec } from '@solana/codecs-core';
import { getStringEncoder, getStringDecoder, getBase58Encoder, getBase58Decoder } from '@solana/codecs-strings';
import { assertKeyExporterIsAvailable, assertDigestCapabilityIsAvailable } from '@solana/assertions';

@@ -59,21 +59,13 @@ // src/address.ts

}
function getAddressEncoder(config) {
function getAddressEncoder() {
return mapEncoder(
getStringEncoder({
description: config?.description ?? "Address",
encoding: getMemoizedBase58Encoder(),
size: 32
}),
getStringEncoder({ encoding: getMemoizedBase58Encoder(), size: 32 }),
(putativeAddress) => address(putativeAddress)
);
}
function getAddressDecoder(config) {
return getStringDecoder({
description: config?.description ?? "Address",
encoding: getMemoizedBase58Decoder(),
size: 32
});
function getAddressDecoder() {
return getStringDecoder({ encoding: getMemoizedBase58Decoder(), size: 32 });
}
function getAddressCodec(config) {
return combineCodec(getAddressEncoder(config), getAddressDecoder(config));
function getAddressCodec() {
return combineCodec(getAddressEncoder(), getAddressDecoder());
}

@@ -249,3 +241,3 @@ function getAddressComparator() {

}
return base58EncodedAddressCodec.decode(addressBytes)[0];
return base58EncodedAddressCodec.decode(addressBytes);
}

@@ -289,3 +281,3 @@ async function getProgramDerivedAddress({

const addressBytes = new Uint8Array(addressBytesBuffer);
return decode(addressBytes)[0];
return decode(addressBytes);
}

@@ -298,4 +290,3 @@ async function getAddressFromPublicKey(publicKey) {

const publicKeyBytes = await crypto.subtle.exportKey("raw", publicKey);
const [base58EncodedAddress] = getAddressDecoder().decode(new Uint8Array(publicKeyBytes));
return base58EncodedAddress;
return getAddressDecoder().decode(new Uint8Array(publicKeyBytes));
}

@@ -302,0 +293,0 @@

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

import { Codec, Decoder, Encoder } from '@mcintyre94/codecs-core';
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
export type Address<TAddress extends string = string> = TAddress & {

@@ -8,12 +8,6 @@ readonly __brand: unique symbol;

export declare function address<TAddress extends string = string>(putativeAddress: TAddress): Address<TAddress>;
export declare function getAddressEncoder(config?: Readonly<{
description: string;
}>): Encoder<Address>;
export declare function getAddressDecoder(config?: Readonly<{
description: string;
}>): Decoder<Address>;
export declare function getAddressCodec(config?: Readonly<{
description: string;
}>): Codec<Address>;
export declare function getAddressEncoder(): FixedSizeEncoder<Address, 32>;
export declare function getAddressDecoder(): FixedSizeDecoder<Address, 32>;
export declare function getAddressCodec(): FixedSizeCodec<Address, Address, 32>;
export declare function getAddressComparator(): (x: string, y: string) => number;
//# sourceMappingURL=address.d.ts.map
{
"name": "@mcintyre94/addresses",
"version": "2.0.0-experimental.a537d8d",
"version": "2.0.0-experimental.b4ad54e",
"description": "Helpers for generating account addresses",

@@ -52,5 +52,5 @@ "exports": {

"dependencies": {
"@mcintyre94/assertions": "2.0.0-experimental.a537d8d",
"@mcintyre94/codecs-strings": "2.0.0-experimental.a537d8d",
"@mcintyre94/codecs-core": "2.0.0-experimental.a537d8d"
"@solana/codecs-core": "npm:@mcintyre94/codecs-core@2.0.0-development",
"@solana/codecs-strings": "npm:@mcintyre94/codecs-strings@2.0.0-development",
"@solana/assertions": "npm:@mcintyre94/assertions@2.0.0-development"
},

@@ -60,4 +60,4 @@ "devDependencies": {

"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.3.0",

@@ -89,6 +89,6 @@ "agadoo": "^3.0.0",

"scripts": {
"compile:js": "tsup --config build-scripts/tsup.config.library.ts",
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/build-scripts/add-js-extension-to-types.mjs",
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
"publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
"publish-packages": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag experimental --access public --no-git-checks",
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",

@@ -95,0 +95,0 @@ "test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",

@@ -85,3 +85,3 @@ [![npm][npm-image]][npm-url]

In the event that you receive an address/bump-seed tuple from some untrusted source, you can assert that such an tuple conforms to the `ProgramDerivedAddress` type using this function.
In the event that you receive an address/bump-seed tuple from some untrusted source, you can assert that such a tuple conforms to the `ProgramDerivedAddress` type using this function.

@@ -118,3 +118,3 @@ See [`assertIsAddress()`](#assertisaddress) for an example of how to use an assertion function.

const addressDecoder = getAddressDecoder();
const [address, offset] = addressDecoder.decode(address); // [B9Lf9z5BfNPT4d5KMeaBFx8x1G4CULZYR1jA2kmxRDka, 32]
const address = addressDecoder.decode(address); // B9Lf9z5BfNPT4d5KMeaBFx8x1G4CULZYR1jA2kmxRDka
```

@@ -121,0 +121,0 @@

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

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

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