Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
m30m committed Oct 16, 2024
1 parent 6c55815 commit 6f83e3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 9 additions & 6 deletions express_relay/sdk/js/src/examples/simpleSearcherLimo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ class SimpleSearcherLimo {
);
}

async getMintDecimals(mint: PublicKey): Promise<number> {
if (this.mintDecimals[mint.toBase58()]) {
return this.mintDecimals[mint.toBase58()];
async getMintDecimalsCached(mint: PublicKey): Promise<number> {
const mintAddress = mint.toBase58();
if (this.mintDecimals[mintAddress]) {
return this.mintDecimals[mintAddress];
}
const decimals = await getMintDecimals(this.connectionSvm, mint);
this.mintDecimals[mint.toBase58()] = decimals;
this.mintDecimals[mintAddress] = decimals;
return decimals;
}

Expand All @@ -75,8 +76,10 @@ class SimpleSearcherLimo {
this.connectionSvm,
order.state.globalConfig
);
const inputMintDecimals = await this.getMintDecimals(order.state.inputMint);
const outputMintDecimals = await this.getMintDecimals(
const inputMintDecimals = await this.getMintDecimalsCached(
order.state.inputMint
);
const outputMintDecimals = await this.getMintDecimalsCached(
order.state.outputMint
);
const inputAmountDecimals = new Decimal(
Expand Down
3 changes: 1 addition & 2 deletions express_relay/sdk/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ $ poetry run python3 -m express_relay.searcher.examples.simple_searcher_svm \
--chain-id development-solana \
--private-key-json-file <PATH_TO_JSON_FILE> \
--endpoint-svm https://api.mainnet-beta.solana.com \
--global-config TeStcUQMmECYEtdeXo9cXpktQWaGe4bhJ7zxAUMzB2X \
--bid 10000000
--bid 10000000 # Bid amount in lamports
```

0 comments on commit 6f83e3e

Please sign in to comment.