@ledgerhq/device-signer-kit-solana 0.0.0-develop-20250904001204 → 0.0.0-e2e-speculos-20250904104129
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/lib/cjs/internal/app-binder/services/TransactionInspector.js +3 -1
- package/lib/cjs/internal/app-binder/services/TransactionInspector.js.map +3 -3
- package/lib/cjs/package.json +1 -1
- package/lib/esm/internal/app-binder/services/TransactionInspector.js +3 -1
- package/lib/esm/internal/app-binder/services/TransactionInspector.js.map +3 -3
- package/lib/esm/package.json +1 -1
- package/lib/types/internal/app-binder/services/TransactionInspector.d.ts +1 -10
- package/lib/types/internal/app-binder/services/TransactionInspector.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var I=(c,e)=>{for(var s in e)d(c,s,{get:e[s],enumerable:!0})},f=(c,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of T(e))!A.call(c,a)&&a!==s&&d(c,a,{get:()=>e[a],enumerable:!(n=m(e,a))||n.enumerable});return c};var g=c=>f(d({},"__esModule",{value:!0}),c);var b={};I(b,{SolanaTransactionTypes:()=>y,TransactionInspector:()=>k});module.exports=g(b);var r=require("@solana/spl-token"),i=require("@solana/web3.js"),p=require("buffer"),y=(s=>(s.STANDARD="Standard",s.SPL="SPL",s))(y||{});class k{constructor(e){this.rawTransactionBytes=e}inspectTransactionType(){try{const e=this.extractMessage(this.rawTransactionBytes);for(const s of e.compiledInstructions){const n=e.staticAccountKeys[s.programIdIndex];if(!n.equals(r.TOKEN_PROGRAM_ID))continue;const a=new i.TransactionInstruction({programId:n,keys:s.accountKeyIndexes.map(t=>({pubkey:e.staticAccountKeys[t],isSigner:e.isAccountSigner(t),isWritable:e.isAccountWritable(t)})),data:p.Buffer.from(s.data)});switch(a.data[0]){case r.TokenInstruction.Transfer:{const{keys:{destination:t}}=(0,r.decodeTransferInstruction)(a);return{transactionType:"SPL",data:{tokenAddress:t.pubkey.toBase58()}}}case r.TokenInstruction.TransferChecked:{const{keys:{destination:t}}=(0,r.decodeTransferCheckedInstruction)(a);return{transactionType:"SPL",data:{tokenAddress:t.pubkey.toBase58()}}}case r.TokenInstruction.InitializeAccount:{const{keys:{account:t,mint:o}}=(0,r.decodeInitializeAccountInstruction)(a);return{transactionType:"SPL",data:{createATA:{address:t.pubkey.toBase58(),mintAddress:o.pubkey.toBase58()}}}}default:continue}}return{transactionType:"Standard",data:{}}}catch{return{transactionType:"Standard",data:{}}}}extractMessage(e){const s=[];try{return i.VersionedTransaction.deserialize(e).message}catch(n){s.push(n.message)}try{return i.VersionedMessage.deserialize(e)}catch(n){s.push(n.message)}try{const n=i.Transaction.from(e),a=[n.feePayer,...n.instructions.flatMap(t=>t.keys.map(o=>o.pubkey))],u=Array.from(new Map(a.filter(Boolean).map(t=>[t.toBase58(),t])).values());return{compiledInstructions:n.instructions.map(t=>({programIdIndex:u.findIndex(o=>o.equals(t.programId)),accountKeyIndexes:t.keys.map(o=>u.findIndex(l=>l.equals(o.pubkey))),data:t.data})),staticAccountKeys:u,isAccountSigner:t=>n.signatures.some(o=>o.publicKey.equals(u[t])),isAccountWritable:()=>!0}}catch(n){s.push(n.message)}throw new Error(`Invalid transaction payload \u2013 all deserializers failed:
|
|
2
|
+
`+s.map((n,a)=>`${a+1}) ${n}`).join(`
|
|
3
|
+
`))}}0&&(module.exports={SolanaTransactionTypes,TransactionInspector});
|
|
2
4
|
//# sourceMappingURL=TransactionInspector.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/internal/app-binder/services/TransactionInspector.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,EAAA,yBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,
|
|
6
|
-
"names": ["TransactionInspector_exports", "__export", "SolanaTransactionTypes", "TransactionInspector", "__toCommonJS", "import_spl_token", "import_web3", "import_buffer", "rawTransactionBytes", "message", "ixMeta", "programId", "
|
|
4
|
+
"sourcesContent": ["import {\n decodeInitializeAccountInstruction,\n decodeTransferCheckedInstruction,\n decodeTransferInstruction,\n TOKEN_PROGRAM_ID,\n TokenInstruction,\n} from \"@solana/spl-token\";\nimport {\n type PublicKey,\n Transaction,\n TransactionInstruction,\n VersionedMessage,\n VersionedTransaction,\n} from \"@solana/web3.js\";\nimport { Buffer } from \"buffer\";\n\nexport enum SolanaTransactionTypes {\n STANDARD = \"Standard\",\n SPL = \"SPL\",\n}\nexport interface TxInspectorResult {\n transactionType: SolanaTransactionTypes;\n data: {\n tokenAddress?: string;\n createATA?: {\n address: string;\n mintAddress: string;\n };\n };\n}\n\nexport class TransactionInspector {\n constructor(private readonly rawTransactionBytes: Uint8Array) {}\n\n public inspectTransactionType(): TxInspectorResult {\n try {\n const message = this.extractMessage(this.rawTransactionBytes);\n\n for (const ixMeta of message.compiledInstructions) {\n const programId = message.staticAccountKeys[ixMeta.programIdIndex]!;\n if (!programId.equals(TOKEN_PROGRAM_ID)) continue;\n\n const instruction = new TransactionInstruction({\n programId,\n keys: ixMeta.accountKeyIndexes.map((i) => ({\n pubkey: message.staticAccountKeys[i]!,\n isSigner: message.isAccountSigner(i),\n isWritable: message.isAccountWritable(i),\n })),\n data: Buffer.from(ixMeta.data),\n });\n\n const instructionType = instruction.data[0];\n switch (instructionType) {\n case TokenInstruction.Transfer: {\n const {\n keys: { destination },\n } = decodeTransferInstruction(instruction);\n return {\n transactionType: SolanaTransactionTypes.SPL,\n data: { tokenAddress: destination.pubkey.toBase58() },\n };\n }\n case TokenInstruction.TransferChecked: {\n const {\n keys: { destination },\n } = decodeTransferCheckedInstruction(instruction);\n return {\n transactionType: SolanaTransactionTypes.SPL,\n data: { tokenAddress: destination.pubkey.toBase58() },\n };\n }\n case TokenInstruction.InitializeAccount: {\n const {\n keys: { account, mint },\n } = decodeInitializeAccountInstruction(instruction);\n return {\n transactionType: SolanaTransactionTypes.SPL,\n data: {\n createATA: {\n address: account.pubkey.toBase58(),\n mintAddress: mint.pubkey.toBase58(),\n },\n },\n };\n }\n default:\n continue;\n }\n }\n\n return {\n transactionType: SolanaTransactionTypes.STANDARD,\n data: {},\n };\n } catch {\n return {\n transactionType: SolanaTransactionTypes.STANDARD,\n data: {},\n };\n }\n }\n\n private extractMessage(rawBytes: Uint8Array): VersionedMessage {\n const errors: string[] = [];\n try {\n return VersionedTransaction.deserialize(rawBytes).message;\n } catch (e) {\n errors.push((e as Error).message);\n }\n\n try {\n return VersionedMessage.deserialize(rawBytes);\n } catch (e) {\n errors.push((e as Error).message);\n }\n\n try {\n const tx = Transaction.from(rawBytes);\n const allKeys = [\n tx.feePayer,\n ...tx.instructions.flatMap((ix) => ix.keys.map((k) => k.pubkey)),\n ];\n\n const staticAccountKeys = Array.from(\n new Map(\n (allKeys.filter(Boolean) as PublicKey[]).map((pk) => [\n pk.toBase58(),\n pk,\n ]),\n ).values(),\n );\n\n interface CustomCompiledInstruction {\n programIdIndex: number;\n accountKeyIndexes: number[];\n data: Uint8Array;\n }\n\n return {\n compiledInstructions: tx.instructions.map(\n (ix): CustomCompiledInstruction => ({\n programIdIndex: staticAccountKeys.findIndex((k) =>\n k.equals(ix.programId),\n ),\n accountKeyIndexes: ix.keys.map((k) =>\n staticAccountKeys.findIndex((s) => s.equals(k.pubkey)),\n ),\n data: ix.data,\n }),\n ),\n staticAccountKeys,\n isAccountSigner: (i: number) =>\n tx.signatures.some((sig) =>\n sig.publicKey.equals(staticAccountKeys[i]!),\n ),\n isAccountWritable: () => true,\n } as unknown as VersionedMessage;\n } catch (e) {\n errors.push((e as Error).message);\n }\n\n throw new Error(\n \"Invalid transaction payload \u2013 all deserializers failed:\\n\" +\n errors.map((m, i) => `${i + 1}) ${m}`).join(\"\\n\"),\n );\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,EAAA,yBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAMO,6BACPC,EAMO,2BACPC,EAAuB,kBAEXL,OACVA,EAAA,SAAW,WACXA,EAAA,IAAM,MAFIA,OAAA,IAeL,MAAMC,CAAqB,CAChC,YAA6BK,EAAiC,CAAjC,yBAAAA,CAAkC,CAExD,wBAA4C,CACjD,GAAI,CACF,MAAMC,EAAU,KAAK,eAAe,KAAK,mBAAmB,EAE5D,UAAWC,KAAUD,EAAQ,qBAAsB,CACjD,MAAME,EAAYF,EAAQ,kBAAkBC,EAAO,cAAc,EACjE,GAAI,CAACC,EAAU,OAAO,kBAAgB,EAAG,SAEzC,MAAMC,EAAc,IAAI,yBAAuB,CAC7C,UAAAD,EACA,KAAMD,EAAO,kBAAkB,IAAKG,IAAO,CACzC,OAAQJ,EAAQ,kBAAkBI,CAAC,EACnC,SAAUJ,EAAQ,gBAAgBI,CAAC,EACnC,WAAYJ,EAAQ,kBAAkBI,CAAC,CACzC,EAAE,EACF,KAAM,SAAO,KAAKH,EAAO,IAAI,CAC/B,CAAC,EAGD,OADwBE,EAAY,KAAK,CAAC,EACjB,CACvB,KAAK,mBAAiB,SAAU,CAC9B,KAAM,CACJ,KAAM,CAAE,YAAAE,CAAY,CACtB,KAAI,6BAA0BF,CAAW,EACzC,MAAO,CACL,gBAAiB,MACjB,KAAM,CAAE,aAAcE,EAAY,OAAO,SAAS,CAAE,CACtD,CACF,CACA,KAAK,mBAAiB,gBAAiB,CACrC,KAAM,CACJ,KAAM,CAAE,YAAAA,CAAY,CACtB,KAAI,oCAAiCF,CAAW,EAChD,MAAO,CACL,gBAAiB,MACjB,KAAM,CAAE,aAAcE,EAAY,OA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,EACA,gBAAkBX,GAChBO,EAAG,WAAW,KAAMO,GAClBA,EAAI,UAAU,OAAOH,EAAkBX,CAAC,CAAE,CAC5C,EACF,kBAAmB,IAAM,EAC3B,CACF,OAASM,EAAG,CACVD,EAAO,KAAMC,EAAY,OAAO,CAClC,CAEA,MAAM,IAAI,MACR;AAAA,EACED,EAAO,IAAI,CAACU,EAAGf,IAAM,GAAGA,EAAI,CAAC,KAAKe,CAAC,EAAE,EAAE,KAAK;AAAA,CAAI,CACpD,CACF,CACF",
|
|
6
|
+
"names": ["TransactionInspector_exports", "__export", "SolanaTransactionTypes", "TransactionInspector", "__toCommonJS", "import_spl_token", "import_web3", "import_buffer", "rawTransactionBytes", "message", "ixMeta", "programId", "instruction", "i", "destination", "account", "mint", "rawBytes", "errors", "e", "tx", "allKeys", "ix", "k", "staticAccountKeys", "pk", "s", "sig", "m"]
|
|
7
7
|
}
|
package/lib/cjs/package.json
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{decodeInitializeAccountInstruction as u,decodeTransferCheckedInstruction as d,decodeTransferInstruction as p,TOKEN_PROGRAM_ID as y,TokenInstruction as c}from"@solana/spl-token";import{Transaction as l,TransactionInstruction as m,VersionedMessage as T,VersionedTransaction as A}from"@solana/web3.js";import{Buffer as I}from"buffer";var f=(n=>(n.STANDARD="Standard",n.SPL="SPL",n))(f||{});class x{constructor(s){this.rawTransactionBytes=s}inspectTransactionType(){try{const s=this.extractMessage(this.rawTransactionBytes);for(const n of s.compiledInstructions){const t=s.staticAccountKeys[n.programIdIndex];if(!t.equals(y))continue;const r=new m({programId:t,keys:n.accountKeyIndexes.map(e=>({pubkey:s.staticAccountKeys[e],isSigner:s.isAccountSigner(e),isWritable:s.isAccountWritable(e)})),data:I.from(n.data)});switch(r.data[0]){case c.Transfer:{const{keys:{destination:e}}=p(r);return{transactionType:"SPL",data:{tokenAddress:e.pubkey.toBase58()}}}case c.TransferChecked:{const{keys:{destination:e}}=d(r);return{transactionType:"SPL",data:{tokenAddress:e.pubkey.toBase58()}}}case c.InitializeAccount:{const{keys:{account:e,mint:a}}=u(r);return{transactionType:"SPL",data:{createATA:{address:e.pubkey.toBase58(),mintAddress:a.pubkey.toBase58()}}}}default:continue}}return{transactionType:"Standard",data:{}}}catch{return{transactionType:"Standard",data:{}}}}extractMessage(s){const n=[];try{return A.deserialize(s).message}catch(t){n.push(t.message)}try{return T.deserialize(s)}catch(t){n.push(t.message)}try{const t=l.from(s),r=[t.feePayer,...t.instructions.flatMap(e=>e.keys.map(a=>a.pubkey))],o=Array.from(new Map(r.filter(Boolean).map(e=>[e.toBase58(),e])).values());return{compiledInstructions:t.instructions.map(e=>({programIdIndex:o.findIndex(a=>a.equals(e.programId)),accountKeyIndexes:e.keys.map(a=>o.findIndex(i=>i.equals(a.pubkey))),data:e.data})),staticAccountKeys:o,isAccountSigner:e=>t.signatures.some(a=>a.publicKey.equals(o[e])),isAccountWritable:()=>!0}}catch(t){n.push(t.message)}throw new Error(`Invalid transaction payload \u2013 all deserializers failed:
|
|
2
|
+
`+n.map((t,r)=>`${r+1}) ${t}`).join(`
|
|
3
|
+
`))}}export{f as SolanaTransactionTypes,x as TransactionInspector};
|
|
2
4
|
//# sourceMappingURL=TransactionInspector.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/internal/app-binder/services/TransactionInspector.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n
|
|
5
|
-
"mappings": "AAAA,OACE
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import {\n decodeInitializeAccountInstruction,\n decodeTransferCheckedInstruction,\n decodeTransferInstruction,\n TOKEN_PROGRAM_ID,\n TokenInstruction,\n} from \"@solana/spl-token\";\nimport {\n type PublicKey,\n Transaction,\n TransactionInstruction,\n VersionedMessage,\n VersionedTransaction,\n} from \"@solana/web3.js\";\nimport { Buffer } from \"buffer\";\n\nexport enum SolanaTransactionTypes {\n STANDARD = \"Standard\",\n SPL = \"SPL\",\n}\nexport interface TxInspectorResult {\n transactionType: SolanaTransactionTypes;\n data: {\n tokenAddress?: string;\n createATA?: {\n address: string;\n mintAddress: string;\n };\n };\n}\n\nexport class TransactionInspector {\n constructor(private readonly rawTransactionBytes: Uint8Array) {}\n\n public inspectTransactionType(): TxInspectorResult {\n try {\n const message = this.extractMessage(this.rawTransactionBytes);\n\n for (const ixMeta of message.compiledInstructions) {\n const programId = message.staticAccountKeys[ixMeta.programIdIndex]!;\n if (!programId.equals(TOKEN_PROGRAM_ID)) continue;\n\n const instruction = new TransactionInstruction({\n programId,\n keys: ixMeta.accountKeyIndexes.map((i) => ({\n pubkey: message.staticAccountKeys[i]!,\n isSigner: message.isAccountSigner(i),\n isWritable: message.isAccountWritable(i),\n })),\n data: Buffer.from(ixMeta.data),\n });\n\n const instructionType = instruction.data[0];\n switch (instructionType) {\n case TokenInstruction.Transfer: {\n const {\n keys: { destination },\n } = decodeTransferInstruction(instruction);\n return {\n transactionType: SolanaTransactionTypes.SPL,\n data: { tokenAddress: destination.pubkey.toBase58() },\n };\n }\n case TokenInstruction.TransferChecked: {\n const {\n keys: { destination },\n } = decodeTransferCheckedInstruction(instruction);\n return {\n transactionType: SolanaTransactionTypes.SPL,\n data: { tokenAddress: destination.pubkey.toBase58() },\n };\n }\n case TokenInstruction.InitializeAccount: {\n const {\n keys: { account, mint },\n } = decodeInitializeAccountInstruction(instruction);\n return {\n transactionType: SolanaTransactionTypes.SPL,\n data: {\n createATA: {\n address: account.pubkey.toBase58(),\n mintAddress: mint.pubkey.toBase58(),\n },\n },\n };\n }\n default:\n continue;\n }\n }\n\n return {\n transactionType: SolanaTransactionTypes.STANDARD,\n data: {},\n };\n } catch {\n return {\n transactionType: SolanaTransactionTypes.STANDARD,\n data: {},\n };\n }\n }\n\n private extractMessage(rawBytes: Uint8Array): VersionedMessage {\n const errors: string[] = [];\n try {\n return VersionedTransaction.deserialize(rawBytes).message;\n } catch (e) {\n errors.push((e as Error).message);\n }\n\n try {\n return VersionedMessage.deserialize(rawBytes);\n } catch (e) {\n errors.push((e as Error).message);\n }\n\n try {\n const tx = Transaction.from(rawBytes);\n const allKeys = [\n tx.feePayer,\n ...tx.instructions.flatMap((ix) => ix.keys.map((k) => k.pubkey)),\n ];\n\n const staticAccountKeys = Array.from(\n new Map(\n (allKeys.filter(Boolean) as PublicKey[]).map((pk) => [\n pk.toBase58(),\n pk,\n ]),\n ).values(),\n );\n\n interface CustomCompiledInstruction {\n programIdIndex: number;\n accountKeyIndexes: number[];\n data: Uint8Array;\n }\n\n return {\n compiledInstructions: tx.instructions.map(\n (ix): CustomCompiledInstruction => ({\n programIdIndex: staticAccountKeys.findIndex((k) =>\n k.equals(ix.programId),\n ),\n accountKeyIndexes: ix.keys.map((k) =>\n staticAccountKeys.findIndex((s) => s.equals(k.pubkey)),\n ),\n data: ix.data,\n }),\n ),\n staticAccountKeys,\n isAccountSigner: (i: number) =>\n tx.signatures.some((sig) =>\n sig.publicKey.equals(staticAccountKeys[i]!),\n ),\n isAccountWritable: () => true,\n } as unknown as VersionedMessage;\n } catch (e) {\n errors.push((e as Error).message);\n }\n\n throw new Error(\n \"Invalid transaction payload \u2013 all deserializers failed:\\n\" +\n errors.map((m, i) => `${i + 1}) ${m}`).join(\"\\n\"),\n );\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OACE,sCAAAA,EACA,oCAAAC,EACA,6BAAAC,EACA,oBAAAC,EACA,oBAAAC,MACK,oBACP,OAEE,eAAAC,EACA,0BAAAC,EACA,oBAAAC,EACA,wBAAAC,MACK,kBACP,OAAS,UAAAC,MAAc,SAEhB,IAAKC,OACVA,EAAA,SAAW,WACXA,EAAA,IAAM,MAFIA,OAAA,IAeL,MAAMC,CAAqB,CAChC,YAA6BC,EAAiC,CAAjC,yBAAAA,CAAkC,CAExD,wBAA4C,CACjD,GAAI,CACF,MAAMC,EAAU,KAAK,eAAe,KAAK,mBAAm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,CAAC,EAC1B,GAAI,CACF,OAAOd,EAAqB,YAAYa,CAAQ,EAAE,OACpD,OAASE,EAAG,CACVD,EAAO,KAAMC,EAAY,OAAO,CAClC,CAEA,GAAI,CACF,OAAOhB,EAAiB,YAAYc,CAAQ,CAC9C,OAASE,EAAG,CACVD,EAAO,KAAMC,EAAY,OAAO,CAClC,CAEA,GAAI,CACF,MAAMC,EAAKnB,EAAY,KAAKgB,CAAQ,EAC9BI,EAAU,CACdD,EAAG,SACH,GAAGA,EAAG,aAAa,QAASE,GAAOA,EAAG,KAAK,IAAKC,GAAMA,EAAE,MAAM,CAAC,CACjE,EAEMC,EAAoB,MAAM,KAC9B,IAAI,IACDH,EAAQ,OAAO,OAAO,EAAkB,IAAKI,GAAO,CACnDA,EAAG,SAAS,EACZA,CACF,CAAC,CACH,EAAE,OAAO,CACX,EAQA,MAAO,CACL,qBAAsBL,EAAG,aAAa,IACnCE,IAAmC,CAClC,eAAgBE,EAAkB,UAAWD,GAC3CA,EAAE,OAAOD,EAAG,SAAS,CACvB,EACA,kBAAmBA,EAAG,KAAK,IAAKC,GAC9BC,EAAkB,UAAWE,GAAMA,EAAE,OAAOH,EAAE,MAAM,CAAC,CACvD,EACA,KAAMD,EAAG,IACX,EACF,EACA,kBAAAE,EACA,gBAAkBX,GAChBO,EAAG,WAAW,KAAMO,GAClBA,EAAI,UAAU,OAAOH,EAAkBX,CAAC,CAAE,CAC5C,EACF,kBAAmB,IAAM,EAC3B,CACF,OAASM,EAAG,CACVD,EAAO,KAAMC,EAAY,OAAO,CAClC,CAEA,MAAM,IAAI,MACR;AAAA,EACED,EAAO,IAAI,CAACU,EAAGf,IAAM,GAAGA,EAAI,CAAC,KAAKe,CAAC,EAAE,EAAE,KAAK;AAAA,CAAI,CACpD,CACF,CACF",
|
|
6
|
+
"names": ["decodeInitializeAccountInstruction", "decodeTransferCheckedInstruction", "decodeTransferInstruction", "TOKEN_PROGRAM_ID", "TokenInstruction", "Transaction", "TransactionInstruction", "VersionedMessage", "VersionedTransaction", "Buffer", "SolanaTransactionTypes", "TransactionInspector", "rawTransactionBytes", "message", "ixMeta", "programId", "instruction", "i", "destination", "account", "mint", "rawBytes", "errors", "e", "tx", "allKeys", "ix", "k", "staticAccountKeys", "pk", "s", "sig", "m"]
|
|
7
7
|
}
|
package/lib/esm/package.json
CHANGED
|
@@ -6,7 +6,6 @@ export interface TxInspectorResult {
|
|
|
6
6
|
transactionType: SolanaTransactionTypes;
|
|
7
7
|
data: {
|
|
8
8
|
tokenAddress?: string;
|
|
9
|
-
mintAddress?: string;
|
|
10
9
|
createATA?: {
|
|
11
10
|
address: string;
|
|
12
11
|
mintAddress: string;
|
|
@@ -15,16 +14,8 @@ export interface TxInspectorResult {
|
|
|
15
14
|
}
|
|
16
15
|
export declare class TransactionInspector {
|
|
17
16
|
private readonly rawTransactionBytes;
|
|
18
|
-
/**
|
|
19
|
-
* @param rawTransactionBytes - the raw tx bytes (legacy or v0)
|
|
20
|
-
*/
|
|
21
17
|
constructor(rawTransactionBytes: Uint8Array);
|
|
22
18
|
inspectTransactionType(): TxInspectorResult;
|
|
23
|
-
|
|
24
|
-
* normalise any tx (legacy or v0) into { compiledInstructions, allKeys }.
|
|
25
|
-
* if LUT accounts are provided, looked-up keys are included in allKeys.
|
|
26
|
-
*/
|
|
27
|
-
private normaliseMessage;
|
|
28
|
-
private tryDeserialiseVersioned;
|
|
19
|
+
private extractMessage;
|
|
29
20
|
}
|
|
30
21
|
//# sourceMappingURL=TransactionInspector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionInspector.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/services/TransactionInspector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransactionInspector.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/services/TransactionInspector.ts"],"names":[],"mappings":"AAgBA,oBAAY,sBAAsB;IAChC,QAAQ,aAAa;IACrB,GAAG,QAAQ;CACZ;AACD,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,sBAAsB,CAAC;IACxC,IAAI,EAAE;QACJ,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE;YACV,OAAO,EAAE,MAAM,CAAC;YAChB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;CACH;AAED,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,UAAU;IAErD,sBAAsB,IAAI,iBAAiB;IAqElD,OAAO,CAAC,cAAc;CAgEvB"}
|