Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
920c5ba25b | ||
|
|
3d447ef2e8 |
@@ -129,7 +129,7 @@ func (tx *Tx) Parser() error {
|
|||||||
tx.Swaps = swaps
|
tx.Swaps = swaps
|
||||||
}
|
}
|
||||||
for i, instr := range tx.rawTx.Transaction.Message.Instructions {
|
for i, instr := range tx.rawTx.Transaction.Message.Instructions {
|
||||||
if p, exists := actionPrograms[programAccount]; exists {
|
if p, exists := actionPrograms[accountList[instr.ProgramIDIndex]]; exists {
|
||||||
_, err := p(tx, instr, InnerInstructions{}, [2]uint{uint(i), uint(0)})
|
_, err := p(tx, instr, InnerInstructions{}, [2]uint{uint(i), uint(0)})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, InstructionIgnoredError) {
|
if errors.Is(err, InstructionIgnoredError) {
|
||||||
|
|||||||
14
system.go
14
system.go
@@ -34,12 +34,14 @@ func TransferParser(result *RawTx, instruction Instruction, offset [2]uint, tx *
|
|||||||
from := result.accountList[result.Transaction.Message.Instructions[offset[0]].Accounts[0]]
|
from := result.accountList[result.Transaction.Message.Instructions[offset[0]].Accounts[0]]
|
||||||
to := result.accountList[instruction.Accounts[1]]
|
to := result.accountList[instruction.Accounts[1]]
|
||||||
|
|
||||||
if offset[1] == 0 {
|
if result.Meta.Err == nil {
|
||||||
tx.SolTransfer = append(tx.SolTransfer, SolTransfer{
|
if offset[1] == 0 {
|
||||||
From: from,
|
tx.SolTransfer = append(tx.SolTransfer, SolTransfer{
|
||||||
To: to,
|
From: from,
|
||||||
Amount: decimal.NewFromInt(int64(lamports)), // solana decimals
|
To: to,
|
||||||
})
|
Amount: decimal.NewFromInt(int64(lamports)), // solana decimals
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// load platform by to address
|
// load platform by to address
|
||||||
platform, ok := platformFeeAddresses[to]
|
platform, ok := platformFeeAddresses[to]
|
||||||
|
|||||||
Reference in New Issue
Block a user