-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts: CPI events parsing #2886
Open
ochaloup
wants to merge
3
commits into
coral-xyz:master
Choose a base branch
from
ochaloup:ts-cp-event-parse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ts: CPI events parsing #2886
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 4 additions & 9 deletions
13
ts/packages/spl-associated-token-account/src/coder/events.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplAssociatedTokenAccountEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplAssociatedTokenAccount program does not have events"); | ||
export class SplAssociatedTokenAccountEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplBinaryOptionEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplBinaryOption program does not have events"); | ||
export class SplBinaryOptionEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplBinaryOraclePairEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplBinaryOraclePair program does not have events"); | ||
export class SplBinaryOraclePairEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplFeatureProposalEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplFeatureProposal program does not have events"); | ||
export class SplFeatureProposalEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplGovernanceEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplGovernance program does not have events"); | ||
export class SplGovernanceEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplMemoEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplMemo program does not have events"); | ||
export class SplMemoEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplNameServiceEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplNameService program does not have events"); | ||
export class SplNameServiceEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplRecordEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplRecord program does not have events"); | ||
export class SplRecordEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplStakePoolEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplStakePool program does not have events"); | ||
export class SplStakePoolEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplStatelessAsksEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplStatelessAsks program does not have events"); | ||
export class SplStatelessAsksEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { Idl, Event, EventCoder } from "@coral-xyz/anchor"; | ||
import { IdlEvent } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
import { Idl, EventCoder, NoEventCoder } from "@coral-xyz/anchor"; | ||
|
||
export class SplTokenLendingEventsCoder implements EventCoder { | ||
constructor(_idl: Idl) {} | ||
|
||
decode<E extends IdlEvent = IdlEvent, T = Record<string, string>>( | ||
_log: string | ||
): Event<E, T> | null { | ||
throw new Error("SplTokenLending program does not have events"); | ||
export class SplTokenLendingEventsCoder extends NoEventCoder implements EventCoder { | ||
constructor(_idl: Idl) { | ||
super(); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if we could also support
TransactionResponse
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added the
TransactionResponse
to types.When autogenerated, how can I run it that I can remove the extended class and make it as generated? I run the
./setup-tests.sh
but I haven't found a guideline on development that can help me.