Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/notifications/Telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const NETWORKS: Record<string, string> = {
eth: "Eth Mainnet",
gor: "Eth Goerli",
oeth: "Optimism",
rsk: "Rootstock Mainnet",
trsk: "Rootstock Testnet",
};

export interface TelegramOptions {
Expand Down
10 changes: 2 additions & 8 deletions src/safe/AltAPI.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Address, Hash, Hex } from "viem";

import { BaseApi } from "./BaseApi.js";
import { CHAIN_IDS } from "./constants.js";
import type { ISafeAPI, ListedSafeTx, SafeTx } from "./types.js";

type TxID = `multisig_${Address}_${Hash}`;
Expand Down Expand Up @@ -119,13 +120,6 @@ function parseTxId(id: TxID): ParsedTxId {
return { multisig: multisig as Address, safeTxHash: safeTxHash as Hash };
}

const CHAIN_IDS: Record<string, number> = {
arb1: 42161,
eth: 1,
gor: 5,
oeth: 10,
};

function normalizeLisited(tx: ListedTx): ListedSafeTx {
const { safeTxHash } = parseTxId(tx.id);
return {
Expand Down Expand Up @@ -209,6 +203,6 @@ export class AltAPI extends BaseApi implements ISafeAPI {
}

private get apiURL(): string {
return `https://safe-client.safe.global/v1/chains/${this.chainId}`;
return `https://gateway.safe.rootstock.io/v1/chains/${this.chainId}`;
}
}
8 changes: 1 addition & 7 deletions src/safe/ClassicAPI.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Address, Hash } from "viem";

import { BaseApi } from "./BaseApi.js";
import { APIS } from "./constants.js";
import type { ISafeAPI, ListedSafeTx, SafeTx } from "./types.js";

// export interface SafeMultisigTransactionResponse {
Expand Down Expand Up @@ -90,13 +91,6 @@ function normalizeDetailed(tx: SafeMultisigTransaction): SafeTx<Address> {
};
}

const APIS: Record<string, string> = {
arb1: "https://safe-transaction-arbitrum.safe.global",
eth: "https://safe-transaction-mainnet.safe.global",
gor: "https://safe-transaction-goerli.safe.global",
oeth: "https://safe-transaction-optimism.safe.global",
};

export class ClassicAPI extends BaseApi implements ISafeAPI {
readonly #txs = new Map<Hash, SafeMultisigTransaction>();

Expand Down
18 changes: 18 additions & 0 deletions src/safe/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,21 @@ export const MULTISEND_CALL_ONLY = new Set<Address>([
"0x9641d764fc13c8b624c04430c7356c1c7c8102e2",
"0x40a2accbd92bca938b02010e17a5b8929b49130d",
]);

export const CHAIN_IDS: Record<string, number> = {
arb1: 42161,
eth: 1,
gor: 5,
oeth: 10,
rsk: 30,
trsk: 31,
};

export const APIS: Record<string, string> = {
arb1: "https://safe-transaction-arbitrum.safe.global",
eth: "https://safe-transaction-mainnet.safe.global",
gor: "https://safe-transaction-goerli.safe.global",
oeth: "https://safe-transaction-optimism.safe.global",
rsk: "https://transaction.safe.rootstock.io",
trsk: "https://transaction.safe.rootstock.io",
};