Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
yoozo committed Feb 12, 2025
1 parent 43780a3 commit ab2e468
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Stellar/soroban-futurenet-starter/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
StellarHandlerKind,
StellarProject,
} from "@subql/types-stellar";
import { Horizon } from "stellar-sdk";
import { Horizon } from "@stellar/stellar-sdk";
const project: StellarProject = {
specVersion: "1.0.0",
name: "soroban-futurenet-starter",
Expand Down
20 changes: 10 additions & 10 deletions Stellar/soroban-futurenet-starter/src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
AccountCredited,
AccountDebited,
} from "stellar-sdk/lib/horizon/types/effects";
import { Horizon } from "stellar-sdk";
import { Horizon } from "@stellar/stellar-sdk";
import { Address, xdr } from "soroban-client";

export async function handleOperation(
op: StellarOperation<Horizon.HorizonApi.PaymentOperationResponse>,
op: StellarOperation<Horizon.HorizonApi.PaymentOperationResponse>
): Promise<void> {
logger.info(`Indexing operation ${op.id}, type: ${op.type}`);

Expand All @@ -33,13 +33,13 @@ export async function handleOperation(
}

export async function handleCredit(
effect: StellarEffect<AccountCredited>,
effect: StellarEffect<AccountCredited>
): Promise<void> {
logger.info(`Indexing effect ${effect.id}, type: ${effect.type}`);

const account = await checkAndGetAccount(
effect.account,
effect.ledger.sequence,
effect.ledger.sequence
);

const credit = Credit.create({
Expand All @@ -53,13 +53,13 @@ export async function handleCredit(
}

export async function handleDebit(
effect: StellarEffect<AccountDebited>,
effect: StellarEffect<AccountDebited>
): Promise<void> {
logger.info(`Indexing effect ${effect.id}, type: ${effect.type}`);

const account = await checkAndGetAccount(
effect.account,
effect.ledger.sequence,
effect.ledger.sequence
);

const debit = Debit.create({
Expand All @@ -74,7 +74,7 @@ export async function handleDebit(

export async function handleEvent(event: SorobanEvent): Promise<void> {
logger.info(
`New transfer event found at block ${event.ledger.sequence.toString()}`,
`New transfer event found at block ${event.ledger.sequence.toString()}`
);

// Get data from the event
Expand All @@ -93,11 +93,11 @@ export async function handleEvent(event: SorobanEvent): Promise<void> {

const fromAccount = await checkAndGetAccount(
decodeAddress(from),
event.ledger.sequence,
event.ledger.sequence
);
const toAccount = await checkAndGetAccount(
decodeAddress(to),
event.ledger.sequence,
event.ledger.sequence
);

// Create the new transfer entity
Expand All @@ -118,7 +118,7 @@ export async function handleEvent(event: SorobanEvent): Promise<void> {

async function checkAndGetAccount(
id: string,
ledgerSequence: number,
ledgerSequence: number
): Promise<Account> {
let account = await Account.get(id.toLowerCase());
if (!account) {
Expand Down
2 changes: 1 addition & 1 deletion Stellar/soroban-testnet-starter/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
StellarHandlerKind,
StellarProject,
} from "@subql/types-stellar";
import { Horizon } from "stellar-sdk";
import { Horizon } from "@stellar/stellar-sdk";

/* This is your project configuration */
const project: StellarProject = {
Expand Down
20 changes: 10 additions & 10 deletions Stellar/soroban-testnet-starter/src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
AccountCredited,
AccountDebited,
} from "stellar-sdk/lib/horizon/types/effects";
import { Horizon } from "stellar-sdk";
import { Horizon } from "@stellar/stellar-sdk";
import { Address, xdr } from "soroban-client";

export async function handleOperation(
op: StellarOperation<Horizon.HorizonApi.PaymentOperationResponse>,
op: StellarOperation<Horizon.HorizonApi.PaymentOperationResponse>
): Promise<void> {
logger.info(`Indexing operation ${op.id}, type: ${op.type}`);

Expand All @@ -33,13 +33,13 @@ export async function handleOperation(
}

export async function handleCredit(
effect: StellarEffect<AccountCredited>,
effect: StellarEffect<AccountCredited>
): Promise<void> {
logger.info(`Indexing effect ${effect.id}, type: ${effect.type}`);

const account = await checkAndGetAccount(
effect.account,
effect.ledger.sequence,
effect.ledger.sequence
);

const credit = Credit.create({
Expand All @@ -53,13 +53,13 @@ export async function handleCredit(
}

export async function handleDebit(
effect: StellarEffect<AccountDebited>,
effect: StellarEffect<AccountDebited>
): Promise<void> {
logger.info(`Indexing effect ${effect.id}, type: ${effect.type}`);

const account = await checkAndGetAccount(
effect.account,
effect.ledger.sequence,
effect.ledger.sequence
);

const debit = Debit.create({
Expand All @@ -74,7 +74,7 @@ export async function handleDebit(

export async function handleEvent(event: SorobanEvent): Promise<void> {
logger.info(
`New transfer event found at block ${event.ledger.sequence.toString()}`,
`New transfer event found at block ${event.ledger.sequence.toString()}`
);

// Get data from the event
Expand All @@ -93,11 +93,11 @@ export async function handleEvent(event: SorobanEvent): Promise<void> {

const fromAccount = await checkAndGetAccount(
decodeAddress(from),
event.ledger.sequence,
event.ledger.sequence
);
const toAccount = await checkAndGetAccount(
decodeAddress(to),
event.ledger.sequence,
event.ledger.sequence
);

// Create the new transfer entity
Expand All @@ -118,7 +118,7 @@ export async function handleEvent(event: SorobanEvent): Promise<void> {

async function checkAndGetAccount(
id: string,
ledgerSequence: number,
ledgerSequence: number
): Promise<Account> {
let account = await Account.get(id.toLowerCase());
if (!account) {
Expand Down

0 comments on commit ab2e468

Please sign in to comment.