@talismn/solana 1.0.0 → 1.0.2
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/dist/index.d.mts +22 -23
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +22 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Instruction, Transaction, TransactionMessageBytesBase64 } from "@solana/kit";
|
|
2
2
|
//#region src/utils/chains.d.ts
|
|
3
|
-
declare const SOLANA_CHAINS: readonly ["solana:mainnet", "solana:devnet", "solana:testnet", "solana:localnet"];
|
|
4
|
-
type SolanaChainId = (typeof SOLANA_CHAINS)[number];
|
|
5
|
-
declare const getSolNetworkId: (chain: SolanaChainId) => "solana-devnet" | "solana-localnet" | "solana-mainnet" | "solana-testnet";
|
|
3
|
+
export declare const SOLANA_CHAINS: readonly ["solana:mainnet", "solana:devnet", "solana:testnet", "solana:localnet"];
|
|
4
|
+
export type SolanaChainId = (typeof SOLANA_CHAINS)[number];
|
|
5
|
+
export declare const getSolNetworkId: (chain: SolanaChainId) => "solana-devnet" | "solana-localnet" | "solana-mainnet" | "solana-testnet";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/utils/offchainMessage.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Wraps a raw message in the off-chain message envelope that hardware wallets sign.
|
|
10
10
|
* Returns `null` if the message cannot be wrapped (binary content, empty, or too long).
|
|
11
11
|
*/
|
|
12
|
-
declare const serializeOffchainMessage: (message: Uint8Array, signerPublicKey: Uint8Array) => Uint8Array | null;
|
|
12
|
+
export declare const serializeOffchainMessage: (message: Uint8Array, signerPublicKey: Uint8Array) => Uint8Array | null;
|
|
13
13
|
//#endregion
|
|
14
|
-
//#region ../../node_modules/.pnpm/@solana+nominal-types@
|
|
14
|
+
//#region ../../node_modules/.pnpm/@solana+nominal-types@8.2.0_typescript@7.0.2/node_modules/@solana/nominal-types/dist/types/index.d.ts
|
|
15
15
|
type StringEncoding = 'base58' | 'base64';
|
|
16
16
|
/**
|
|
17
17
|
* Use this to produce a new type that satisfies the original type, but not the other way around.
|
|
@@ -82,7 +82,7 @@ type EncodedString<T extends string, TEncoding extends StringEncoding> = Nominal
|
|
|
82
82
|
*/
|
|
83
83
|
type NominalType<TKey extends string, TMarker extends string> = { readonly [K in `__${TKey}:@solana/kit`]: TMarker; };
|
|
84
84
|
//#endregion
|
|
85
|
-
//#region ../../node_modules/.pnpm/@solana+addresses@
|
|
85
|
+
//#region ../../node_modules/.pnpm/@solana+addresses@8.2.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@7.0.2/node_modules/@solana/addresses/dist/types/address.d.ts
|
|
86
86
|
/**
|
|
87
87
|
* Represents a string that validates as a Solana address. Functions that require well-formed
|
|
88
88
|
* addresses should specify their inputs in terms of this type.
|
|
@@ -97,8 +97,8 @@ type Address<TAddress extends string = string> = Brand<EncodedString<TAddress, '
|
|
|
97
97
|
* A Solana transaction: raw wire message bytes plus a signer-address → signature map.
|
|
98
98
|
* Kit's decoder/encoder handles both legacy and v0 wire formats transparently.
|
|
99
99
|
*/
|
|
100
|
-
type SolTransaction = Transaction;
|
|
101
|
-
type SolTransactionInfo = {
|
|
100
|
+
export type SolTransaction = Transaction;
|
|
101
|
+
export type SolTransactionInfo = {
|
|
102
102
|
version: "legacy" | 0 | 1;
|
|
103
103
|
/** compiled lifetime token — the recent blockhash (or nonce for durable-nonce transactions) */
|
|
104
104
|
recentBlockhash: string;
|
|
@@ -118,16 +118,16 @@ type SolTransactionInfo = {
|
|
|
118
118
|
*/
|
|
119
119
|
signature: string | null;
|
|
120
120
|
};
|
|
121
|
-
declare const parseTransactionInfo: (tx: SolTransaction) => SolTransactionInfo;
|
|
121
|
+
export declare const parseTransactionInfo: (tx: SolTransaction) => SolTransactionInfo;
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region src/utils/serialization.d.ts
|
|
124
|
-
declare const transactionFromBytes: (bytes: Uint8Array) => SolTransaction;
|
|
125
|
-
declare const transactionToBytes: (tx: SolTransaction) => Uint8Array;
|
|
124
|
+
export declare const transactionFromBytes: (bytes: Uint8Array) => SolTransaction;
|
|
125
|
+
export declare const transactionToBytes: (tx: SolTransaction) => Uint8Array;
|
|
126
126
|
/** base58 of the wire-format transaction — both legacy and v0, wire-compatible with web3.js */
|
|
127
|
-
declare const serializeTransaction: (tx: SolTransaction) => string;
|
|
128
|
-
declare const deserializeTransaction: (transaction: string) => SolTransaction;
|
|
127
|
+
export declare const serializeTransaction: (tx: SolTransaction) => string;
|
|
128
|
+
export declare const deserializeTransaction: (transaction: string) => SolTransaction;
|
|
129
129
|
/** decoded compiled message — legacy and v0 wire formats are handled transparently */
|
|
130
|
-
declare const getCompiledMessage: (tx: SolTransaction) => import("@solana/kit").CompiledTransactionMessage & Readonly<{
|
|
130
|
+
export declare const getCompiledMessage: (tx: SolTransaction) => import("@solana/kit").CompiledTransactionMessage & Readonly<{
|
|
131
131
|
lifetimeToken: string;
|
|
132
132
|
}>;
|
|
133
133
|
/**
|
|
@@ -136,10 +136,10 @@ declare const getCompiledMessage: (tx: SolTransaction) => import("@solana/kit").
|
|
|
136
136
|
* message bytes with no domain separator, so the resulting ed25519 signature would double as a
|
|
137
137
|
* valid transaction signature.
|
|
138
138
|
*/
|
|
139
|
-
declare const isCompiledTransactionMessage: (bytes: Uint8Array) => boolean;
|
|
139
|
+
export declare const isCompiledTransactionMessage: (bytes: Uint8Array) => boolean;
|
|
140
140
|
/** base64 of the compiled message bytes, the format `getFeeForMessage` expects */
|
|
141
|
-
declare const getMessageBase64: (tx: SolTransaction) => TransactionMessageBytesBase64;
|
|
142
|
-
declare const buildUnsignedTransaction: ({ feePayer, blockhash, lastValidBlockHeight, instructions, version }: {
|
|
141
|
+
export declare const getMessageBase64: (tx: SolTransaction) => TransactionMessageBytesBase64;
|
|
142
|
+
export declare const buildUnsignedTransaction: ({ feePayer, blockhash, lastValidBlockHeight, instructions, version }: {
|
|
143
143
|
feePayer: string;
|
|
144
144
|
blockhash: string;
|
|
145
145
|
lastValidBlockHeight: bigint;
|
|
@@ -151,8 +151,8 @@ declare const buildUnsignedTransaction: ({ feePayer, blockhash, lastValidBlockHe
|
|
|
151
151
|
* re-encoding the compiled message. Existing signatures are reset to null — changing the
|
|
152
152
|
* blockhash invalidates them.
|
|
153
153
|
*/
|
|
154
|
-
declare const setTransactionBlockhash: (tx: SolTransaction, blockhash: string) => SolTransaction;
|
|
155
|
-
declare const txToHumanJSON: (tx: string | SolTransaction) => {
|
|
154
|
+
export declare const setTransactionBlockhash: (tx: SolTransaction, blockhash: string) => SolTransaction;
|
|
155
|
+
export declare const txToHumanJSON: (tx: string | SolTransaction) => {
|
|
156
156
|
version: "legacy" | 0 | 1;
|
|
157
157
|
signatures: (string | null)[];
|
|
158
158
|
feePayer: Address;
|
|
@@ -182,19 +182,18 @@ declare const txToHumanJSON: (tx: string | SolTransaction) => {
|
|
|
182
182
|
* Throws if `address` is not a required signer of the transaction (the signatures
|
|
183
183
|
* map is keyed in wire order at decode time — adding a key would corrupt re-encoding).
|
|
184
184
|
*/
|
|
185
|
-
declare const attachTransactionSignature: (tx: SolTransaction, address: string, signature: Uint8Array) => SolTransaction;
|
|
185
|
+
export declare const attachTransactionSignature: (tx: SolTransaction, address: string, signature: Uint8Array) => SolTransaction;
|
|
186
186
|
/**
|
|
187
187
|
* Returns the signature attached for `address`, verified against the transaction's message
|
|
188
188
|
* bytes; null when missing, all-zeros, or invalid. Unlike `parseTransactionInfo`, this checks
|
|
189
189
|
* a specific signer's slot, so it works on transactions with co-signers.
|
|
190
190
|
*/
|
|
191
|
-
declare const getVerifiedTransactionSignature: (tx: SolTransaction, address: string) => Uint8Array | null;
|
|
191
|
+
export declare const getVerifiedTransactionSignature: (tx: SolTransaction, address: string) => Uint8Array | null;
|
|
192
192
|
/**
|
|
193
193
|
* Signs the transaction's message bytes with the given ed25519 secret key and
|
|
194
194
|
* attaches the signature. Signing happens with @noble/curves (via @talismn/crypto),
|
|
195
195
|
* not WebCrypto — Ed25519 subtle crypto is too recent for the extension's support matrix.
|
|
196
196
|
*/
|
|
197
|
-
declare const signTransactionWithSecretKey: (tx: SolTransaction, secretKey: Uint8Array, expectedAddress?: string) => SolTransaction;
|
|
197
|
+
export declare const signTransactionWithSecretKey: (tx: SolTransaction, secretKey: Uint8Array, expectedAddress?: string) => SolTransaction;
|
|
198
198
|
//#endregion
|
|
199
|
-
export { SOLANA_CHAINS, SolTransaction, SolTransactionInfo, SolanaChainId, attachTransactionSignature, buildUnsignedTransaction, deserializeTransaction, getCompiledMessage, getMessageBase64, getSolNetworkId, getVerifiedTransactionSignature, isCompiledTransactionMessage, parseTransactionInfo, serializeOffchainMessage, serializeTransaction, setTransactionBlockhash, signTransactionWithSecretKey, transactionFromBytes, transactionToBytes, txToHumanJSON };
|
|
200
199
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/utils/chains.ts","../src/utils/offchainMessage.ts","../../../node_modules/.pnpm/@solana+nominal-types@
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/utils/chains.ts","../src/utils/offchainMessage.ts","../../../node_modules/.pnpm/@solana+nominal-types@8.2.0_typescript@7.0.2/node_modules/@solana/nominal-types/dist/types/index.d.ts","../../../node_modules/.pnpm/@solana+addresses@8.2.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@7.0.2/node_modules/@solana/addresses/dist/types/address.d.ts","../src/utils/transaction.ts","../src/utils/serialization.ts","../src/utils/signing.ts"],"x_google_ignoreList":[2,3],"mappings":";;qBAAa;YAOD,wBAAwB;qBAEvB,kBAAe,OAAW;;;;;;;qBCoC1B,2BAAwB,SAC1B,YAAU,iBACF,eAChB;;;KCzBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiDO,MAAM,GAAG,6BAA6B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;KAoCzE,cAAc,kBAAkB,kBAAkB,kBAAkB,8BAA8B,aAAa;;;;;;;;;;;;;;;;;;;;;KAqB/G,YAAY,qBAAqB,sCAC/B,UAAU,qBAAqB;;;;;;;;;;KCzHjC,QAAQ,oCAAoC,MAAM,cAAc;;;;;;;YCChE,iBAAiB;YAEjB;EACV;;EAEA;;EAEA;;EAEA;;;;;;EAMA;;;;;EAKA;;qBAGW,uBAAoB,IAAQ,mBAAiB;;;qBCR7C,uBAAoB,OAAW,eAAa;qBAG5C,qBAAkB,IAAQ,mBAAiB;;qBAI3C,uBAAoB,IAAQ;qBAG5B,yBAAsB,wBAA0B;;qBAIhD,qBAAkB,IAAQ,yCAAc,6BAAA;;;;;;;;;qBASxC,+BAA4B,OAAW;;qBAUvC,mBAAgB,IAAQ,mBAAiB;qBAGzC,6BAAwB,UAAA,WAAA,sBAAA,cAAA;EAOnC;EACA;EACA;EACA,cAAc;EACd;MACE;;;;;;qBAkBS,0BAAuB,IAAQ,gBAAc,sBAAsB;qBAenE,gBAAa,aAAiB;EAavC;EACA;EACA,UAfuC;EAgBvC;EACA;EAEA;IAEwC;;;;EAIxC;;eAVQ;;;;;;;;;;;;;;;;;qBC/GC,6BAA0B,IACjC,gBAAc,iBACH,WACJ,eACV;;;;;;qBAeU,kCAA+B,IACtC,gBAAc,oBAEjB;;;;;;qBAaU,+BAA4B,IACnC,gBAAc,WACP,YAAU,6BAEpB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Instruction, Transaction, TransactionMessageBytesBase64 } from "@solana/kit";
|
|
2
2
|
//#region src/utils/chains.d.ts
|
|
3
|
-
declare const SOLANA_CHAINS: readonly ["solana:mainnet", "solana:devnet", "solana:testnet", "solana:localnet"];
|
|
4
|
-
type SolanaChainId = (typeof SOLANA_CHAINS)[number];
|
|
5
|
-
declare const getSolNetworkId: (chain: SolanaChainId) => "solana-devnet" | "solana-localnet" | "solana-mainnet" | "solana-testnet";
|
|
3
|
+
export declare const SOLANA_CHAINS: readonly ["solana:mainnet", "solana:devnet", "solana:testnet", "solana:localnet"];
|
|
4
|
+
export type SolanaChainId = (typeof SOLANA_CHAINS)[number];
|
|
5
|
+
export declare const getSolNetworkId: (chain: SolanaChainId) => "solana-devnet" | "solana-localnet" | "solana-mainnet" | "solana-testnet";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/utils/offchainMessage.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Wraps a raw message in the off-chain message envelope that hardware wallets sign.
|
|
10
10
|
* Returns `null` if the message cannot be wrapped (binary content, empty, or too long).
|
|
11
11
|
*/
|
|
12
|
-
declare const serializeOffchainMessage: (message: Uint8Array, signerPublicKey: Uint8Array) => Uint8Array | null;
|
|
12
|
+
export declare const serializeOffchainMessage: (message: Uint8Array, signerPublicKey: Uint8Array) => Uint8Array | null;
|
|
13
13
|
//#endregion
|
|
14
|
-
//#region ../../node_modules/.pnpm/@solana+nominal-types@
|
|
14
|
+
//#region ../../node_modules/.pnpm/@solana+nominal-types@8.2.0_typescript@7.0.2/node_modules/@solana/nominal-types/dist/types/index.d.ts
|
|
15
15
|
type StringEncoding = 'base58' | 'base64';
|
|
16
16
|
/**
|
|
17
17
|
* Use this to produce a new type that satisfies the original type, but not the other way around.
|
|
@@ -82,7 +82,7 @@ type EncodedString<T extends string, TEncoding extends StringEncoding> = Nominal
|
|
|
82
82
|
*/
|
|
83
83
|
type NominalType<TKey extends string, TMarker extends string> = { readonly [K in `__${TKey}:@solana/kit`]: TMarker; };
|
|
84
84
|
//#endregion
|
|
85
|
-
//#region ../../node_modules/.pnpm/@solana+addresses@
|
|
85
|
+
//#region ../../node_modules/.pnpm/@solana+addresses@8.2.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@7.0.2/node_modules/@solana/addresses/dist/types/address.d.ts
|
|
86
86
|
/**
|
|
87
87
|
* Represents a string that validates as a Solana address. Functions that require well-formed
|
|
88
88
|
* addresses should specify their inputs in terms of this type.
|
|
@@ -97,8 +97,8 @@ type Address<TAddress extends string = string> = Brand<EncodedString<TAddress, '
|
|
|
97
97
|
* A Solana transaction: raw wire message bytes plus a signer-address → signature map.
|
|
98
98
|
* Kit's decoder/encoder handles both legacy and v0 wire formats transparently.
|
|
99
99
|
*/
|
|
100
|
-
type SolTransaction = Transaction;
|
|
101
|
-
type SolTransactionInfo = {
|
|
100
|
+
export type SolTransaction = Transaction;
|
|
101
|
+
export type SolTransactionInfo = {
|
|
102
102
|
version: "legacy" | 0 | 1;
|
|
103
103
|
/** compiled lifetime token — the recent blockhash (or nonce for durable-nonce transactions) */
|
|
104
104
|
recentBlockhash: string;
|
|
@@ -118,16 +118,16 @@ type SolTransactionInfo = {
|
|
|
118
118
|
*/
|
|
119
119
|
signature: string | null;
|
|
120
120
|
};
|
|
121
|
-
declare const parseTransactionInfo: (tx: SolTransaction) => SolTransactionInfo;
|
|
121
|
+
export declare const parseTransactionInfo: (tx: SolTransaction) => SolTransactionInfo;
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region src/utils/serialization.d.ts
|
|
124
|
-
declare const transactionFromBytes: (bytes: Uint8Array) => SolTransaction;
|
|
125
|
-
declare const transactionToBytes: (tx: SolTransaction) => Uint8Array;
|
|
124
|
+
export declare const transactionFromBytes: (bytes: Uint8Array) => SolTransaction;
|
|
125
|
+
export declare const transactionToBytes: (tx: SolTransaction) => Uint8Array;
|
|
126
126
|
/** base58 of the wire-format transaction — both legacy and v0, wire-compatible with web3.js */
|
|
127
|
-
declare const serializeTransaction: (tx: SolTransaction) => string;
|
|
128
|
-
declare const deserializeTransaction: (transaction: string) => SolTransaction;
|
|
127
|
+
export declare const serializeTransaction: (tx: SolTransaction) => string;
|
|
128
|
+
export declare const deserializeTransaction: (transaction: string) => SolTransaction;
|
|
129
129
|
/** decoded compiled message — legacy and v0 wire formats are handled transparently */
|
|
130
|
-
declare const getCompiledMessage: (tx: SolTransaction) => import("@solana/kit").CompiledTransactionMessage & Readonly<{
|
|
130
|
+
export declare const getCompiledMessage: (tx: SolTransaction) => import("@solana/kit").CompiledTransactionMessage & Readonly<{
|
|
131
131
|
lifetimeToken: string;
|
|
132
132
|
}>;
|
|
133
133
|
/**
|
|
@@ -136,10 +136,10 @@ declare const getCompiledMessage: (tx: SolTransaction) => import("@solana/kit").
|
|
|
136
136
|
* message bytes with no domain separator, so the resulting ed25519 signature would double as a
|
|
137
137
|
* valid transaction signature.
|
|
138
138
|
*/
|
|
139
|
-
declare const isCompiledTransactionMessage: (bytes: Uint8Array) => boolean;
|
|
139
|
+
export declare const isCompiledTransactionMessage: (bytes: Uint8Array) => boolean;
|
|
140
140
|
/** base64 of the compiled message bytes, the format `getFeeForMessage` expects */
|
|
141
|
-
declare const getMessageBase64: (tx: SolTransaction) => TransactionMessageBytesBase64;
|
|
142
|
-
declare const buildUnsignedTransaction: ({ feePayer, blockhash, lastValidBlockHeight, instructions, version }: {
|
|
141
|
+
export declare const getMessageBase64: (tx: SolTransaction) => TransactionMessageBytesBase64;
|
|
142
|
+
export declare const buildUnsignedTransaction: ({ feePayer, blockhash, lastValidBlockHeight, instructions, version }: {
|
|
143
143
|
feePayer: string;
|
|
144
144
|
blockhash: string;
|
|
145
145
|
lastValidBlockHeight: bigint;
|
|
@@ -151,8 +151,8 @@ declare const buildUnsignedTransaction: ({ feePayer, blockhash, lastValidBlockHe
|
|
|
151
151
|
* re-encoding the compiled message. Existing signatures are reset to null — changing the
|
|
152
152
|
* blockhash invalidates them.
|
|
153
153
|
*/
|
|
154
|
-
declare const setTransactionBlockhash: (tx: SolTransaction, blockhash: string) => SolTransaction;
|
|
155
|
-
declare const txToHumanJSON: (tx: string | SolTransaction) => {
|
|
154
|
+
export declare const setTransactionBlockhash: (tx: SolTransaction, blockhash: string) => SolTransaction;
|
|
155
|
+
export declare const txToHumanJSON: (tx: string | SolTransaction) => {
|
|
156
156
|
version: "legacy" | 0 | 1;
|
|
157
157
|
signatures: (string | null)[];
|
|
158
158
|
feePayer: Address;
|
|
@@ -182,19 +182,18 @@ declare const txToHumanJSON: (tx: string | SolTransaction) => {
|
|
|
182
182
|
* Throws if `address` is not a required signer of the transaction (the signatures
|
|
183
183
|
* map is keyed in wire order at decode time — adding a key would corrupt re-encoding).
|
|
184
184
|
*/
|
|
185
|
-
declare const attachTransactionSignature: (tx: SolTransaction, address: string, signature: Uint8Array) => SolTransaction;
|
|
185
|
+
export declare const attachTransactionSignature: (tx: SolTransaction, address: string, signature: Uint8Array) => SolTransaction;
|
|
186
186
|
/**
|
|
187
187
|
* Returns the signature attached for `address`, verified against the transaction's message
|
|
188
188
|
* bytes; null when missing, all-zeros, or invalid. Unlike `parseTransactionInfo`, this checks
|
|
189
189
|
* a specific signer's slot, so it works on transactions with co-signers.
|
|
190
190
|
*/
|
|
191
|
-
declare const getVerifiedTransactionSignature: (tx: SolTransaction, address: string) => Uint8Array | null;
|
|
191
|
+
export declare const getVerifiedTransactionSignature: (tx: SolTransaction, address: string) => Uint8Array | null;
|
|
192
192
|
/**
|
|
193
193
|
* Signs the transaction's message bytes with the given ed25519 secret key and
|
|
194
194
|
* attaches the signature. Signing happens with @noble/curves (via @talismn/crypto),
|
|
195
195
|
* not WebCrypto — Ed25519 subtle crypto is too recent for the extension's support matrix.
|
|
196
196
|
*/
|
|
197
|
-
declare const signTransactionWithSecretKey: (tx: SolTransaction, secretKey: Uint8Array, expectedAddress?: string) => SolTransaction;
|
|
197
|
+
export declare const signTransactionWithSecretKey: (tx: SolTransaction, secretKey: Uint8Array, expectedAddress?: string) => SolTransaction;
|
|
198
198
|
//#endregion
|
|
199
|
-
export { SOLANA_CHAINS, SolTransaction, SolTransactionInfo, SolanaChainId, attachTransactionSignature, buildUnsignedTransaction, deserializeTransaction, getCompiledMessage, getMessageBase64, getSolNetworkId, getVerifiedTransactionSignature, isCompiledTransactionMessage, parseTransactionInfo, serializeOffchainMessage, serializeTransaction, setTransactionBlockhash, signTransactionWithSecretKey, transactionFromBytes, transactionToBytes, txToHumanJSON };
|
|
200
199
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/utils/chains.ts","../src/utils/offchainMessage.ts","../../../node_modules/.pnpm/@solana+nominal-types@
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/utils/chains.ts","../src/utils/offchainMessage.ts","../../../node_modules/.pnpm/@solana+nominal-types@8.2.0_typescript@7.0.2/node_modules/@solana/nominal-types/dist/types/index.d.ts","../../../node_modules/.pnpm/@solana+addresses@8.2.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@7.0.2/node_modules/@solana/addresses/dist/types/address.d.ts","../src/utils/transaction.ts","../src/utils/serialization.ts","../src/utils/signing.ts"],"x_google_ignoreList":[2,3],"mappings":";;qBAAa;YAOD,wBAAwB;qBAEvB,kBAAe,OAAW;;;;;;;qBCoC1B,2BAAwB,SAC1B,YAAU,iBACF,eAChB;;;KCzBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiDO,MAAM,GAAG,6BAA6B,qBAAqB,cAAc;;;;;;;;;;;;;;;;;;;KAoCzE,cAAc,kBAAkB,kBAAkB,kBAAkB,8BAA8B,aAAa;;;;;;;;;;;;;;;;;;;;;KAqB/G,YAAY,qBAAqB,sCAC/B,UAAU,qBAAqB;;;;;;;;;;KCzHjC,QAAQ,oCAAoC,MAAM,cAAc;;;;;;;YCChE,iBAAiB;YAEjB;EACV;;EAEA;;EAEA;;EAEA;;;;;;EAMA;;;;;EAKA;;qBAGW,uBAAoB,IAAQ,mBAAiB;;;qBCR7C,uBAAoB,OAAW,eAAa;qBAG5C,qBAAkB,IAAQ,mBAAiB;;qBAI3C,uBAAoB,IAAQ;qBAG5B,yBAAsB,wBAA0B;;qBAIhD,qBAAkB,IAAQ,yCAAc,6BAAA;;;;;;;;;qBASxC,+BAA4B,OAAW;;qBAUvC,mBAAgB,IAAQ,mBAAiB;qBAGzC,6BAAwB,UAAA,WAAA,sBAAA,cAAA;EAOnC;EACA;EACA;EACA,cAAc;EACd;MACE;;;;;;qBAkBS,0BAAuB,IAAQ,gBAAc,sBAAsB;qBAenE,gBAAa,aAAiB;EAavC;EACA;EACA,UAfuC;EAgBvC;EACA;EAEA;IAEwC;;;;EAIxC;;eAVQ;;;;;;;;;;;;;;;;;qBC/GC,6BAA0B,IACjC,gBAAc,iBACH,WACJ,eACV;;;;;;qBAeU,kCAA+B,IACtC,gBAAc,oBAEjB;;;;;;qBAaU,+BAA4B,IACnC,gBAAc,WACP,YAAU,6BAEpB"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["base58","compileTransaction","ed25519","base58","base58"],"sources":["../src/utils/chains.ts","../src/utils/offchainMessage.ts","../src/utils/serialization.ts","../src/utils/signing.ts","../src/utils/transaction.ts"],"sourcesContent":["export const SOLANA_CHAINS = [\n \"solana:mainnet\",\n \"solana:devnet\",\n \"solana:testnet\",\n \"solana:localnet\",\n] as const\n\nexport type SolanaChainId = (typeof SOLANA_CHAINS)[number]\n\nexport const getSolNetworkId = (chain: SolanaChainId) => {\n switch (chain) {\n case \"solana:mainnet\":\n return \"solana-mainnet\"\n case \"solana:devnet\":\n return \"solana-devnet\"\n case \"solana:testnet\":\n return \"solana-testnet\"\n case \"solana:localnet\":\n return \"solana-localnet\"\n default:\n throw new Error(`Unknown Solana chain: ${chain}`)\n }\n}\n","// Solana off-chain message envelope (v0), as specified by Anza and enforced by the Ledger app\n// (1.8.0+): https://github.com/anza-xyz/agave/blob/master/docs/src/proposals/off-chain-message-signing.md\n//\n// signing domain \"\\xffsolana offchain\" (16 bytes) || header version (1 byte, 0) ||\n// application domain (32 bytes, zeros = not provided) || message format (1 byte) ||\n// signer count (1 byte) || signers (32 bytes each) || message length (2 bytes LE) || message\n//\n// Hardware wallets refuse to sign arbitrary raw bytes - only transactions and messages wrapped\n// in this envelope, and the derivation path's public key must appear in the signers list.\n// Note this is NOT the format implemented by @solana/offchain-messages (kit), whose codec\n// details differ from what the Ledger app validates.\n\nconst SIGNING_DOMAIN = new Uint8Array([\n 0xff,\n ...Array.from(\"solana offchain\", (c) => c.charCodeAt(0)),\n])\n\nconst APPLICATION_DOMAIN_LENGTH = 32\nconst PUBLIC_KEY_LENGTH = 32\n\n// domain + version + application domain + format + signer count + one signer + length\nconst HEADER_LENGTH =\n SIGNING_DOMAIN.length + 1 + APPLICATION_DOMAIN_LENGTH + 1 + 1 + PUBLIC_KEY_LENGTH + 2\n\n/** Hardware wallet compatible v0 messages are capped at 1232 bytes total, header included */\nconst MAX_MESSAGE_LENGTH = 1232 - HEADER_LENGTH\n\nconst FORMAT_RESTRICTED_ASCII = 0\nconst FORMAT_LIMITED_UTF8 = 1\n\nconst getMessageFormat = (message: Uint8Array): number | null => {\n if (message.every((byte) => byte >= 0x20 && byte <= 0x7e)) return FORMAT_RESTRICTED_ASCII\n\n try {\n new TextDecoder(\"utf-8\", { fatal: true }).decode(message)\n return FORMAT_LIMITED_UTF8\n } catch {\n return null // binary content cannot be wrapped\n }\n}\n\n/**\n * Wraps a raw message in the off-chain message envelope that hardware wallets sign.\n * Returns `null` if the message cannot be wrapped (binary content, empty, or too long).\n */\nexport const serializeOffchainMessage = (\n message: Uint8Array,\n signerPublicKey: Uint8Array\n): Uint8Array | null => {\n if (message.length === 0 || message.length > MAX_MESSAGE_LENGTH) return null\n if (signerPublicKey.length !== PUBLIC_KEY_LENGTH) return null\n\n const format = getMessageFormat(message)\n if (format === null) return null\n\n const envelope = new Uint8Array(HEADER_LENGTH + message.length)\n let offset = 0\n\n envelope.set(SIGNING_DOMAIN, offset)\n offset += SIGNING_DOMAIN.length\n\n envelope[offset++] = 0 // header version\n\n offset += APPLICATION_DOMAIN_LENGTH // application domain: zeros = not provided\n\n envelope[offset++] = format\n envelope[offset++] = 1 // signer count\n\n envelope.set(signerPublicKey, offset)\n offset += PUBLIC_KEY_LENGTH\n\n envelope[offset++] = message.length & 0xff\n envelope[offset++] = message.length >> 8\n\n envelope.set(message, offset)\n\n return envelope\n}\n","import type {\n Blockhash,\n Instruction,\n SignaturesMap,\n TransactionMessageBytes,\n TransactionMessageBytesBase64,\n} from \"@solana/kit\"\nimport {\n appendTransactionMessageInstructions,\n compileTransaction,\n createTransactionMessage,\n getBase64Decoder,\n getCompiledTransactionMessageDecoder,\n getCompiledTransactionMessageEncoder,\n getTransactionDecoder,\n getTransactionEncoder,\n pipe,\n setTransactionMessageFeePayer,\n setTransactionMessageLifetimeUsingBlockhash,\n address as solAddress,\n} from \"@solana/kit\"\nimport { base58 } from \"@talismn/crypto\"\n\nimport type { SolTransaction } from \"./transaction\"\n\nexport const transactionFromBytes = (bytes: Uint8Array): SolTransaction =>\n getTransactionDecoder().decode(bytes)\n\nexport const transactionToBytes = (tx: SolTransaction): Uint8Array =>\n new Uint8Array(getTransactionEncoder().encode(tx))\n\n/** base58 of the wire-format transaction — both legacy and v0, wire-compatible with web3.js */\nexport const serializeTransaction = (tx: SolTransaction): string =>\n base58.encode(transactionToBytes(tx))\n\nexport const deserializeTransaction = (transaction: string): SolTransaction =>\n transactionFromBytes(base58.decode(transaction))\n\n/** decoded compiled message — legacy and v0 wire formats are handled transparently */\nexport const getCompiledMessage = (tx: SolTransaction) =>\n getCompiledTransactionMessageDecoder().decode(tx.messageBytes)\n\n/**\n * Whether the bytes parse as a complete compiled transaction message (legacy or v0).\n * Wallets must refuse to sign such a payload as a \"message\": Solana software accounts sign raw\n * message bytes with no domain separator, so the resulting ed25519 signature would double as a\n * valid transaction signature.\n */\nexport const isCompiledTransactionMessage = (bytes: Uint8Array): boolean => {\n try {\n const [, offset] = getCompiledTransactionMessageDecoder().read(bytes, 0)\n return offset === bytes.length\n } catch {\n return false\n }\n}\n\n/** base64 of the compiled message bytes, the format `getFeeForMessage` expects */\nexport const getMessageBase64 = (tx: SolTransaction): TransactionMessageBytesBase64 =>\n getBase64Decoder().decode(tx.messageBytes) as TransactionMessageBytesBase64\n\nexport const buildUnsignedTransaction = ({\n feePayer,\n blockhash,\n lastValidBlockHeight,\n instructions,\n version = \"legacy\",\n}: {\n feePayer: string\n blockhash: string\n lastValidBlockHeight: bigint\n instructions: Instruction[]\n version?: \"legacy\" | 0\n}): SolTransaction =>\n pipe(\n createTransactionMessage({ version }),\n (m) => setTransactionMessageFeePayer(solAddress(feePayer), m),\n (m) =>\n setTransactionMessageLifetimeUsingBlockhash(\n { blockhash: blockhash as Blockhash, lastValidBlockHeight },\n m\n ),\n (m) => appendTransactionMessageInstructions(instructions, m),\n compileTransaction\n )\n\n/**\n * Returns a copy of the transaction with its lifetime token (recent blockhash) replaced,\n * re-encoding the compiled message. Existing signatures are reset to null — changing the\n * blockhash invalidates them.\n */\nexport const setTransactionBlockhash = (tx: SolTransaction, blockhash: string): SolTransaction => {\n const compiled = getCompiledTransactionMessageDecoder().decode(tx.messageBytes)\n const messageBytes = getCompiledTransactionMessageEncoder().encode({\n ...compiled,\n lifetimeToken: blockhash,\n }) as TransactionMessageBytes\n\n return Object.freeze({\n messageBytes,\n signatures: Object.freeze(\n Object.fromEntries(Object.keys(tx.signatures).map((address) => [address, null]))\n ) as SignaturesMap,\n })\n}\n\nexport const txToHumanJSON = (tx: string | SolTransaction) => {\n if (typeof tx === \"string\") tx = deserializeTransaction(tx)\n const message = getCompiledMessage(tx)\n const { header, staticAccounts } = message\n\n // standard account ordering: writable signers, readonly signers, writable non-signers, readonly non-signers\n const isSigner = (index: number) => index < header.numSignerAccounts\n const isWritable = (index: number) =>\n index < header.numSignerAccounts\n ? index < header.numSignerAccounts - header.numReadonlySignerAccounts\n : index < staticAccounts.length - header.numReadonlyNonSignerAccounts\n\n return {\n version: message.version,\n signatures: Object.values(tx.signatures).map((sig) => (sig ? base58.encode(sig) : null)),\n feePayer: staticAccounts[0] ?? null,\n recentBlockhash: \"lifetimeToken\" in message ? message.lifetimeToken : null,\n staticAccountKeys: staticAccounts as readonly string[],\n // ⚠️ NOTE: without address lookup table accounts we only have static keys.\n addressTableLookups:\n (\"addressTableLookups\" in message ? message.addressTableLookups : undefined)?.map((l) => ({\n accountKey: l.lookupTableAddress as string,\n writableIndexes: Array.from(l.writableIndexes),\n readonlyIndexes: Array.from(l.readonlyIndexes),\n })) ?? [],\n instructions: (\"instructions\" in message ? message.instructions : []).map((ix) => ({\n programIdIndex: ix.programAddressIndex,\n programId: staticAccounts[ix.programAddressIndex] ?? null,\n accounts: (ix.accountIndices ?? []).map((i) => ({\n index: i,\n pubkey: staticAccounts[i] ?? null,\n isSigner: isSigner(i),\n isWritable: isWritable(i),\n })),\n data: base58.encode((ix.data as Uint8Array | undefined) ?? new Uint8Array()),\n })),\n }\n}\n","import type { SignatureBytes } from \"@solana/kit\"\nimport { base58, ed25519, getPublicKeyFromSecret } from \"@talismn/crypto\"\n\nimport type { SolTransaction } from \"./transaction\"\n\n/**\n * Returns a copy of the transaction with `signature` attached for `address`.\n * Throws if `address` is not a required signer of the transaction (the signatures\n * map is keyed in wire order at decode time — adding a key would corrupt re-encoding).\n */\nexport const attachTransactionSignature = (\n tx: SolTransaction,\n address: string,\n signature: Uint8Array\n): SolTransaction => {\n if (!(address in tx.signatures))\n throw new Error(`Address ${address} is not a signer of this transaction`)\n\n return Object.freeze({\n ...tx,\n signatures: Object.freeze({ ...tx.signatures, [address]: signature as SignatureBytes }),\n })\n}\n\n/**\n * Returns the signature attached for `address`, verified against the transaction's message\n * bytes; null when missing, all-zeros, or invalid. Unlike `parseTransactionInfo`, this checks\n * a specific signer's slot, so it works on transactions with co-signers.\n */\nexport const getVerifiedTransactionSignature = (\n tx: SolTransaction,\n address: string\n): Uint8Array | null => {\n const signature = tx.signatures[address as keyof typeof tx.signatures]\n return signature &&\n ed25519.verify(signature, tx.messageBytes as unknown as Uint8Array, base58.decode(address))\n ? signature\n : null\n}\n\n/**\n * Signs the transaction's message bytes with the given ed25519 secret key and\n * attaches the signature. Signing happens with @noble/curves (via @talismn/crypto),\n * not WebCrypto — Ed25519 subtle crypto is too recent for the extension's support matrix.\n */\nexport const signTransactionWithSecretKey = (\n tx: SolTransaction,\n secretKey: Uint8Array,\n expectedAddress?: string\n): SolTransaction => {\n const address = base58.encode(getPublicKeyFromSecret(secretKey, \"solana\"))\n\n if (expectedAddress && address !== expectedAddress) throw new Error(\"Address mismatch\")\n\n const signature = ed25519.sign(tx.messageBytes as unknown as Uint8Array, secretKey)\n\n return attachTransactionSignature(tx, address, signature)\n}\n","import type { Transaction } from \"@solana/kit\"\nimport { base58 } from \"@talismn/crypto\"\n\nimport { getCompiledMessage } from \"./serialization\"\nimport { getVerifiedTransactionSignature } from \"./signing\"\n\n/**\n * A Solana transaction: raw wire message bytes plus a signer-address → signature map.\n * Kit's decoder/encoder handles both legacy and v0 wire formats transparently.\n */\nexport type SolTransaction = Transaction\n\nexport type SolTransactionInfo = {\n version: \"legacy\" | 0 | 1\n /** compiled lifetime token — the recent blockhash (or nonce for durable-nonce transactions) */\n recentBlockhash: string\n /** first static account, the account that pays the transaction fee */\n feePayer: string\n /** all required signer addresses, in wire order */\n signerAddresses: string[]\n /**\n * The account expected to sign in wallet flows.\n * `undefined` when the transaction has several signers (e.g. sponsored/partially-signed\n * dapp transactions) — callers use this to fall back to the dapp-provided address.\n */\n address: string | undefined\n /**\n * canonical (fee payer) base58 transaction signature, verified against the message bytes;\n * null when the fee payer hasn't signed\n */\n signature: string | null\n}\n\nexport const parseTransactionInfo = (tx: SolTransaction): SolTransactionInfo => {\n const message = getCompiledMessage(tx)\n const signerAddresses = Object.keys(tx.signatures)\n const feePayer = message.staticAccounts[0] as string\n\n // Behavior preserved from the web3.js implementation: legacy transactions always\n // resolve to the fee payer, versioned ones only when there is a single signer.\n const address =\n message.version === \"legacy\"\n ? signerAddresses[0]\n : signerAddresses.length === 1\n ? signerAddresses[0]\n : undefined\n\n // the canonical transaction signature is the fee payer's — may be missing or\n // all-zeros, so always verify against the message bytes\n const sigBytes = getVerifiedTransactionSignature(tx, feePayer)\n\n return {\n version: message.version,\n recentBlockhash: \"lifetimeToken\" in message ? message.lifetimeToken : \"\",\n feePayer,\n signerAddresses,\n address,\n signature: sigBytes ? base58.encode(sigBytes) : null,\n }\n}\n"],"mappings":";;;;AAAA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;AACF;AAIA,MAAa,mBAAmB,UAAyB;CACvD,QAAQ,OAAR;EACE,KAAK,kBACH,OAAO;EACT,KAAK,iBACH,OAAO;EACT,KAAK,kBACH,OAAO;EACT,KAAK,mBACH,OAAO;EACT,SACE,MAAM,IAAI,MAAM,yBAAyB,OAAO;CACpD;AACF;;;ACVA,MAAM,iBAAiB,IAAI,WAAW,CACpC,KACA,GAAG,MAAM,KAAK,oBAAoB,MAAM,EAAE,WAAW,CAAC,CAAC,CACzD,CAAC;AAED,MAAM,4BAA4B;AAClC,MAAM,oBAAoB;AAG1B,MAAM,gBACJ,eAAe,SAAS,IAAI,4BAA4B,IAAI,IAAI,oBAAoB;;AAGtF,MAAM,qBAAqB,OAAO;AAElC,MAAM,0BAA0B;AAChC,MAAM,sBAAsB;AAE5B,MAAM,oBAAoB,YAAuC;CAC/D,IAAI,QAAQ,OAAO,SAAS,QAAQ,MAAQ,QAAQ,GAAI,GAAG,OAAO;CAElE,IAAI;EACF,IAAI,YAAY,SAAS,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO;EACxD,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;;;;;AAMA,MAAa,4BACX,SACA,oBACsB;CACtB,IAAI,QAAQ,WAAW,KAAK,QAAQ,SAAS,oBAAoB,OAAO;CACxE,IAAI,gBAAgB,WAAW,mBAAmB,OAAO;CAEzD,MAAM,SAAS,iBAAiB,OAAO;CACvC,IAAI,WAAW,MAAM,OAAO;CAE5B,MAAM,WAAW,IAAI,WAAW,gBAAgB,QAAQ,MAAM;CAC9D,IAAI,SAAS;CAEb,SAAS,IAA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AW,gCAAgC,IAAI,QAAQ;CAE7D,OAAO;EACL,SAAS,QAAQ;EACjB,iBAAiB,mBAAmB,UAAU,QAAQ,gBAAgB;EACtE;EACA;EACA;EACA,WAAW,WAAWE,gBAAAA,OAAO,OAAO,QAAQ,IAAI;CAClD;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTransactionDecoder","getTransactionEncoder","base58","getCompiledTransactionMessageDecoder","getBase64Decoder","pipe","createTransactionMessage","setTransactionMessageFeePayer","solAddress","setTransactionMessageLifetimeUsingBlockhash","appendTransactionMessageInstructions","compileTransaction","getCompiledTransactionMessageEncoder","ed25519","base58","getPublicKeyFromSecret","base58"],"sources":["../src/utils/chains.ts","../src/utils/offchainMessage.ts","../src/utils/serialization.ts","../src/utils/signing.ts","../src/utils/transaction.ts"],"sourcesContent":["export const SOLANA_CHAINS = [\n \"solana:mainnet\",\n \"solana:devnet\",\n \"solana:testnet\",\n \"solana:localnet\",\n] as const\n\nexport type SolanaChainId = (typeof SOLANA_CHAINS)[number]\n\nexport const getSolNetworkId = (chain: SolanaChainId) => {\n switch (chain) {\n case \"solana:mainnet\":\n return \"solana-mainnet\"\n case \"solana:devnet\":\n return \"solana-devnet\"\n case \"solana:testnet\":\n return \"solana-testnet\"\n case \"solana:localnet\":\n return \"solana-localnet\"\n default:\n throw new Error(`Unknown Solana chain: ${chain}`)\n }\n}\n","// Solana off-chain message envelope (v0), as specified by Anza and enforced by the Ledger app\n// (1.8.0+): https://github.com/anza-xyz/agave/blob/master/docs/src/proposals/off-chain-message-signing.md\n//\n// signing domain \"\\xffsolana offchain\" (16 bytes) || header version (1 byte, 0) ||\n// application domain (32 bytes, zeros = not provided) || message format (1 byte) ||\n// signer count (1 byte) || signers (32 bytes each) || message length (2 bytes LE) || message\n//\n// Hardware wallets refuse to sign arbitrary raw bytes - only transactions and messages wrapped\n// in this envelope, and the derivation path's public key must appear in the signers list.\n// Note this is NOT the format implemented by @solana/offchain-messages (kit), whose codec\n// details differ from what the Ledger app validates.\n\nconst SIGNING_DOMAIN = new Uint8Array([\n 0xff,\n ...Array.from(\"solana offchain\", (c) => c.charCodeAt(0)),\n])\n\nconst APPLICATION_DOMAIN_LENGTH = 32\nconst PUBLIC_KEY_LENGTH = 32\n\n// domain + version + application domain + format + signer count + one signer + length\nconst HEADER_LENGTH =\n SIGNING_DOMAIN.length + 1 + APPLICATION_DOMAIN_LENGTH + 1 + 1 + PUBLIC_KEY_LENGTH + 2\n\n/** Hardware wallet compatible v0 messages are capped at 1232 bytes total, header included */\nconst MAX_MESSAGE_LENGTH = 1232 - HEADER_LENGTH\n\nconst FORMAT_RESTRICTED_ASCII = 0\nconst FORMAT_LIMITED_UTF8 = 1\n\nconst getMessageFormat = (message: Uint8Array): number | null => {\n if (message.every((byte) => byte >= 0x20 && byte <= 0x7e)) return FORMAT_RESTRICTED_ASCII\n\n try {\n new TextDecoder(\"utf-8\", { fatal: true }).decode(message)\n return FORMAT_LIMITED_UTF8\n } catch {\n return null // binary content cannot be wrapped\n }\n}\n\n/**\n * Wraps a raw message in the off-chain message envelope that hardware wallets sign.\n * Returns `null` if the message cannot be wrapped (binary content, empty, or too long).\n */\nexport const serializeOffchainMessage = (\n message: Uint8Array,\n signerPublicKey: Uint8Array\n): Uint8Array | null => {\n if (message.length === 0 || message.length > MAX_MESSAGE_LENGTH) return null\n if (signerPublicKey.length !== PUBLIC_KEY_LENGTH) return null\n\n const format = getMessageFormat(message)\n if (format === null) return null\n\n const envelope = new Uint8Array(HEADER_LENGTH + message.length)\n let offset = 0\n\n envelope.set(SIGNING_DOMAIN, offset)\n offset += SIGNING_DOMAIN.length\n\n envelope[offset++] = 0 // header version\n\n offset += APPLICATION_DOMAIN_LENGTH // application domain: zeros = not provided\n\n envelope[offset++] = format\n envelope[offset++] = 1 // signer count\n\n envelope.set(signerPublicKey, offset)\n offset += PUBLIC_KEY_LENGTH\n\n envelope[offset++] = message.length & 0xff\n envelope[offset++] = message.length >> 8\n\n envelope.set(message, offset)\n\n return envelope\n}\n","import type {\n Blockhash,\n Instruction,\n SignaturesMap,\n TransactionMessageBytes,\n TransactionMessageBytesBase64,\n} from \"@solana/kit\"\nimport {\n appendTransactionMessageInstructions,\n compileTransaction,\n createTransactionMessage,\n getBase64Decoder,\n getCompiledTransactionMessageDecoder,\n getCompiledTransactionMessageEncoder,\n getTransactionDecoder,\n getTransactionEncoder,\n pipe,\n setTransactionMessageFeePayer,\n setTransactionMessageLifetimeUsingBlockhash,\n address as solAddress,\n} from \"@solana/kit\"\nimport { base58 } from \"@talismn/crypto\"\n\nimport type { SolTransaction } from \"./transaction\"\n\nexport const transactionFromBytes = (bytes: Uint8Array): SolTransaction =>\n getTransactionDecoder().decode(bytes)\n\nexport const transactionToBytes = (tx: SolTransaction): Uint8Array =>\n new Uint8Array(getTransactionEncoder().encode(tx))\n\n/** base58 of the wire-format transaction — both legacy and v0, wire-compatible with web3.js */\nexport const serializeTransaction = (tx: SolTransaction): string =>\n base58.encode(transactionToBytes(tx))\n\nexport const deserializeTransaction = (transaction: string): SolTransaction =>\n transactionFromBytes(base58.decode(transaction))\n\n/** decoded compiled message — legacy and v0 wire formats are handled transparently */\nexport const getCompiledMessage = (tx: SolTransaction) =>\n getCompiledTransactionMessageDecoder().decode(tx.messageBytes)\n\n/**\n * Whether the bytes parse as a complete compiled transaction message (legacy or v0).\n * Wallets must refuse to sign such a payload as a \"message\": Solana software accounts sign raw\n * message bytes with no domain separator, so the resulting ed25519 signature would double as a\n * valid transaction signature.\n */\nexport const isCompiledTransactionMessage = (bytes: Uint8Array): boolean => {\n try {\n const [, offset] = getCompiledTransactionMessageDecoder().read(bytes, 0)\n return offset === bytes.length\n } catch {\n return false\n }\n}\n\n/** base64 of the compiled message bytes, the format `getFeeForMessage` expects */\nexport const getMessageBase64 = (tx: SolTransaction): TransactionMessageBytesBase64 =>\n getBase64Decoder().decode(tx.messageBytes) as TransactionMessageBytesBase64\n\nexport const buildUnsignedTransaction = ({\n feePayer,\n blockhash,\n lastValidBlockHeight,\n instructions,\n version = \"legacy\",\n}: {\n feePayer: string\n blockhash: string\n lastValidBlockHeight: bigint\n instructions: Instruction[]\n version?: \"legacy\" | 0\n}): SolTransaction =>\n pipe(\n createTransactionMessage({ version }),\n (m) => setTransactionMessageFeePayer(solAddress(feePayer), m),\n (m) =>\n setTransactionMessageLifetimeUsingBlockhash(\n { blockhash: blockhash as Blockhash, lastValidBlockHeight },\n m\n ),\n (m) => appendTransactionMessageInstructions(instructions, m),\n compileTransaction\n )\n\n/**\n * Returns a copy of the transaction with its lifetime token (recent blockhash) replaced,\n * re-encoding the compiled message. Existing signatures are reset to null — changing the\n * blockhash invalidates them.\n */\nexport const setTransactionBlockhash = (tx: SolTransaction, blockhash: string): SolTransaction => {\n const compiled = getCompiledTransactionMessageDecoder().decode(tx.messageBytes)\n const messageBytes = getCompiledTransactionMessageEncoder().encode({\n ...compiled,\n lifetimeToken: blockhash,\n }) as TransactionMessageBytes\n\n return Object.freeze({\n messageBytes,\n signatures: Object.freeze(\n Object.fromEntries(Object.keys(tx.signatures).map((address) => [address, null]))\n ) as SignaturesMap,\n })\n}\n\nexport const txToHumanJSON = (tx: string | SolTransaction) => {\n if (typeof tx === \"string\") tx = deserializeTransaction(tx)\n const message = getCompiledMessage(tx)\n const { header, staticAccounts } = message\n\n // standard account ordering: writable signers, readonly signers, writable non-signers, readonly non-signers\n const isSigner = (index: number) => index < header.numSignerAccounts\n const isWritable = (index: number) =>\n index < header.numSignerAccounts\n ? index < header.numSignerAccounts - header.numReadonlySignerAccounts\n : index < staticAccounts.length - header.numReadonlyNonSignerAccounts\n\n return {\n version: message.version,\n signatures: Object.values(tx.signatures).map((sig) => (sig ? base58.encode(sig) : null)),\n feePayer: staticAccounts[0] ?? null,\n recentBlockhash: \"lifetimeToken\" in message ? message.lifetimeToken : null,\n staticAccountKeys: staticAccounts as readonly string[],\n // ⚠️ NOTE: without address lookup table accounts we only have static keys.\n addressTableLookups:\n (\"addressTableLookups\" in message ? message.addressTableLookups : undefined)?.map((l) => ({\n accountKey: l.lookupTableAddress as string,\n writableIndexes: Array.from(l.writableIndexes),\n readonlyIndexes: Array.from(l.readonlyIndexes),\n })) ?? [],\n instructions: (\"instructions\" in message ? message.instructions : []).map((ix) => ({\n programIdIndex: ix.programAddressIndex,\n programId: staticAccounts[ix.programAddressIndex] ?? null,\n accounts: (ix.accountIndices ?? []).map((i) => ({\n index: i,\n pubkey: staticAccounts[i] ?? null,\n isSigner: isSigner(i),\n isWritable: isWritable(i),\n })),\n data: base58.encode((ix.data as Uint8Array | undefined) ?? new Uint8Array()),\n })),\n }\n}\n","import type { SignatureBytes } from \"@solana/kit\"\nimport { base58, ed25519, getPublicKeyFromSecret } from \"@talismn/crypto\"\n\nimport type { SolTransaction } from \"./transaction\"\n\n/**\n * Returns a copy of the transaction with `signature` attached for `address`.\n * Throws if `address` is not a required signer of the transaction (the signatures\n * map is keyed in wire order at decode time — adding a key would corrupt re-encoding).\n */\nexport const attachTransactionSignature = (\n tx: SolTransaction,\n address: string,\n signature: Uint8Array\n): SolTransaction => {\n if (!(address in tx.signatures))\n throw new Error(`Address ${address} is not a signer of this transaction`)\n\n return Object.freeze({\n ...tx,\n signatures: Object.freeze({ ...tx.signatures, [address]: signature as SignatureBytes }),\n })\n}\n\n/**\n * Returns the signature attached for `address`, verified against the transaction's message\n * bytes; null when missing, all-zeros, or invalid. Unlike `parseTransactionInfo`, this checks\n * a specific signer's slot, so it works on transactions with co-signers.\n */\nexport const getVerifiedTransactionSignature = (\n tx: SolTransaction,\n address: string\n): Uint8Array | null => {\n const signature = tx.signatures[address as keyof typeof tx.signatures]\n return signature &&\n ed25519.verify(signature, tx.messageBytes as unknown as Uint8Array, base58.decode(address))\n ? signature\n : null\n}\n\n/**\n * Signs the transaction's message bytes with the given ed25519 secret key and\n * attaches the signature. Signing happens with @noble/curves (via @talismn/crypto),\n * not WebCrypto — Ed25519 subtle crypto is too recent for the extension's support matrix.\n */\nexport const signTransactionWithSecretKey = (\n tx: SolTransaction,\n secretKey: Uint8Array,\n expectedAddress?: string\n): SolTransaction => {\n const address = base58.encode(getPublicKeyFromSecret(secretKey, \"solana\"))\n\n if (expectedAddress && address !== expectedAddress) throw new Error(\"Address mismatch\")\n\n const signature = ed25519.sign(tx.messageBytes as unknown as Uint8Array, secretKey)\n\n return attachTransactionSignature(tx, address, signature)\n}\n","import type { Transaction } from \"@solana/kit\"\nimport { base58 } from \"@talismn/crypto\"\n\nimport { getCompiledMessage } from \"./serialization\"\nimport { getVerifiedTransactionSignature } from \"./signing\"\n\n/**\n * A Solana transaction: raw wire message bytes plus a signer-address → signature map.\n * Kit's decoder/encoder handles both legacy and v0 wire formats transparently.\n */\nexport type SolTransaction = Transaction\n\nexport type SolTransactionInfo = {\n version: \"legacy\" | 0 | 1\n /** compiled lifetime token — the recent blockhash (or nonce for durable-nonce transactions) */\n recentBlockhash: string\n /** first static account, the account that pays the transaction fee */\n feePayer: string\n /** all required signer addresses, in wire order */\n signerAddresses: string[]\n /**\n * The account expected to sign in wallet flows.\n * `undefined` when the transaction has several signers (e.g. sponsored/partially-signed\n * dapp transactions) — callers use this to fall back to the dapp-provided address.\n */\n address: string | undefined\n /**\n * canonical (fee payer) base58 transaction signature, verified against the message bytes;\n * null when the fee payer hasn't signed\n */\n signature: string | null\n}\n\nexport const parseTransactionInfo = (tx: SolTransaction): SolTransactionInfo => {\n const message = getCompiledMessage(tx)\n const signerAddresses = Object.keys(tx.signatures)\n const feePayer = message.staticAccounts[0] as string\n\n // Behavior preserved from the web3.js implementation: legacy transactions always\n // resolve to the fee payer, versioned ones only when there is a single signer.\n const address =\n message.version === \"legacy\"\n ? signerAddresses[0]\n : signerAddresses.length === 1\n ? signerAddresses[0]\n : undefined\n\n // the canonical transaction signature is the fee payer's — may be missing or\n // all-zeros, so always verify against the message bytes\n const sigBytes = getVerifiedTransactionSignature(tx, feePayer)\n\n return {\n version: message.version,\n recentBlockhash: \"lifetimeToken\" in message ? message.lifetimeToken : \"\",\n feePayer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EACjB,iBAAiB,mBAAmB,UAAU,QAAQ,gBAAgB;EACtE;EACA;EACA;EACA,WAAW,WAAWG,gBAAAA,OAAO,OAAO,QAAQ,IAAI;CAClD;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talismn/solana",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"node": ">=20"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@solana/kit": "
|
|
25
|
-
"@talismn/crypto": "1.
|
|
24
|
+
"@solana/kit": "8.2.0",
|
|
25
|
+
"@talismn/crypto": "1.1.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"
|
|
30
|
-
"
|
|
28
|
+
"@talismn/tsconfig": "0.0.4",
|
|
29
|
+
"@types/node": "^24.13.3",
|
|
30
|
+
"typescript": "^7.0.2"
|
|
31
31
|
},
|
|
32
32
|
"types": "./dist/index.d.ts",
|
|
33
33
|
"exports": {
|