Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solana/transaction-messages

Package Overview
Dependencies
Maintainers
15
Versions
695
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/transaction-messages - npm Package Compare versions

Comparing version 2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af to 2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38

dist/types/codecs/transaction-version.d.ts

42

dist/index.browser.js

@@ -1,5 +0,5 @@

import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { assertIsBlockhash } from '@solana/rpc-types';
import { getAddressEncoder, getAddressDecoder, getAddressComparator } from '@solana/addresses';
import { combineCodec, transformEncoder, addEncoderSizePrefix, transformDecoder, addDecoderSizePrefix } from '@solana/codecs-core';
import { combineCodec, transformEncoder, addEncoderSizePrefix, transformDecoder, addDecoderSizePrefix, createEncoder, createDecoder } from '@solana/codecs-core';
import { getStructEncoder, getArrayEncoder, getStructDecoder, getArrayDecoder, getStructCodec, getBytesEncoder, getBytesDecoder } from '@solana/codecs-data-structures';

@@ -162,2 +162,38 @@ import { getU8Encoder, getShortU16Encoder, getU8Decoder, getShortU16Decoder, getU8Codec } from '@solana/codecs-numbers';

}
var VERSION_FLAG_MASK = 128;
function getTransactionVersionEncoder() {
return createEncoder({
getSizeFromValue: (value) => value === "legacy" ? 0 : 1,
maxSize: 1,
write: (value, bytes, offset) => {
if (value === "legacy") {
return offset;
}
if (value < 0 || value > 127) {
throw new SolanaError(SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE, {
actualVersion: value
});
}
bytes.set([value | VERSION_FLAG_MASK], offset);
return offset + 1;
}
});
}
function getTransactionVersionDecoder() {
return createDecoder({
maxSize: 1,
read: (bytes, offset) => {
const firstByte = bytes[offset];
if ((firstByte & VERSION_FLAG_MASK) === 0) {
return ["legacy", offset];
} else {
const version = firstByte ^ VERSION_FLAG_MASK;
return [version, offset + 1];
}
}
});
}
function getTransactionVersionCodec() {
return combineCodec(getTransactionVersionEncoder(), getTransactionVersionDecoder());
}
var AddressMapEntryType = /* @__PURE__ */ ((AddressMapEntryType2) => {

@@ -546,4 +582,4 @@ AddressMapEntryType2[AddressMapEntryType2["FEE_PAYER"] = 0] = "FEE_PAYER";

export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getCompiledInstructions, getCompiledLifetimeToken, getCompiledMessageHeader, getCompiledStaticAccounts, getInstructionCodec, getInstructionDecoder, getInstructionEncoder, getMessageHeaderCodec, getMessageHeaderDecoder, getMessageHeaderEncoder, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getCompiledInstructions, getCompiledLifetimeToken, getCompiledMessageHeader, getCompiledStaticAccounts, getInstructionCodec, getInstructionDecoder, getInstructionEncoder, getMessageHeaderCodec, getMessageHeaderDecoder, getMessageHeaderEncoder, getOrderedAccountsFromAddressMap, getTransactionVersionCodec, getTransactionVersionDecoder, getTransactionVersionEncoder, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.browser.js.map

@@ -1,5 +0,5 @@

import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { assertIsBlockhash } from '@solana/rpc-types';
import { getAddressEncoder, getAddressDecoder, getAddressComparator } from '@solana/addresses';
import { combineCodec, transformEncoder, addEncoderSizePrefix, transformDecoder, addDecoderSizePrefix } from '@solana/codecs-core';
import { combineCodec, transformEncoder, addEncoderSizePrefix, transformDecoder, addDecoderSizePrefix, createEncoder, createDecoder } from '@solana/codecs-core';
import { getStructEncoder, getArrayEncoder, getStructDecoder, getArrayDecoder, getStructCodec, getBytesEncoder, getBytesDecoder } from '@solana/codecs-data-structures';

@@ -162,2 +162,38 @@ import { getU8Encoder, getShortU16Encoder, getU8Decoder, getShortU16Decoder, getU8Codec } from '@solana/codecs-numbers';

}
var VERSION_FLAG_MASK = 128;
function getTransactionVersionEncoder() {
return createEncoder({
getSizeFromValue: (value) => value === "legacy" ? 0 : 1,
maxSize: 1,
write: (value, bytes, offset) => {
if (value === "legacy") {
return offset;
}
if (value < 0 || value > 127) {
throw new SolanaError(SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE, {
actualVersion: value
});
}
bytes.set([value | VERSION_FLAG_MASK], offset);
return offset + 1;
}
});
}
function getTransactionVersionDecoder() {
return createDecoder({
maxSize: 1,
read: (bytes, offset) => {
const firstByte = bytes[offset];
if ((firstByte & VERSION_FLAG_MASK) === 0) {
return ["legacy", offset];
} else {
const version = firstByte ^ VERSION_FLAG_MASK;
return [version, offset + 1];
}
}
});
}
function getTransactionVersionCodec() {
return combineCodec(getTransactionVersionEncoder(), getTransactionVersionDecoder());
}
var AddressMapEntryType = /* @__PURE__ */ ((AddressMapEntryType2) => {

@@ -546,4 +582,4 @@ AddressMapEntryType2[AddressMapEntryType2["FEE_PAYER"] = 0] = "FEE_PAYER";

export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getCompiledInstructions, getCompiledLifetimeToken, getCompiledMessageHeader, getCompiledStaticAccounts, getInstructionCodec, getInstructionDecoder, getInstructionEncoder, getMessageHeaderCodec, getMessageHeaderDecoder, getMessageHeaderEncoder, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getCompiledInstructions, getCompiledLifetimeToken, getCompiledMessageHeader, getCompiledStaticAccounts, getInstructionCodec, getInstructionDecoder, getInstructionEncoder, getMessageHeaderCodec, getMessageHeaderDecoder, getMessageHeaderEncoder, getOrderedAccountsFromAddressMap, getTransactionVersionCodec, getTransactionVersionDecoder, getTransactionVersionEncoder, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.native.js.map

@@ -1,5 +0,5 @@

import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { SolanaError, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES } from '@solana/errors';
import { assertIsBlockhash } from '@solana/rpc-types';
import { getAddressEncoder, getAddressDecoder, getAddressComparator } from '@solana/addresses';
import { combineCodec, transformEncoder, addEncoderSizePrefix, transformDecoder, addDecoderSizePrefix } from '@solana/codecs-core';
import { combineCodec, transformEncoder, addEncoderSizePrefix, transformDecoder, addDecoderSizePrefix, createEncoder, createDecoder } from '@solana/codecs-core';
import { getStructEncoder, getArrayEncoder, getStructDecoder, getArrayDecoder, getStructCodec, getBytesEncoder, getBytesDecoder } from '@solana/codecs-data-structures';

@@ -162,2 +162,38 @@ import { getU8Encoder, getShortU16Encoder, getU8Decoder, getShortU16Decoder, getU8Codec } from '@solana/codecs-numbers';

}
var VERSION_FLAG_MASK = 128;
function getTransactionVersionEncoder() {
return createEncoder({
getSizeFromValue: (value) => value === "legacy" ? 0 : 1,
maxSize: 1,
write: (value, bytes, offset) => {
if (value === "legacy") {
return offset;
}
if (value < 0 || value > 127) {
throw new SolanaError(SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE, {
actualVersion: value
});
}
bytes.set([value | VERSION_FLAG_MASK], offset);
return offset + 1;
}
});
}
function getTransactionVersionDecoder() {
return createDecoder({
maxSize: 1,
read: (bytes, offset) => {
const firstByte = bytes[offset];
if ((firstByte & VERSION_FLAG_MASK) === 0) {
return ["legacy", offset];
} else {
const version = firstByte ^ VERSION_FLAG_MASK;
return [version, offset + 1];
}
}
});
}
function getTransactionVersionCodec() {
return combineCodec(getTransactionVersionEncoder(), getTransactionVersionDecoder());
}
var AddressMapEntryType = /* @__PURE__ */ ((AddressMapEntryType2) => {

@@ -546,4 +582,4 @@ AddressMapEntryType2[AddressMapEntryType2["FEE_PAYER"] = 0] = "FEE_PAYER";

export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getCompiledInstructions, getCompiledLifetimeToken, getCompiledMessageHeader, getCompiledStaticAccounts, getInstructionCodec, getInstructionDecoder, getInstructionEncoder, getMessageHeaderCodec, getMessageHeaderDecoder, getMessageHeaderEncoder, getOrderedAccountsFromAddressMap, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
export { ADDRESS_MAP_TYPE_PROPERTY, AddressMapEntryType, appendTransactionMessageInstruction, appendTransactionMessageInstructions, assertIsDurableNonceTransactionMessage, assertIsTransactionMessageWithBlockhashLifetime, createTransactionMessage, getAddressMapFromInstructions, getAddressTableLookupCodec, getAddressTableLookupDecoder, getAddressTableLookupEncoder, getCompiledAddressTableLookups, getCompiledInstructions, getCompiledLifetimeToken, getCompiledMessageHeader, getCompiledStaticAccounts, getInstructionCodec, getInstructionDecoder, getInstructionEncoder, getMessageHeaderCodec, getMessageHeaderDecoder, getMessageHeaderEncoder, getOrderedAccountsFromAddressMap, getTransactionVersionCodec, getTransactionVersionDecoder, getTransactionVersionEncoder, newIsAdvanceNonceAccountInstruction, prependTransactionMessageInstruction, prependTransactionMessageInstructions, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.node.js.map
export * from './address-table-lookup.js';
export * from './header.js';
export * from './instruction.js';
export * from './transaction-version.js';
//# sourceMappingURL=index.d.ts.map

16

package.json
{
"name": "@solana/transaction-messages",
"version": "2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af",
"version": "2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38",
"description": "Helpers for creating transaction messages",

@@ -49,9 +49,9 @@ "exports": {

"dependencies": {
"@solana/addresses": "2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af",
"@solana/codecs-core": "2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af",
"@solana/codecs-data-structures": "2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af",
"@solana/codecs-numbers": "2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af",
"@solana/errors": "2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af",
"@solana/instructions": "2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af",
"@solana/rpc-types": "2.0.0-preview.1.20240408132847.53e8f7549f30623162c150dea49b45f6735611af"
"@solana/addresses": "2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38",
"@solana/codecs-core": "2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38",
"@solana/codecs-data-structures": "2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38",
"@solana/codecs-numbers": "2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38",
"@solana/errors": "2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38",
"@solana/instructions": "2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38",
"@solana/rpc-types": "2.0.0-preview.1.20240408133046.55bbe46a054ae4688c3a59c5fda5577e90188a38"
},

@@ -58,0 +58,0 @@ "bundlewatch": {

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