@talismn/solana 0.0.0-pr2198-20251230100215 → 0.0.0-pr2198-20251231075317
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.
|
@@ -15,7 +15,6 @@ export type SolInstructionJson = ReturnType<typeof solInstructionToJson>;
|
|
|
15
15
|
export declare const solInstructionFromJson: (serialized: SolInstructionJson) => TransactionInstruction;
|
|
16
16
|
export declare const serializeTransaction: (transaction: Transaction | VersionedTransaction) => string;
|
|
17
17
|
export declare const deserializeTransaction: (transaction: string) => Transaction | VersionedTransaction;
|
|
18
|
-
export declare const deserializeTransactionFromHex: (transactionHex: string) => Transaction | VersionedTransaction | undefined;
|
|
19
18
|
export declare const txToHumanJSON: (tx: string | Transaction | VersionedTransaction) => {
|
|
20
19
|
type: string;
|
|
21
20
|
version: 0 | "legacy";
|
|
@@ -78,50 +78,6 @@ const deserializeTransaction = transaction => {
|
|
|
78
78
|
return web3_js.Transaction.from(bytes);
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
|
|
82
|
-
// export const deserializeTransactionFromBase64 = (
|
|
83
|
-
// transaction: string,
|
|
84
|
-
// ): Transaction | VersionedTransaction | undefined => {
|
|
85
|
-
// try {
|
|
86
|
-
// // Try base64 first (Yield API uses this)
|
|
87
|
-
// const rawTx = Buffer.from(transaction, "base64")
|
|
88
|
-
|
|
89
|
-
// try {
|
|
90
|
-
// return VersionedTransaction.deserialize(rawTx)
|
|
91
|
-
// } catch {
|
|
92
|
-
// return Transaction.from(rawTx)
|
|
93
|
-
// }
|
|
94
|
-
// } catch (base64Error) {
|
|
95
|
-
// // Fallback if it's hex-encoded
|
|
96
|
-
// try {
|
|
97
|
-
// const rawTx = Buffer.from(transaction, "hex")
|
|
98
|
-
|
|
99
|
-
// try {
|
|
100
|
-
// return VersionedTransaction.deserialize(rawTx)
|
|
101
|
-
// } catch {
|
|
102
|
-
// return Transaction.from(rawTx)
|
|
103
|
-
// }
|
|
104
|
-
// } catch (hexError) {
|
|
105
|
-
// return undefined
|
|
106
|
-
// }
|
|
107
|
-
// }
|
|
108
|
-
// }
|
|
109
|
-
|
|
110
|
-
const deserializeTransactionFromHex = transactionHex => {
|
|
111
|
-
try {
|
|
112
|
-
// Convert hex → bytes
|
|
113
|
-
const rawBytes = Buffer.from(transactionHex, "hex");
|
|
114
|
-
|
|
115
|
-
// Try versioned first
|
|
116
|
-
try {
|
|
117
|
-
return web3_js.VersionedTransaction.deserialize(rawBytes);
|
|
118
|
-
} catch {
|
|
119
|
-
return web3_js.Transaction.from(rawBytes);
|
|
120
|
-
}
|
|
121
|
-
} catch {
|
|
122
|
-
return undefined;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
81
|
const txToHumanJSON = tx => {
|
|
126
82
|
if (typeof tx === "string") tx = deserializeTransaction(tx);
|
|
127
83
|
return isVersionedTransaction(tx) ? versionedTxToJSON(tx) : legacyTxToJSON(tx);
|
|
@@ -196,7 +152,6 @@ const getSolNetworkId = chain => {
|
|
|
196
152
|
|
|
197
153
|
exports.SOLANA_CHAINS = SOLANA_CHAINS;
|
|
198
154
|
exports.deserializeTransaction = deserializeTransaction;
|
|
199
|
-
exports.deserializeTransactionFromHex = deserializeTransactionFromHex;
|
|
200
155
|
exports.getKeypair = getKeypair;
|
|
201
156
|
exports.getSolNetworkId = getSolNetworkId;
|
|
202
157
|
exports.isVersionedTransaction = isVersionedTransaction;
|
|
@@ -78,50 +78,6 @@ const deserializeTransaction = transaction => {
|
|
|
78
78
|
return web3_js.Transaction.from(bytes);
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
|
|
82
|
-
// export const deserializeTransactionFromBase64 = (
|
|
83
|
-
// transaction: string,
|
|
84
|
-
// ): Transaction | VersionedTransaction | undefined => {
|
|
85
|
-
// try {
|
|
86
|
-
// // Try base64 first (Yield API uses this)
|
|
87
|
-
// const rawTx = Buffer.from(transaction, "base64")
|
|
88
|
-
|
|
89
|
-
// try {
|
|
90
|
-
// return VersionedTransaction.deserialize(rawTx)
|
|
91
|
-
// } catch {
|
|
92
|
-
// return Transaction.from(rawTx)
|
|
93
|
-
// }
|
|
94
|
-
// } catch (base64Error) {
|
|
95
|
-
// // Fallback if it's hex-encoded
|
|
96
|
-
// try {
|
|
97
|
-
// const rawTx = Buffer.from(transaction, "hex")
|
|
98
|
-
|
|
99
|
-
// try {
|
|
100
|
-
// return VersionedTransaction.deserialize(rawTx)
|
|
101
|
-
// } catch {
|
|
102
|
-
// return Transaction.from(rawTx)
|
|
103
|
-
// }
|
|
104
|
-
// } catch (hexError) {
|
|
105
|
-
// return undefined
|
|
106
|
-
// }
|
|
107
|
-
// }
|
|
108
|
-
// }
|
|
109
|
-
|
|
110
|
-
const deserializeTransactionFromHex = transactionHex => {
|
|
111
|
-
try {
|
|
112
|
-
// Convert hex → bytes
|
|
113
|
-
const rawBytes = Buffer.from(transactionHex, "hex");
|
|
114
|
-
|
|
115
|
-
// Try versioned first
|
|
116
|
-
try {
|
|
117
|
-
return web3_js.VersionedTransaction.deserialize(rawBytes);
|
|
118
|
-
} catch {
|
|
119
|
-
return web3_js.Transaction.from(rawBytes);
|
|
120
|
-
}
|
|
121
|
-
} catch {
|
|
122
|
-
return undefined;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
81
|
const txToHumanJSON = tx => {
|
|
126
82
|
if (typeof tx === "string") tx = deserializeTransaction(tx);
|
|
127
83
|
return isVersionedTransaction(tx) ? versionedTxToJSON(tx) : legacyTxToJSON(tx);
|
|
@@ -196,7 +152,6 @@ const getSolNetworkId = chain => {
|
|
|
196
152
|
|
|
197
153
|
exports.SOLANA_CHAINS = SOLANA_CHAINS;
|
|
198
154
|
exports.deserializeTransaction = deserializeTransaction;
|
|
199
|
-
exports.deserializeTransactionFromHex = deserializeTransactionFromHex;
|
|
200
155
|
exports.getKeypair = getKeypair;
|
|
201
156
|
exports.getSolNetworkId = getSolNetworkId;
|
|
202
157
|
exports.isVersionedTransaction = isVersionedTransaction;
|
|
@@ -76,50 +76,6 @@ const deserializeTransaction = transaction => {
|
|
|
76
76
|
return Transaction.from(bytes);
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
|
|
80
|
-
// export const deserializeTransactionFromBase64 = (
|
|
81
|
-
// transaction: string,
|
|
82
|
-
// ): Transaction | VersionedTransaction | undefined => {
|
|
83
|
-
// try {
|
|
84
|
-
// // Try base64 first (Yield API uses this)
|
|
85
|
-
// const rawTx = Buffer.from(transaction, "base64")
|
|
86
|
-
|
|
87
|
-
// try {
|
|
88
|
-
// return VersionedTransaction.deserialize(rawTx)
|
|
89
|
-
// } catch {
|
|
90
|
-
// return Transaction.from(rawTx)
|
|
91
|
-
// }
|
|
92
|
-
// } catch (base64Error) {
|
|
93
|
-
// // Fallback if it's hex-encoded
|
|
94
|
-
// try {
|
|
95
|
-
// const rawTx = Buffer.from(transaction, "hex")
|
|
96
|
-
|
|
97
|
-
// try {
|
|
98
|
-
// return VersionedTransaction.deserialize(rawTx)
|
|
99
|
-
// } catch {
|
|
100
|
-
// return Transaction.from(rawTx)
|
|
101
|
-
// }
|
|
102
|
-
// } catch (hexError) {
|
|
103
|
-
// return undefined
|
|
104
|
-
// }
|
|
105
|
-
// }
|
|
106
|
-
// }
|
|
107
|
-
|
|
108
|
-
const deserializeTransactionFromHex = transactionHex => {
|
|
109
|
-
try {
|
|
110
|
-
// Convert hex → bytes
|
|
111
|
-
const rawBytes = Buffer.from(transactionHex, "hex");
|
|
112
|
-
|
|
113
|
-
// Try versioned first
|
|
114
|
-
try {
|
|
115
|
-
return VersionedTransaction.deserialize(rawBytes);
|
|
116
|
-
} catch {
|
|
117
|
-
return Transaction.from(rawBytes);
|
|
118
|
-
}
|
|
119
|
-
} catch {
|
|
120
|
-
return undefined;
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
79
|
const txToHumanJSON = tx => {
|
|
124
80
|
if (typeof tx === "string") tx = deserializeTransaction(tx);
|
|
125
81
|
return isVersionedTransaction(tx) ? versionedTxToJSON(tx) : legacyTxToJSON(tx);
|
|
@@ -192,4 +148,4 @@ const getSolNetworkId = chain => {
|
|
|
192
148
|
}
|
|
193
149
|
};
|
|
194
150
|
|
|
195
|
-
export { SOLANA_CHAINS, deserializeTransaction,
|
|
151
|
+
export { SOLANA_CHAINS, deserializeTransaction, getKeypair, getSolNetworkId, isVersionedTransaction, parseTransactionInfo, serializeTransaction, solInstructionFromJson, solInstructionToJson, txToHumanJSON };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talismn/solana",
|
|
3
|
-
"version": "0.0.0-pr2198-
|
|
3
|
+
"version": "0.0.0-pr2198-20251231075317",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"jest": "^29.7",
|
|
32
32
|
"ts-jest": "^29.2.5",
|
|
33
33
|
"typescript": "^5.6.3",
|
|
34
|
-
"@talismn/
|
|
35
|
-
"@talismn/
|
|
34
|
+
"@talismn/eslint-config": "0.0.3",
|
|
35
|
+
"@talismn/tsconfig": "0.0.3"
|
|
36
36
|
},
|
|
37
37
|
"eslintConfig": {
|
|
38
38
|
"root": true,
|