Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using solana-dex-parser with mappings #2899

Open

Description

added the following to mapping

import { DexParser, SolanaTransaction } from 'solana-dex-parser';
const parser = new DexParser();

Test

import { subqlTest } from "@subql/testing";
import { Transfer } from "../types/models";
// Example test for Transfer entity
subqlTest(
 "handleTransfer test",
 362963837, // block height to process
 [],
 [
 // Expected output entities
 {
 id: "test-signature-123-0",
 from: "source-account-address",
 to: "destination-account-address",
 amount: BigInt(100),
 blockNumber: BigInt(362963837),
 transactionHash: "test-signature-123",
 date: new Date("2025-08-28T09:32:21.000Z")
 }
 ],
 "handleTransfer" // handler name
);

Error on test run

2025年08月29日T01:13:29.164Z <SolanaDecoder> INFO Loaded IDL for TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA 
2025年08月29日T01:13:29.172Z <UnfinalizedBlocks> INFO Unfinalized blocks is disabled 
2025年08月29日T01:13:46.914Z <SolanaBlock> WARN Unable to parse log message: Transfer: insufficient lamports 1026178, need 1844400 
2025年08月29日T01:13:47.302Z <test-runner> WARN Test: handleTransfer test field due to runtime error 
2025年08月29日T01:13:47.302Z <test-runner> WARN Test handleTransfer test failed to run ReferenceError: TextEncoder is not defined
2025年08月29日T01:13:47.349Z <StoreCache> WARN Error: SequelizeDatabaseError: relation "test-solana-token-program-starter._metadata" does not exist, Name: SequelizeDatabaseError, Parent: error: relation "test-solana-token-program-starter._metadata" does not exist, Original: error: relation "test-solana-token-program-starter._metadata" does not exist 
2025年08月29日T01:13:47.349Z <StoreCache> ERROR Database transaction failed, rolling back DatabaseError: relation "test-solana-token-program-starter._metadata" does not exist
2025年08月29日T01:13:47.352Z <Testing> ERROR undefined Error: Testing failed
Cause: DatabaseError: relation "test-solana-token-program-starter._metadata" does not exist
Waiting for the debugger to disconnect...
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Waiting for the debugger to disconnect...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /