Skip to content
ololadeanalytics-progPublic

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

533 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nexora TypeScript SDK

Cursor Pagination

The SDK provides helpers for cursor-based pagination to simplify fetching large datasets.

Single Page

import { NexoraClient } from '@lumen-nexora/nexora';

const client = new NexoraClient({ /* config */ });
const { nodes, pageInfo } = await client.transfers.list(
  { from: '0x123...' },
  { orderBy: 'timestamp', orderDirection: 'desc' },
  { first: 50 }
);

console.log(nodes); // Array of transfers
console.log(pageInfo.hasNextPage); // boolean
console.log(pageInfo.endCursor); // string | null

Streaming with Async Iteration

const client = new NexoraClient({ /* config */ });

for await (const transfer of client.transfers.iterate(
  { from: '0x123...' },
  { orderBy: 'timestamp' }
)) {
  console.log(transfer);
  // Break early to stop further requests
  if (someCondition) break;
}

Fetch All Pages

const allTransfers = await client.transfers.listAll(
  { from: '0x123...' },
  { orderBy: 'timestamp' }
);

Aborting Requests

const controller = new AbortController();

setTimeout(() => controller.abort(), 5000); // Abort after 5 seconds

try {
  for await (const transfer of client.transfers.iterate(
    { from: '0x123...' },
    undefined,
    undefined,
    controller.signal
  )) {
    console.log(transfer);
  }
} catch (error) {
  if (error.name === 'CursorPaginationError') {
    console.log('Iteration was aborted');
  }
}

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages