Skip to content

Commit

Permalink
chore: bump deps, bump version, update build
Browse files Browse the repository at this point in the history
  • Loading branch information
devDesu committed Jan 13, 2023
1 parent 15e185c commit 35a775d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 30 deletions.
7 changes: 4 additions & 3 deletions dist/browser/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/browser/index.js.map

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions dist/cjs/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AccountMeta, PublicKey, Transaction, TransactionInstruction } from "@so
/**
* Context of logs for specific instruction
*/
export declare type LogContext = {
export type LogContext = {
rawLogs: string[];
errors: string[];
logMessages: string[];
Expand All @@ -15,48 +15,48 @@ export declare type LogContext = {
instructionIndex: number;
invokeResult?: string;
};
export declare type TransactionWithLogs = {
export type TransactionWithLogs = {
logs?: string[];
transaction: Transaction;
};
/**
* Map which keys are programIds (base58-encoded) and values are ix parsers
*/
export declare type InstructionParsers = Map<string, ParserFunction<Idl, string>>;
export type InstructionParsers = Map<string, ParserFunction<Idl, string>>;
/**
* Function that takes transaction ix and returns parsed variant
*/
export declare type ParserFunction<I extends Idl, IxName extends InstructionNames<I>> = (arg: TransactionInstruction) => ParsedInstruction<I, IxName>;
export type ParserFunction<I extends Idl, IxName extends InstructionNames<I>> = (arg: TransactionInstruction) => ParsedInstruction<I, IxName>;
/**
* public key as base58 string, parser
*/
export declare type InstructionParserInfo = [string, ParserFunction<Idl, string>];
export type InstructionParserInfo = [string, ParserFunction<Idl, string>];
export interface ParsedAccount extends AccountMeta {
/** Account name, same as in Idl, nested accounts look like `account > nestedAccount` */
name?: string;
}
/**
* Instructions args with correct types for specific instruction by instruction name
*/
export declare type ParsedIdlArgsByInstructionName<I extends Idl, Ix extends I["instructions"][number]> = {
export type ParsedIdlArgsByInstructionName<I extends Idl, Ix extends I["instructions"][number]> = {
[ArgName in Ix["args"][number]["name"]]: DecodeType<(Ix["args"][number] & {
name: ArgName;
})["type"], IdlTypes<I>>;
};
export declare type InstructionNames<I extends Idl> = I["instructions"][number]["name"];
export declare type ParsedIdlArgs<I extends Idl, IxName extends InstructionNames<I> = InstructionNames<I>> = ParsedIdlArgsByInstructionName<I, IxByName<I, IxName>>;
export declare type ParsedArgs = {
export type InstructionNames<I extends Idl> = I["instructions"][number]["name"];
export type ParsedIdlArgs<I extends Idl, IxName extends InstructionNames<I> = InstructionNames<I>> = ParsedIdlArgsByInstructionName<I, IxByName<I, IxName>>;
export type ParsedArgs = {
[key: string]: unknown;
};
export declare type UnknownInstruction = {
export type UnknownInstruction = {
name: "unknown" | string;
args: {
unknown: unknown;
};
accounts: ParsedAccount[];
programId: PublicKey;
};
export declare type ParsedInstruction<I extends Idl, IxName extends InstructionNames<I> = InstructionNames<I>> = UnknownInstruction | ParsedIdlInstruction<I, IxName> | ParsedCustomInstruction;
export type ParsedInstruction<I extends Idl, IxName extends InstructionNames<I> = InstructionNames<I>> = UnknownInstruction | ParsedIdlInstruction<I, IxName> | ParsedCustomInstruction;
export interface ParsedCustomInstruction {
/** Instruction name */
name: string;
Expand All @@ -82,7 +82,7 @@ export interface ProgramInfoType {
/**
* @private
*/
declare type TypeMap = {
type TypeMap = {
publicKey: PublicKey;
bool: boolean;
string: string;
Expand All @@ -91,11 +91,11 @@ declare type TypeMap = {
} & {
[K in "u64" | "i64" | "u128" | "i128"]: BN;
};
declare type IdlType = Idl["instructions"][number]["args"][number]["type"];
type IdlType = Idl["instructions"][number]["args"][number]["type"];
/**
* @private
*/
export declare type DecodeType<T extends IdlType, Defined> = T extends keyof TypeMap ? TypeMap[T] : T extends {
export type DecodeType<T extends IdlType, Defined> = T extends keyof TypeMap ? TypeMap[T] : T extends {
defined: keyof Defined;
} ? Defined[T["defined"]] : T extends {
option: {
Expand All @@ -113,26 +113,26 @@ export declare type DecodeType<T extends IdlType, Defined> = T extends keyof Typ
/**
* Interface to get instruction by name from IDL
*/
export declare type IxByName<I extends Idl, IxName extends I["instructions"][number]["name"]> = I["instructions"][number] & {
export type IxByName<I extends Idl, IxName extends I["instructions"][number]["name"]> = I["instructions"][number] & {
name: IxName;
};
export declare type IdlAccount = {
export type IdlAccount = {
name: string;
isMut: boolean;
isSigner: boolean;
};
export declare type IdlAccounts = {
export type IdlAccounts = {
name: string;
accounts: IdlAccount[];
};
/**
* @private
*/
export declare type IdlAccountItem = IdlAccounts | IdlAccount;
export type IdlAccountItem = IdlAccounts | IdlAccount;
/**
* @private
*/
export declare type AssociatedTokenProgramIdlLike = {
export type AssociatedTokenProgramIdlLike = {
name: "associated_token_program";
version: "1.0.3";
instructions: [
Expand Down
2 changes: 1 addition & 1 deletion dist/cjs/interfaces.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
{
"name": "@debridge-finance/solana-transaction-parser",
"description": "Tool for parsing arbitrary Solana transactions with IDL/custom parsers",
"version": "1.1.0",
"version": "1.1.1",
"author": "deBridge",
"license": "LGPL-2.1",
"homepage": "https://debridge.finance",
"repository": {
"type": "git",
"url": "github:debridge-finance/solana-tx-parser-public"
},

"keywords": [
"solana",
"deBridge",
"blockchain"
],

"files": [
"dist/**",
"docs/**",
"LICENSE",
"README.md"
],

"browser": "./dist/browser/index.js",
"module": "./dist/esm/index.js",
"main": "./dist/cjs/index.js",
Expand Down Expand Up @@ -68,8 +65,8 @@
"dependencies": {
"@project-serum/anchor": "0.25.0",
"@solana/buffer-layout": "4.0.0",
"@solana/spl-token": "0.2.0",
"@solana/web3.js": "1.66.2",
"@solana/spl-token": "0.3.7",
"@solana/web3.js": "1.73.0",
"buffer": "6.0.3"
}
}

0 comments on commit 35a775d

Please sign in to comment.