@solana/transactions 2.0.0-experimental.0099b2a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +334 -0
- package/dist/index.browser.cjs +1098 -0
- package/dist/index.browser.cjs.map +1 -0
- package/dist/index.browser.js +1080 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.development.js +1778 -0
- package/dist/index.development.js.map +1 -0
- package/dist/index.native.js +1080 -0
- package/dist/index.native.js.map +1 -0
- package/dist/index.node.cjs +1098 -0
- package/dist/index.node.cjs.map +1 -0
- package/dist/index.node.js +1080 -0
- package/dist/index.node.js.map +1 -0
- package/dist/index.production.min.js +29 -0
- package/dist/types/accounts.d.ts +28 -0
- package/dist/types/blockhash.d.ts +18 -0
- package/dist/types/compile-address-table-lookups.d.ts +10 -0
- package/dist/types/compile-header.d.ts +9 -0
- package/dist/types/compile-instructions.d.ts +10 -0
- package/dist/types/compile-lifetime-token.d.ts +3 -0
- package/dist/types/compile-static-accounts.d.ts +4 -0
- package/dist/types/compile-transaction.d.ts +11 -0
- package/dist/types/create-transaction.d.ts +9 -0
- package/dist/types/decompile-transaction.d.ts +7 -0
- package/dist/types/durable-nonce.d.ts +35 -0
- package/dist/types/fee-payer.d.ts +9 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/instructions.d.ts +5 -0
- package/dist/types/message.d.ts +30 -0
- package/dist/types/serializers/address-table-lookup.d.ts +8 -0
- package/dist/types/serializers/header.d.ts +8 -0
- package/dist/types/serializers/index.d.ts +2 -0
- package/dist/types/serializers/instruction.d.ts +8 -0
- package/dist/types/serializers/message.d.ts +6 -0
- package/dist/types/serializers/transaction-version.d.ts +6 -0
- package/dist/types/serializers/transaction.d.ts +9 -0
- package/dist/types/signatures.d.ts +20 -0
- package/dist/types/types.d.ts +26 -0
- package/dist/types/unsigned-transaction.d.ts +4 -0
- package/dist/types/wire-transaction.d.ts +6 -0
- package/package.json +103 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
|
|
2
|
+
import { TransactionVersion } from '../types';
|
|
3
|
+
export declare function getTransactionVersionDecoder(): Decoder<TransactionVersion>;
|
|
4
|
+
export declare function getTransactionVersionEncoder(): Encoder<TransactionVersion>;
|
|
5
|
+
export declare function getTransactionVersionCodec(): Codec<TransactionVersion>;
|
|
6
|
+
//# sourceMappingURL=transaction-version.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
|
|
2
|
+
import { compileMessage } from '../message';
|
|
3
|
+
import { ITransactionWithSignatures } from '../signatures';
|
|
4
|
+
type CompilableTransaction = Parameters<typeof compileMessage>[0];
|
|
5
|
+
export declare function getTransactionEncoder(): Encoder<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
|
|
6
|
+
export declare function getTransactionDecoder(lastValidBlockHeight?: bigint): Decoder<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
|
|
7
|
+
export declare function getTransactionCodec(lastValidBlockHeight?: bigint): Codec<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Base58EncodedAddress } from '@solana/addresses';
|
|
2
|
+
import { Ed25519Signature } from '@solana/keys';
|
|
3
|
+
import { ITransactionWithFeePayer } from './fee-payer';
|
|
4
|
+
import { compileMessage } from './message';
|
|
5
|
+
export interface IFullySignedTransaction extends ITransactionWithSignatures {
|
|
6
|
+
readonly __brand: unique symbol;
|
|
7
|
+
}
|
|
8
|
+
export interface ITransactionWithSignatures {
|
|
9
|
+
readonly signatures: Readonly<Record<Base58EncodedAddress, Ed25519Signature>>;
|
|
10
|
+
}
|
|
11
|
+
export type TransactionSignature = string & {
|
|
12
|
+
readonly __brand: unique symbol;
|
|
13
|
+
};
|
|
14
|
+
export declare function assertIsTransactionSignature(putativeTransactionSignature: string): asserts putativeTransactionSignature is TransactionSignature;
|
|
15
|
+
export declare function isTransactionSignature(putativeTransactionSignature: string): putativeTransactionSignature is TransactionSignature;
|
|
16
|
+
export declare function getSignatureFromTransaction(transaction: ITransactionWithFeePayer & ITransactionWithSignatures): TransactionSignature;
|
|
17
|
+
export declare function signTransaction<TTransaction extends Parameters<typeof compileMessage>[0]>(keyPairs: CryptoKeyPair[], transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): Promise<TTransaction & ITransactionWithSignatures>;
|
|
18
|
+
export declare function transactionSignature(putativeTransactionSignature: string): TransactionSignature;
|
|
19
|
+
export declare function assertTransactionIsFullySigned<TTransaction extends Parameters<typeof compileMessage>[0]>(transaction: TTransaction & ITransactionWithSignatures): asserts transaction is TTransaction & IFullySignedTransaction;
|
|
20
|
+
//# sourceMappingURL=signatures.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IAccountMeta, IInstruction } from '@solana/instructions';
|
|
2
|
+
/** A string of bytes that are definitely a serialized message */
|
|
3
|
+
export type SerializedMessageBytes = Uint8Array & {
|
|
4
|
+
readonly __serializedMessageBytes: unique symbol;
|
|
5
|
+
};
|
|
6
|
+
export type SerializedMessageBytesBase64 = string & {
|
|
7
|
+
readonly __serializedMessageBytesBase64: unique symbol;
|
|
8
|
+
};
|
|
9
|
+
export type BaseTransaction = Readonly<{
|
|
10
|
+
instructions: readonly IInstruction[];
|
|
11
|
+
version: TransactionVersion;
|
|
12
|
+
}>;
|
|
13
|
+
type LegacyTransaction = BaseTransaction & Readonly<{
|
|
14
|
+
instructions: readonly (Omit<IInstruction, 'accounts'> & Readonly<{
|
|
15
|
+
readonly accounts?: readonly IAccountMeta[];
|
|
16
|
+
}>)[];
|
|
17
|
+
version: 'legacy';
|
|
18
|
+
}>;
|
|
19
|
+
type V0Transaction = BaseTransaction & Readonly<{
|
|
20
|
+
instructions: readonly IInstruction[];
|
|
21
|
+
version: 0;
|
|
22
|
+
}>;
|
|
23
|
+
export type Transaction = LegacyTransaction | V0Transaction;
|
|
24
|
+
export type TransactionVersion = 'legacy' | 0;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ITransactionWithSignatures } from '.';
|
|
2
|
+
import { BaseTransaction } from './types';
|
|
3
|
+
export declare function getUnsignedTransaction<TTransaction extends BaseTransaction>(transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): TTransaction | Omit<TTransaction & ITransactionWithSignatures, keyof ITransactionWithSignatures>;
|
|
4
|
+
//# sourceMappingURL=unsigned-transaction.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { getTransactionEncoder } from './serializers/transaction';
|
|
2
|
+
export type Base64EncodedWireTransaction = string & {
|
|
3
|
+
readonly __brand: unique symbol;
|
|
4
|
+
};
|
|
5
|
+
export declare function getBase64EncodedWireTransaction(transaction: Parameters<ReturnType<typeof getTransactionEncoder>['encode']>[0]): Base64EncodedWireTransaction;
|
|
6
|
+
//# sourceMappingURL=wire-transaction.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solana/transactions",
|
|
3
|
+
"version": "2.0.0-experimental.0099b2a",
|
|
4
|
+
"description": "Helpers for creating and serializing transactions",
|
|
5
|
+
"exports": {
|
|
6
|
+
"browser": {
|
|
7
|
+
"import": "./dist/index.browser.js",
|
|
8
|
+
"require": "./dist/index.browser.cjs"
|
|
9
|
+
},
|
|
10
|
+
"node": {
|
|
11
|
+
"import": "./dist/index.node.js",
|
|
12
|
+
"require": "./dist/index.node.cjs"
|
|
13
|
+
},
|
|
14
|
+
"react-native": "./dist/index.native.js",
|
|
15
|
+
"types": "./dist/types/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"browser": {
|
|
18
|
+
"./dist/index.node.cjs": "./dist/index.browser.cjs",
|
|
19
|
+
"./dist/index.node.js": "./dist/index.browser.js"
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/index.node.cjs",
|
|
22
|
+
"module": "./dist/index.node.js",
|
|
23
|
+
"react-native": "./dist/index.native.js",
|
|
24
|
+
"types": "./dist/types/index.d.ts",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"files": [
|
|
27
|
+
"./dist/"
|
|
28
|
+
],
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"keywords": [
|
|
31
|
+
"blockchain",
|
|
32
|
+
"solana",
|
|
33
|
+
"web3"
|
|
34
|
+
],
|
|
35
|
+
"author": "Solana Labs Maintainers <maintainers@solanalabs.com>",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/solana-labs/solana-web3.js"
|
|
40
|
+
},
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "http://github.com/solana-labs/solana-web3.js/issues"
|
|
43
|
+
},
|
|
44
|
+
"browserslist": [
|
|
45
|
+
"supports bigint and not dead",
|
|
46
|
+
"maintained node versions"
|
|
47
|
+
],
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@solana/addresses": "2.0.0-experimental.0099b2a",
|
|
50
|
+
"@solana/codecs-core": "2.0.0-experimental.0099b2a",
|
|
51
|
+
"@solana/codecs-data-structures": "2.0.0-experimental.0099b2a",
|
|
52
|
+
"@solana/codecs-numbers": "2.0.0-experimental.0099b2a",
|
|
53
|
+
"@solana/codecs-strings": "2.0.0-experimental.0099b2a",
|
|
54
|
+
"@solana/functional": "2.0.0-experimental.0099b2a",
|
|
55
|
+
"@solana/keys": "2.0.0-experimental.0099b2a"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@solana/eslint-config-solana": "^1.0.2",
|
|
59
|
+
"@swc/jest": "^0.2.29",
|
|
60
|
+
"@types/jest": "^29.5.6",
|
|
61
|
+
"@types/node": "^20.6.3",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
63
|
+
"@typescript-eslint/parser": "^6.3.0",
|
|
64
|
+
"agadoo": "^3.0.0",
|
|
65
|
+
"eslint": "^8.45.0",
|
|
66
|
+
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
67
|
+
"jest": "^29.7.0",
|
|
68
|
+
"jest-runner-eslint": "^2.1.2",
|
|
69
|
+
"jest-runner-prettier": "^1.0.0",
|
|
70
|
+
"prettier": "^2.8",
|
|
71
|
+
"tsup": "7.2.0",
|
|
72
|
+
"typescript": "^5.2.2",
|
|
73
|
+
"version-from-git": "^1.1.1",
|
|
74
|
+
"@solana/instructions": "2.0.0-experimental.0099b2a",
|
|
75
|
+
"build-scripts": "0.0.0",
|
|
76
|
+
"test-config": "0.0.0",
|
|
77
|
+
"test-matchers": "0.0.0",
|
|
78
|
+
"tsconfig": "0.0.0"
|
|
79
|
+
},
|
|
80
|
+
"bundlewatch": {
|
|
81
|
+
"defaultCompression": "gzip",
|
|
82
|
+
"files": [
|
|
83
|
+
{
|
|
84
|
+
"path": "./dist/index*.js"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"scripts": {
|
|
89
|
+
"compile:js": "tsup --config build-scripts/tsup.config.library.ts",
|
|
90
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
91
|
+
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
92
|
+
"publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
|
|
93
|
+
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
|
|
94
|
+
"test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
95
|
+
"test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
96
|
+
"test:treeshakability:browser": "agadoo dist/index.browser.js",
|
|
97
|
+
"test:treeshakability:native": "agadoo dist/index.native.js",
|
|
98
|
+
"test:treeshakability:node": "agadoo dist/index.node.js",
|
|
99
|
+
"test:typecheck": "tsc --noEmit",
|
|
100
|
+
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent",
|
|
101
|
+
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent"
|
|
102
|
+
}
|
|
103
|
+
}
|