Skip to content
Open
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
1 change: 1 addition & 0 deletions packages/near-fast-auth-signer/config.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ window.env = {
SENTRY_DSN: "${SENTRY_DSN}",
SENTRY_DSN_TESTNET: "${SENTRY_DSN_TESTNET}",
GIT_COMMIT_HASH: "${GIT_COMMIT_HASH}",
FAST_AUTH_RELAYER_URL: "${FAST_AUTH_RELAYER_URL}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this is the best approach.

As you can see, on the same config file, we already define RELAYER_URL_TESTNET and RELAYER_URL. With this PR we are introducing a new URL with the same purpose to maintain.

I think we should:

  • Wait https://near-relayer-mainnet.api.pagoda.co support /send_meta_tx_async
  • Refactor the code to accept a base relayer url (eg: www.relayer.com) instead of relayer with path url (eg: www.relayer.com/relay)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think Danny? I know it will be a bit of work, but I believe it's the path we should go

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree. Initially I was also had a doubt about whats difference between RELAYER_URL VS FAST_AUTH_RELAYER_URL and why do we have both.

Maybe we revisit this PR when https://near-relayer-mainnet.api.pagoda.co support /send_meta_tx_async

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, let's wait for it and then we work on the refactor :)

};
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ const EVMChains: EVMChainMap<boolean> = {
};
export const isTokenSymbolEVMChain = (chain: Chain): boolean => !!EVMChains[chain];

const FAST_AUTH_RELAYER_URL = 'http://34.136.82.88:3030';

const CHAIN_CONFIG: ChainMap = {
ETH: {
providerUrl: 'https://sepolia.infura.io/v3/6df51ccaa17f4e078325b5050da5a2dd',
Expand Down Expand Up @@ -284,7 +282,7 @@ export const multichainSignAndSend = async ({
maxPriorityFeePerGas: (feeProperties as EVMFeeProperties)?.maxPriorityFeePerGas,
},
nearAuthentication: { networkId, keypair, accountId },
fastAuthRelayerUrl: FAST_AUTH_RELAYER_URL,
fastAuthRelayerUrl: environment.FAST_AUTH_RELAYER_URL,
chainConfig
});
}
Expand Down Expand Up @@ -314,7 +312,7 @@ export const multichainSignAndSend = async ({
outputs: (feeProperties as BTCFeeProperties)?.outputs,
},
nearAuthentication: { networkId, keypair, accountId },
fastAuthRelayerUrl: FAST_AUTH_RELAYER_URL,
fastAuthRelayerUrl: environment.FAST_AUTH_RELAYER_URL,
chainConfig
});
}
Expand Down
1 change: 1 addition & 0 deletions packages/near-fast-auth-signer/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const environment = {
SENTRY_DSN: windowEnv.SENTRY_DSN || process.env.SENTRY_DSN,
SENTRY_DSN_TESTNET: windowEnv.SENTRY_DSN_TESTNET || process.env.SENTRY_DSN_TESTNET,
GIT_COMMIT_HASH: windowEnv.GIT_COMMIT_HASH || process.env.GIT_COMMIT_HASH,
FAST_AUTH_RELAYER_URL: windowEnv.FAST_AUTH_RELAYER_URL || process.env.FAST_AUTH_RELAYER_URL,
};

export default environment;
1 change: 1 addition & 0 deletions packages/near-fast-auth-signer/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = (env, argv) => {
SENTRY_DSN: 'https://1049553ebca8337848160ca53a49ff2a@o398573.ingest.sentry.io/4506148066164736',
SENTRY_DSN_TESTNET: 'https://ce94b1ec626e971719c20fa7979158f3@o398573.ingest.sentry.io/4506702275411968',
GIT_COMMIT_HASH: commitHash,
FAST_AUTH_RELAYER_URL: 'http://34.136.82.88:3030',
}),
...(process.env.SENTRY_AUTH_TOKEN
? [sentryWebpackPlugin({
Expand Down