Compare commits

..
Author SHA1 Message Date
Bill He 80778b365e Do not init nobleClient if nobleValidatorUrl does not exist 2023-12-04 10:46:17 -08:00
Bill b1ffa2e219 Support CCTP and noble auto deposits on testnet (#180)
* Support CCTP and noble auto deposits on testnet

* slippage

* fix fees

* update isCctp, and comments

* bump packages

* cctp.json

* Bump abacus

* fix error

* fix loading button
2023-12-01 15:18:50 -08:00
+8 -3
View File
@@ -64,7 +64,9 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
setNobleWallet(nobleWallet: LocalWallet) {
this.nobleWallet = nobleWallet;
this.nobleClient?.connect(nobleWallet);
if (this.nobleClient) {
this.nobleClient.connect(nobleWallet);
}
}
async connectNetwork(
@@ -109,8 +111,11 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
);
this.compositeClient = compositeClient;
this.nobleClient = new NobleClient(nobleValidatorUrl);
if (this.nobleWallet) await this.nobleClient.connect(this.nobleWallet);
if (nobleValidatorUrl) {
this.nobleClient = new NobleClient(nobleValidatorUrl);
if (this.nobleWallet) await this.nobleClient.connect(this.nobleWallet);
}
// Dispatch custom event to notify other parts of the app that the network has been connected
const customEvent = new CustomEvent('abacus:connectNetwork', {
detail: parsedParams,