This file contains hidden or 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
import { | |
EvmBatchProcessor, | |
type EvmBatchProcessorFields, | |
type Transaction as _Transaction, | |
} from '@subsquid/evm-processor'; | |
export const processor = new EvmBatchProcessor() | |
// .setGateway(archive[config.NETWORK]) | |
.setRpcEndpoint({ | |
capacity: 2, |
This file contains hidden or 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
export function retryWithExponentialBackoff<T extends () => Promise<Awaited<ReturnType<T>>>>( | |
fn: T, | |
maxAttempts = 5, | |
baseDelayMs = 1000, | |
) { | |
let attempt = 1; | |
const execute = async () => { | |
try { | |
return await fn(); |
This file contains hidden or 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
{"distribution": [ | |
{ | |
"timestamp": "2024-11-09T00:01:27.243Z", | |
"address": "0x23A7c1Bb6A7D7036dF8322704D3D297AD01EEBd7", | |
"points": 10258 | |
}, | |
{ | |
"timestamp": "2024-11-09T00:01:27.243Z", | |
"address": "0x70F9D0aE291de8ee2062764B309A7bD7Fa3dC0f2", | |
"points": 5129 |
This file contains hidden or 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
export const ResourceTypes = { | |
clay: 'clay', | |
coal: 'coal', | |
copper: 'copper', | |
diamond: 'diamond', | |
gold: 'gold', | |
iron: 'iron', | |
// silver: 'silver', | |
stone: 'stone', | |
wood: 'wood', |
This file contains hidden or 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
import { | |
type Address, | |
type ContractFunctionParameters, | |
createPublicClient, | |
encodePacked, | |
http, | |
keccak256, | |
namehash, | |
zeroAddress, | |
} from 'viem'; |
This file contains hidden or 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
import { Processor } from './helpers'; | |
import * as rmrkEquippable from '../abi/rmrkEquippable'; | |
import { | |
getCollectionDatabaseId, | |
getEquippableGroupDatabaseId, | |
getTokenDatabaseId, | |
} from '../model/helpers'; | |
import { | |
CollectionValidParentEquippableGroupIdSetEventPayload, | |
EquippableGroup, |
This file contains hidden or 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
import { EntityClass, FindOneOptions, Store } from '@subsquid/typeorm-store'; | |
import type { FindOptionsRelations, FindOptionsWhere } from 'typeorm'; | |
import { In } from 'typeorm'; | |
export const splitIntoBatches = <T>(array: T[], maxBatchSize: number): T[][] => { | |
const result: T[][] = []; | |
for (let i = 0; i < array.length; i += maxBatchSize) { | |
const chunk = array.slice(i, i + maxBatchSize); | |
result.push(chunk); | |
} |
This file contains hidden or 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
=========== | |
Taks 1: Mint Bitbob NFT. | |
Action: https://singular.app/bitbob | |
API to verify the task: | |
curl https://singular.app/api/bitget-bob-campaign/user-minted-bitbob-nft \ | |
-X POST \ | |
-H "Content-Type: application/json" \ | |
-d '{"address": "0xfbea1b97406C6945D07F50F588e54144ea8B684f"}' |
This file contains hidden or 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
import { Address } from "viem"; | |
export const BASE_REGISTRY_API_BASE_URL = "https://base.org/api/registry"; | |
export const BASE_REGISTRY_API_ENDPOINTS = { | |
entries: "entries", | |
featured: "featured", | |
}; | |
export const BASE_REGISTRY_API_ENTRIES_QUERY_PARAMS = { | |
//The page number (default 1) |
NewerOlder