@axelar-network/axelarjs-sdk 0.18.0-alpha.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/constants/index.d.ts.map +1 -1
- package/dist/src/libs/AxelarAssetTransfer.d.ts +2 -2
- package/dist/src/libs/AxelarAssetTransfer.d.ts.map +1 -1
- package/dist/src/libs/AxelarSigningClient/types/AxelarnetTxTypes.d.ts.map +1 -1
- package/dist/src/libs/AxelarSigningClient/types/EvmTxTypes.d.ts.map +1 -1
- package/dist/src/libs/AxelarSigningClient/types/MultisigTxTypes.d.ts.map +1 -1
- package/dist/src/libs/AxelarSigningClient/types/NexusTxTypes.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.js +1 -1
- package/dist/src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.js.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.d.ts +8 -5
- package/dist/src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.js +128 -40
- package/dist/src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.js.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.d.ts +10 -9
- package/dist/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.js +122 -8
- package/dist/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.js.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/constants/error.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/helpers/getCommandId.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/helpers/mappers.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/helpers/rpcHelper.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/helpers/xrplHelper.d.ts.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/helpers/xrplHelper.js +4 -1
- package/dist/src/libs/TransactionRecoveryApi/helpers/xrplHelper.js.map +1 -1
- package/dist/src/libs/TransactionRecoveryApi/interface/index.d.ts +1 -0
- package/dist/src/libs/TransactionRecoveryApi/interface/index.d.ts.map +1 -1
- package/dist/src/libs/types/index.d.ts +3 -1
- package/dist/src/libs/types/index.d.ts.map +1 -1
- package/dist/src/libs/types/index.js.map +1 -1
- package/dist/src/utils/test/validateDestinationAddress.spec.js +11 -9
- package/dist/src/utils/test/validateDestinationAddress.spec.js.map +1 -1
- package/package.json +17 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAqED,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAqED,eAAO,MAAM,UAAU,GAAI,aAAa,MAAM,KAAG,kBAKhD,CAAC;AAEF,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAG3B,eAAO,MAAM,uBAAuB,+gsBAC0+rB,CAAC"}
|
|
@@ -58,7 +58,7 @@ export declare class AxelarAssetTransfer {
|
|
|
58
58
|
constructor(config: AxelarAssetTransferConfig);
|
|
59
59
|
getDepositAddressForNativeWrap(fromChain: string, toChain: string, destinationAddress: string, refundAddress?: string): Promise<string>;
|
|
60
60
|
getDepositAddressForNativeUnwrap(fromChain: string, toChain: string, destinationAddress: string, fromChainModule?: "evm" | "axelarnet", refundAddress?: string): Promise<string>;
|
|
61
|
-
getOfflineDepositAddressForERC20Transfer(fromChain: string, toChain: string, destinationAddress: string, fromChainModule:
|
|
61
|
+
getOfflineDepositAddressForERC20Transfer(fromChain: string, toChain: string, destinationAddress: string, fromChainModule: "evm" | "axelarnet" | undefined, tokenSymbol: string, refundAddress?: string): Promise<string>;
|
|
62
62
|
getDepositAddressFromRemote(type: "erc20" | "wrap" | "unwrap", fromChain: string | undefined, toChain: string | undefined, destinationAddress: string, refundAddress: string, hexSalt: string, tokenSymbol?: string | undefined): Promise<{
|
|
63
63
|
address: string;
|
|
64
64
|
}>;
|
|
@@ -75,7 +75,7 @@ export declare class AxelarAssetTransfer {
|
|
|
75
75
|
private getChains;
|
|
76
76
|
sendTokenFromCosmosChain(requestParams: SendTokenParams): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
77
77
|
populateUnsignedTx(): {
|
|
78
|
-
sendToken: (params: SendTokenParams) => Promise
|
|
78
|
+
sendToken: (params: SendTokenParams) => Promise</*elided*/ any>;
|
|
79
79
|
getTx(): EncodeObject[];
|
|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CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,wBAAwB,GAClC,OAAO,CAAC,MAAM,CAAC;IAgGZ,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAWpE,aAAa,CACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,kBAAkB,EAAE,MAAM,EAC1B,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC;IA0BZ,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,EACxB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC;IAYlB,gBAAgB;IAIhB,qBAAqB,CAAC,MAAM,EAAE,MAAM;IAI9B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAoB/C,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAQpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxelarnetTxTypes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/AxelarSigningClient/types/AxelarnetTxTypes.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAejD,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"AxelarnetTxTypes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/AxelarSigningClient/types/AxelarnetTxTypes.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAejD,eAAO,MAAM,wBAAwB,GAAI,UAAU,QAAQ,SAc1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmTxTypes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/AxelarSigningClient/types/EvmTxTypes.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAoBjD,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"EvmTxTypes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/AxelarSigningClient/types/EvmTxTypes.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAoBjD,eAAO,MAAM,kBAAkB,GAAI,UAAU,QAAQ,SAmBpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultisigTxTypes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/AxelarSigningClient/types/MultisigTxTypes.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAWjD,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"MultisigTxTypes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/AxelarSigningClient/types/MultisigTxTypes.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAWjD,eAAO,MAAM,uBAAuB,GAAI,UAAU,QAAQ,SAOzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NexusTxTypes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/AxelarSigningClient/types/NexusTxTypes.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAWjD,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"NexusTxTypes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/AxelarSigningClient/types/NexusTxTypes.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAWjD,eAAO,MAAM,oBAAoB,GAAI,UAAU,QAAQ,SAUtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxelarDepositRecoveryAPI.d.ts","sourceRoot":"","sources":["../../../../src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAUpD,qBAAa,wBAAyB,SAAQ,iBAAiB;gBAC1C,MAAM,EAAE,uBAAuB;IAIrC,cAAc,CAAC,MAAM,EAAE,qBAAqB;
|
|
1
|
+
{"version":3,"file":"AxelarDepositRecoveryAPI.d.ts","sourceRoot":"","sources":["../../../../src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAUpD,qBAAa,wBAAyB,SAAQ,iBAAiB;gBAC1C,MAAM,EAAE,uBAAuB;IAIrC,cAAc,CAAC,MAAM,EAAE,qBAAqB;IA0B5C,iBAAiB;CAO/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;;GAaG"}
|
|
@@ -27,7 +27,7 @@ class AxelarDepositRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
27
27
|
})).find((chainInfo) => chainInfo.id.toLowerCase() === params.from.toLowerCase());
|
|
28
28
|
if (!chain)
|
|
29
29
|
throw new Error("cannot find chain" + params.from);
|
|
30
|
-
const txBytes = yield this.execRecoveryUrlFetch("/confirm_deposit_tx", Object.assign(Object.assign({}, params), { sourceChain: chain.chainIdentifier[this.environment], module: chain.module }));
|
|
30
|
+
const txBytes = yield this.execRecoveryUrlFetch("/confirm_deposit_tx", Object.assign(Object.assign({}, params), { senderAddress: params.senderAddress || this.config.senderAddress, sourceChain: chain.chainIdentifier[this.environment], module: chain.module }));
|
|
31
31
|
const tx = yield (0, cosmos_1.broadcastCosmosTxBytes)(txBytes, this.axelarRpcUrl);
|
|
32
32
|
if (chain.module === "evm") {
|
|
33
33
|
return (0, axelarHelper_1.parseConfirmDepositEvmResponse)(tx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxelarDepositRecoveryAPI.js","sourceRoot":"","sources":["../../../../src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2DAAwD;AAExD,oDAAiE;AACjE,yCAA0C;AAE1C,yDAGgC;AAChC,uCAAqD;AAErD,MAAa,wBAAyB,SAAQ,qCAAiB;IAC7D,YAAmB,MAA+B;QAChD,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEY,cAAc,CAAC,MAA6B;;YACvD,MAAM,IAAA,8BAAsB,EAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YAE9D,MAAM,KAAK,GAAc,CACvB,MAAM,IAAA,mBAAU,EAAC;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;aAC9B,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAc,CAAC;YAC7F,IAAI,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAE/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,qBAAqB,kCAChE,MAAM,KACT,WAAW,EAAE,KAAK,CAAC,eA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EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAc,CAAC;YAC7F,IAAI,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAE/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,qBAAqB,kCAChE,MAAM,KACT,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,EAChE,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,EACpD,MAAM,EAAE,KAAK,CAAC,MAAM,IACpB,CAAC;YAEH,MAAM,EAAE,GAAG,MAAM,IAAA,+BAAsB,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YAEpE,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;gBAC3B,OAAO,IAAA,6CAA8B,EAAC,EAAE,CAAC,CAAC;YAC5C,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAA,gDAAiC,EAAC,EAAE,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;KAAA;IAEY,iBAAiB;;YAC5B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,sBAAsB,EAAE;gBACtE,MAAM,EAAE,WAAW;aACpB,CAAC,CAAC;YAEH,OAAO,IAAA,+BAAsB,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5D,CAAC;KAAA;CACF;AAtCD,4DAsCC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;;GAaG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxelarRecoveryAPIConfig, EvmWalletDetails, AddGasOptions, TxResult, QueryGasFeeOptions, ApproveGatewayError, GMPRecoveryResponse, AxelarTxResponse, Environment } from "../types";
|
|
1
|
+
import { AxelarRecoveryAPIConfig, CosmosBasedWalletDetails, EvmWalletDetails, AddGasOptions, TxResult, QueryGasFeeOptions, ApproveGatewayError, GMPRecoveryResponse, AxelarTxResponse, Environment } from "../types";
|
|
2
2
|
import { EvmChain } from "../../constants/EvmChain";
|
|
3
3
|
import { AxelarRecoveryApi } from "./AxelarRecoveryApi";
|
|
4
4
|
import { AxelarQueryAPI } from "../AxelarQueryAPI";
|
|
@@ -114,6 +114,9 @@ export declare class AxelarGMPRecoveryAPI extends AxelarRecoveryApi {
|
|
|
114
114
|
isEVMEventFailed(eventResponse: EventResponse | undefined): boolean | undefined;
|
|
115
115
|
isEVMEventConfirmed(eventResponse: EventResponse): boolean | undefined;
|
|
116
116
|
isEVMEventCompleted(eventResponse: EventResponse): boolean | undefined;
|
|
117
|
+
private confirmGatewayTxWithWallet;
|
|
118
|
+
private routeMessageRequestWithWallet;
|
|
119
|
+
private signCommandsWithWallet;
|
|
117
120
|
getEvmEvent(srcChainId: string, destChainId: string, srcTxHash: string, srcTxEventIndex: number | undefined, evmWalletDetails?: EvmWalletDetails): Promise<{
|
|
118
121
|
commandId: string;
|
|
119
122
|
eventResponse: EventResponse;
|
|
@@ -121,10 +124,10 @@ export declare class AxelarGMPRecoveryAPI extends AxelarRecoveryApi {
|
|
|
121
124
|
errorMessage: string;
|
|
122
125
|
infoLog: string;
|
|
123
126
|
}>;
|
|
124
|
-
findEventAndConfirmIfNeeded(srcChain: string, destChain: string, txHash: string, txEventIndex: number | undefined, evmWalletDetails: EvmWalletDetails): Promise<ConfirmTxSDKResponse>;
|
|
125
|
-
findBatchAndSignIfNeeded(commandId: string, destChainId: string): Promise<SignTxSDKResponse>;
|
|
126
|
-
findBatchAndApproveGateway(commandId: string, destChainId: string, wallet: EvmWalletDetails): Promise<BroadcastTxSDKResponse>;
|
|
127
|
-
manualRelayToDestChain(txHash: string, txLogIndex?: number | undefined, txEventIndex?: number | undefined, evmWalletDetails?: EvmWalletDetails, escapeAfterConfirm?: boolean, messageId?: string): Promise<GMPRecoveryResponse>;
|
|
127
|
+
findEventAndConfirmIfNeeded(srcChain: string, destChain: string, txHash: string, txEventIndex: number | undefined, evmWalletDetails: EvmWalletDetails, cosmosWalletDetails?: CosmosBasedWalletDetails, useSelfSigning?: boolean): Promise<ConfirmTxSDKResponse>;
|
|
128
|
+
findBatchAndSignIfNeeded(commandId: string, destChainId: string, cosmosWalletDetails?: CosmosBasedWalletDetails, useSelfSigning?: boolean): Promise<SignTxSDKResponse>;
|
|
129
|
+
findBatchAndApproveGateway(commandId: string, destChainId: string, wallet: EvmWalletDetails, useSelfSigning?: boolean): Promise<BroadcastTxSDKResponse>;
|
|
130
|
+
manualRelayToDestChain(txHash: string, txLogIndex?: number | undefined, txEventIndex?: number | undefined, evmWalletDetails?: EvmWalletDetails, escapeAfterConfirm?: boolean, messageId?: string, cosmosWalletDetails?: CosmosBasedWalletDetails, useSelfSigning?: boolean): Promise<GMPRecoveryResponse>;
|
|
128
131
|
getRouteDir(srcChain: ChainInfo, destChain: ChainInfo): RouteDir;
|
|
129
132
|
private recoverCosmosToCosmosTx;
|
|
130
133
|
private recoverEvmToCosmosTx;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxelarGMPRecoveryAPI.d.ts","sourceRoot":"","sources":["../../../../src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,
|
|
1
|
+
{"version":3,"file":"AxelarGMPRecoveryAPI.d.ts","sourceRoot":"","sources":["../../../../src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EAExB,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAA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AAC,MAAM,CAAC;YA8CjE,aAAa;IAad,mBAAmB,CAAC,EAC/B,QAAQ,EACR,uBAAuB,EACvB,WAAW,EACX,GAAG,MAAM,EACV,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;IAuGzC;;;;;;;;OAQG;IACU,YAAY,CACvB,KAAK,EAAE,QAAQ,GAAG,MAAM,EACxB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,QAAQ,CAAC;IA6EpB;;;;;;;;;OASG;IACU,MAAM,CACjB,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,QAAQ,CAAC;IAyEpB;;;;;;OAMG;IACU,OAAO,CAClB,SAAS,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE,MAAM,EACtB,gBAAgB,CAAC,EAAE,gBAAgB,GAClC,OAAO,CAAC,QAAQ,CAAC;YA6DN,cAAc;YA4Bd,+BAA+B;IA6B7C,OAAO,CAAC,SAAS;IAcX,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAQpD"}
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -157,6 +167,36 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
157
167
|
return undefined;
|
|
158
168
|
return ((_a = eventResponse.event) === null || _a === void 0 ? void 0 : _a.status) === types_2.Event_Status.STATUS_COMPLETED;
|
|
159
169
|
}
|
|
170
|
+
confirmGatewayTxWithWallet(txHash_1, chain_2, cosmosWalletDetails_1) {
|
|
171
|
+
return __awaiter(this, arguments, void 0, function* (txHash, chain, cosmosWalletDetails, useSelfSigning = false) {
|
|
172
|
+
if (cosmosWalletDetails === null || cosmosWalletDetails === void 0 ? void 0 : cosmosWalletDetails.offlineSigner) {
|
|
173
|
+
return this.confirmGatewayTx(txHash, chain, cosmosWalletDetails, useSelfSigning);
|
|
174
|
+
}
|
|
175
|
+
return useSelfSigning
|
|
176
|
+
? this.confirmGatewayTx(txHash, chain, undefined, true)
|
|
177
|
+
: this.confirmGatewayTx(txHash, chain);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
routeMessageRequestWithWallet(txHash_1, payload_1, logIndex_1, cosmosWalletDetails_1) {
|
|
181
|
+
return __awaiter(this, arguments, void 0, function* (txHash, payload, logIndex, cosmosWalletDetails, useSelfSigning = false) {
|
|
182
|
+
if (cosmosWalletDetails === null || cosmosWalletDetails === void 0 ? void 0 : cosmosWalletDetails.offlineSigner) {
|
|
183
|
+
return this.routeMessageRequest(txHash, payload, logIndex, cosmosWalletDetails, useSelfSigning);
|
|
184
|
+
}
|
|
185
|
+
return useSelfSigning
|
|
186
|
+
? this.routeMessageRequest(txHash, payload, logIndex, undefined, true)
|
|
187
|
+
: this.routeMessageRequest(txHash, payload, logIndex);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
signCommandsWithWallet(destChainId_1, cosmosWalletDetails_1) {
|
|
191
|
+
return __awaiter(this, arguments, void 0, function* (destChainId, cosmosWalletDetails, useSelfSigning = false) {
|
|
192
|
+
if (cosmosWalletDetails === null || cosmosWalletDetails === void 0 ? void 0 : cosmosWalletDetails.offlineSigner) {
|
|
193
|
+
return this.signCommands(destChainId, cosmosWalletDetails, useSelfSigning);
|
|
194
|
+
}
|
|
195
|
+
return useSelfSigning
|
|
196
|
+
? this.signCommands(destChainId, undefined, true)
|
|
197
|
+
: this.signCommands(destChainId);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
160
200
|
getEvmEvent(srcChainId, destChainId, srcTxHash, srcTxEventIndex, evmWalletDetails) {
|
|
161
201
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
202
|
var _a;
|
|
@@ -197,8 +237,8 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
197
237
|
};
|
|
198
238
|
});
|
|
199
239
|
}
|
|
200
|
-
findEventAndConfirmIfNeeded(
|
|
201
|
-
return __awaiter(this,
|
|
240
|
+
findEventAndConfirmIfNeeded(srcChain_1, destChain_1, txHash_1, txEventIndex_1, evmWalletDetails_1, cosmosWalletDetails_1) {
|
|
241
|
+
return __awaiter(this, arguments, void 0, function* (srcChain, destChain, txHash, txEventIndex, evmWalletDetails, cosmosWalletDetails, useSelfSigning = false) {
|
|
202
242
|
if (this.debugMode)
|
|
203
243
|
console.debug(`confirmation: checking whether ${txHash} needs to be confirmed on Axelar`);
|
|
204
244
|
const evmEvent = yield this.getEvmEvent(srcChain, destChain, txHash, txEventIndex);
|
|
@@ -228,7 +268,7 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
228
268
|
errorMessage: `findEventAndConfirmIfNeeded(): ${txHash} is not confirmed on ${srcChain}. The minimum confirmation height is ${minConfirmLevel}`,
|
|
229
269
|
};
|
|
230
270
|
}
|
|
231
|
-
const confirmTx = yield this.
|
|
271
|
+
const confirmTx = yield this.confirmGatewayTxWithWallet(txHash, srcChain, cosmosWalletDetails, useSelfSigning).catch(() => undefined);
|
|
232
272
|
if (!confirmTx) {
|
|
233
273
|
return {
|
|
234
274
|
success: false,
|
|
@@ -265,8 +305,8 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
265
305
|
}
|
|
266
306
|
});
|
|
267
307
|
}
|
|
268
|
-
findBatchAndSignIfNeeded(
|
|
269
|
-
return __awaiter(this,
|
|
308
|
+
findBatchAndSignIfNeeded(commandId_1, destChainId_1, cosmosWalletDetails_1) {
|
|
309
|
+
return __awaiter(this, arguments, void 0, function* (commandId, destChainId, cosmosWalletDetails, useSelfSigning = false) {
|
|
270
310
|
let signTxLog = "";
|
|
271
311
|
try {
|
|
272
312
|
const batchData = yield (0, utils_2.retry)(() => this.fetchBatchData(destChainId, commandId), 10, 3000);
|
|
@@ -280,7 +320,7 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
280
320
|
};
|
|
281
321
|
}
|
|
282
322
|
else {
|
|
283
|
-
const signCommandTx = yield this.
|
|
323
|
+
const signCommandTx = yield this.signCommandsWithWallet(destChainId, cosmosWalletDetails, useSelfSigning);
|
|
284
324
|
signTxLog = `signing: signed batch for commandId (${commandId}) in tx: ${signCommandTx.transactionHash}`;
|
|
285
325
|
if (this.debugMode)
|
|
286
326
|
console.debug(signTxLog);
|
|
@@ -300,8 +340,8 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
300
340
|
}
|
|
301
341
|
});
|
|
302
342
|
}
|
|
303
|
-
findBatchAndApproveGateway(
|
|
304
|
-
return __awaiter(this,
|
|
343
|
+
findBatchAndApproveGateway(commandId_1, destChainId_1, wallet_1) {
|
|
344
|
+
return __awaiter(this, arguments, void 0, function* (commandId, destChainId, wallet, useSelfSigning = false) {
|
|
305
345
|
if (this.debugMode)
|
|
306
346
|
console.debug(`broadcasting: checking for command ID: ${commandId} to broadcast`);
|
|
307
347
|
return (0, utils_2.retry)(() => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -317,12 +357,44 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
317
357
|
return Promise.reject(`findBatchAndApproveGateway(): batch ID ${batchData.batch_id} signing in process`);
|
|
318
358
|
}
|
|
319
359
|
else if (batchData.status === "BATCHED_COMMANDS_STATUS_SIGNED") {
|
|
320
|
-
|
|
360
|
+
if (!useSelfSigning) {
|
|
361
|
+
const approveTx = yield this.sendApproveTx(destChainId, batchData.execute_data, wallet);
|
|
362
|
+
return {
|
|
363
|
+
success: true,
|
|
364
|
+
approveTx,
|
|
365
|
+
infoLogs: [
|
|
366
|
+
`broadcasting: batch ID ${batchData.batch_id} broadcasted to ${destChainId}`,
|
|
367
|
+
],
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
let approveTx;
|
|
371
|
+
let usedRelayerFallback = false;
|
|
372
|
+
try {
|
|
373
|
+
approveTx = yield this.broadcastEvmTx(destChainId, batchData.execute_data, wallet);
|
|
374
|
+
}
|
|
375
|
+
catch (error) {
|
|
376
|
+
usedRelayerFallback = true;
|
|
377
|
+
console.error("[recovery self-sign failed]", {
|
|
378
|
+
action_type: "send_evm_tx",
|
|
379
|
+
use_self_signing: true,
|
|
380
|
+
command_id: commandId,
|
|
381
|
+
destination_chain: destChainId,
|
|
382
|
+
batch_id: batchData.batch_id,
|
|
383
|
+
error,
|
|
384
|
+
});
|
|
385
|
+
return Promise.reject("findBatchAndApproveGateway(): self-signing failed");
|
|
386
|
+
}
|
|
387
|
+
const normalizedApproveTx = approveTx &&
|
|
388
|
+
typeof approveTx === "object" &&
|
|
389
|
+
"hash" in approveTx &&
|
|
390
|
+
!("transactionHash" in approveTx)
|
|
391
|
+
? Object.assign(Object.assign({}, approveTx), { transactionHash: approveTx.hash }) : approveTx;
|
|
321
392
|
return {
|
|
322
393
|
success: true,
|
|
323
|
-
approveTx,
|
|
394
|
+
approveTx: normalizedApproveTx,
|
|
324
395
|
infoLogs: [
|
|
325
396
|
`broadcasting: batch ID ${batchData.batch_id} broadcasted to ${destChainId}`,
|
|
397
|
+
...(usedRelayerFallback ? ["use_self_signing=true action=send_evm_tx"] : []),
|
|
326
398
|
],
|
|
327
399
|
};
|
|
328
400
|
}
|
|
@@ -341,7 +413,7 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
341
413
|
});
|
|
342
414
|
}
|
|
343
415
|
manualRelayToDestChain(txHash_1, txLogIndex_1, txEventIndex_1, evmWalletDetails_1) {
|
|
344
|
-
return __awaiter(this, arguments, void 0, function* (txHash, txLogIndex, txEventIndex, evmWalletDetails, escapeAfterConfirm = true, messageId) {
|
|
416
|
+
return __awaiter(this, arguments, void 0, function* (txHash, txLogIndex, txEventIndex, evmWalletDetails, escapeAfterConfirm = true, messageId, cosmosWalletDetails, useSelfSigning = false) {
|
|
345
417
|
const { callTx, status } = yield this.queryTransactionStatus(txHash, txLogIndex);
|
|
346
418
|
/**first check if transaction is already executed */
|
|
347
419
|
if (exports.GMPErrorMap[status])
|
|
@@ -357,16 +429,16 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
357
429
|
const routeDir = this.getRouteDir(srcChainInfo, destChainInfo);
|
|
358
430
|
const _evmWalletDetails = evmWalletDetails || { useWindowEthereum: true };
|
|
359
431
|
if (routeDir === RouteDir.COSMOS_TO_EVM) {
|
|
360
|
-
return this.recoverCosmosToEvmTx(txHash, _evmWalletDetails, messageId);
|
|
432
|
+
return this.recoverCosmosToEvmTx(txHash, _evmWalletDetails, messageId, cosmosWalletDetails, useSelfSigning);
|
|
361
433
|
}
|
|
362
434
|
else if (routeDir === RouteDir.EVM_TO_COSMOS) {
|
|
363
|
-
return this.recoverEvmToCosmosTx(srcChain, txHash, eventIndex, _evmWalletDetails);
|
|
435
|
+
return this.recoverEvmToCosmosTx(srcChain, txHash, eventIndex, _evmWalletDetails, cosmosWalletDetails, useSelfSigning);
|
|
364
436
|
}
|
|
365
437
|
else if (routeDir === RouteDir.COSMOS_TO_COSMOS) {
|
|
366
|
-
return this.recoverCosmosToCosmosTx(txHash);
|
|
438
|
+
return this.recoverCosmosToCosmosTx(txHash, cosmosWalletDetails, useSelfSigning);
|
|
367
439
|
}
|
|
368
440
|
else {
|
|
369
|
-
return this.recoverEvmToEvmTx(srcChain, destChain, txHash, eventIndex, _evmWalletDetails, escapeAfterConfirm);
|
|
441
|
+
return this.recoverEvmToEvmTx(srcChain, destChain, txHash, eventIndex, _evmWalletDetails, escapeAfterConfirm, cosmosWalletDetails, useSelfSigning);
|
|
370
442
|
}
|
|
371
443
|
});
|
|
372
444
|
}
|
|
@@ -384,14 +456,14 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
384
456
|
return RouteDir.EVM_TO_EVM;
|
|
385
457
|
}
|
|
386
458
|
}
|
|
387
|
-
recoverCosmosToCosmosTx(
|
|
388
|
-
return __awaiter(this,
|
|
459
|
+
recoverCosmosToCosmosTx(txHash_1, cosmosWalletDetails_1) {
|
|
460
|
+
return __awaiter(this, arguments, void 0, function* (txHash, cosmosWalletDetails, useSelfSigning = false) {
|
|
389
461
|
const gmpTx = yield this.fetchGMPTransaction(txHash);
|
|
390
462
|
// Fetch all necessary data to send the route message tx
|
|
391
463
|
const payload = gmpTx.call.returnValues.payload;
|
|
392
464
|
const messageId = gmpTx.call.id;
|
|
393
465
|
// Send the route message tx
|
|
394
|
-
const routeMessageTx = yield this.
|
|
466
|
+
const routeMessageTx = yield this.routeMessageRequestWithWallet(messageId, payload, -1, cosmosWalletDetails, useSelfSigning).catch(() => undefined);
|
|
395
467
|
// If the `success` flag is false, return the error response
|
|
396
468
|
if (!routeMessageTx) {
|
|
397
469
|
return {
|
|
@@ -407,8 +479,8 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
407
479
|
};
|
|
408
480
|
});
|
|
409
481
|
}
|
|
410
|
-
recoverEvmToCosmosTx(
|
|
411
|
-
return __awaiter(this,
|
|
482
|
+
recoverEvmToCosmosTx(srcChain_1, txHash_1, txEventIndex_1, evmWalletDetails_1, cosmosWalletDetails_1) {
|
|
483
|
+
return __awaiter(this, arguments, void 0, function* (srcChain, txHash, txEventIndex, evmWalletDetails, cosmosWalletDetails, useSelfSigning = false) {
|
|
412
484
|
// Check if the tx is confirmed on the source chain
|
|
413
485
|
const isConfirmed = yield this.doesTxMeetConfirmHt(srcChain, txHash, evmWalletDetails === null || evmWalletDetails === void 0 ? void 0 : evmWalletDetails.provider);
|
|
414
486
|
if (!isConfirmed) {
|
|
@@ -419,7 +491,7 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
419
491
|
};
|
|
420
492
|
}
|
|
421
493
|
// ConfirmGatewayTx and check if it is successfully executed
|
|
422
|
-
const confirmTx = yield this.
|
|
494
|
+
const confirmTx = yield this.confirmGatewayTxWithWallet(txHash, srcChain, cosmosWalletDetails, useSelfSigning).catch(() => undefined);
|
|
423
495
|
if (!confirmTx) {
|
|
424
496
|
return {
|
|
425
497
|
success: false,
|
|
@@ -430,7 +502,7 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
430
502
|
const payload = yield this.fetchGMPTransaction(txHash).then((data) => data.call.returnValues.payload);
|
|
431
503
|
const eventIndex = txEventIndex !== null && txEventIndex !== void 0 ? txEventIndex : (yield this.getEventIndex(srcChain, txHash));
|
|
432
504
|
// Send the route message tx
|
|
433
|
-
const routeMessageTx = yield this.
|
|
505
|
+
const routeMessageTx = yield this.routeMessageRequestWithWallet(txHash, payload, eventIndex, cosmosWalletDetails, useSelfSigning).catch(() => undefined);
|
|
434
506
|
// If the `success` flag is false, return the error response
|
|
435
507
|
if (!routeMessageTx) {
|
|
436
508
|
return {
|
|
@@ -450,14 +522,14 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
450
522
|
};
|
|
451
523
|
});
|
|
452
524
|
}
|
|
453
|
-
recoverCosmosToEvmTx(
|
|
454
|
-
return __awaiter(this,
|
|
525
|
+
recoverCosmosToEvmTx(txHash_1, evmWalletDetails_1, msgIdParam_1, cosmosWalletDetails_1) {
|
|
526
|
+
return __awaiter(this, arguments, void 0, function* (txHash, evmWalletDetails, msgIdParam, cosmosWalletDetails, useSelfSigning = false) {
|
|
455
527
|
const txDetails = yield this.fetchGMPTransaction(txHash);
|
|
456
528
|
const { messageId: msgIdFromAxelarscan, payload, destinationChain, } = txDetails.call.returnValues;
|
|
457
529
|
const { command_id: commandId } = txDetails;
|
|
458
530
|
const messageId = msgIdParam !== null && msgIdParam !== void 0 ? msgIdParam : msgIdFromAxelarscan;
|
|
459
531
|
// Send RouteMessageTx
|
|
460
|
-
const routeMessageTx = yield this.
|
|
532
|
+
const routeMessageTx = yield this.routeMessageRequestWithWallet(messageId, payload, -1, cosmosWalletDetails, useSelfSigning).catch(() => undefined);
|
|
461
533
|
if (!routeMessageTx) {
|
|
462
534
|
return {
|
|
463
535
|
success: false,
|
|
@@ -465,7 +537,11 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
465
537
|
};
|
|
466
538
|
}
|
|
467
539
|
// Dispatch a SignCommand transaction and an Approve transaction to the Gateway contract.
|
|
468
|
-
const response =
|
|
540
|
+
const response = (cosmosWalletDetails === null || cosmosWalletDetails === void 0 ? void 0 : cosmosWalletDetails.offlineSigner)
|
|
541
|
+
? yield this.signAndApproveGateway(commandId, destinationChain, evmWalletDetails, cosmosWalletDetails, useSelfSigning)
|
|
542
|
+
: useSelfSigning
|
|
543
|
+
? yield this.signAndApproveGateway(commandId, destinationChain, evmWalletDetails, undefined, true)
|
|
544
|
+
: yield this.signAndApproveGateway(commandId, destinationChain, evmWalletDetails);
|
|
469
545
|
// If the response.success is false, we will return the error response
|
|
470
546
|
if (!response.success) {
|
|
471
547
|
return {
|
|
@@ -484,10 +560,14 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
484
560
|
});
|
|
485
561
|
}
|
|
486
562
|
recoverEvmToEvmTx(srcChain_1, destChain_1, txHash_1, txEventIndex_1, evmWalletDetails_1) {
|
|
487
|
-
return __awaiter(this, arguments, void 0, function* (srcChain, destChain, txHash, txEventIndex, evmWalletDetails, escapeAfterConfirm = true) {
|
|
563
|
+
return __awaiter(this, arguments, void 0, function* (srcChain, destChain, txHash, txEventIndex, evmWalletDetails, escapeAfterConfirm = true, cosmosWalletDetails, useSelfSigning = false) {
|
|
488
564
|
try {
|
|
489
565
|
// ConfirmGatewayTx and check if it is successfully executed
|
|
490
|
-
const confirmTxRequest =
|
|
566
|
+
const confirmTxRequest = (cosmosWalletDetails === null || cosmosWalletDetails === void 0 ? void 0 : cosmosWalletDetails.offlineSigner)
|
|
567
|
+
? yield this.findEventAndConfirmIfNeeded(srcChain, destChain, txHash, txEventIndex, evmWalletDetails, cosmosWalletDetails, useSelfSigning)
|
|
568
|
+
: useSelfSigning
|
|
569
|
+
? yield this.findEventAndConfirmIfNeeded(srcChain, destChain, txHash, txEventIndex, evmWalletDetails, undefined, true)
|
|
570
|
+
: yield this.findEventAndConfirmIfNeeded(srcChain, destChain, txHash, txEventIndex, evmWalletDetails);
|
|
491
571
|
// If the `success` flag is false, we will return the error response
|
|
492
572
|
if (!(confirmTxRequest === null || confirmTxRequest === void 0 ? void 0 : confirmTxRequest.success)) {
|
|
493
573
|
return {
|
|
@@ -505,7 +585,11 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
505
585
|
};
|
|
506
586
|
}
|
|
507
587
|
// Find the batch and sign it
|
|
508
|
-
const response =
|
|
588
|
+
const response = (cosmosWalletDetails === null || cosmosWalletDetails === void 0 ? void 0 : cosmosWalletDetails.offlineSigner)
|
|
589
|
+
? yield this.signAndApproveGateway(commandId, destChain, evmWalletDetails, cosmosWalletDetails, useSelfSigning)
|
|
590
|
+
: useSelfSigning
|
|
591
|
+
? yield this.signAndApproveGateway(commandId, destChain, evmWalletDetails, undefined, true)
|
|
592
|
+
: yield this.signAndApproveGateway(commandId, destChain, evmWalletDetails);
|
|
509
593
|
// If the response.success is false, we will return the error response
|
|
510
594
|
if (!response.success) {
|
|
511
595
|
return {
|
|
@@ -532,17 +616,21 @@ class AxelarGMPRecoveryAPI extends AxelarRecoveryApi_1.AxelarRecoveryApi {
|
|
|
532
616
|
}
|
|
533
617
|
});
|
|
534
618
|
}
|
|
535
|
-
signAndApproveGateway(
|
|
536
|
-
return __awaiter(this,
|
|
619
|
+
signAndApproveGateway(commandId_1, destChain_1, evmWalletDetails_1, cosmosWalletDetails_1) {
|
|
620
|
+
return __awaiter(this, arguments, void 0, function* (commandId, destChain, evmWalletDetails, cosmosWalletDetails, useSelfSigning = false) {
|
|
537
621
|
try {
|
|
538
|
-
const signTxRequest =
|
|
622
|
+
const signTxRequest = (cosmosWalletDetails === null || cosmosWalletDetails === void 0 ? void 0 : cosmosWalletDetails.offlineSigner)
|
|
623
|
+
? yield this.findBatchAndSignIfNeeded(commandId, destChain, cosmosWalletDetails, useSelfSigning)
|
|
624
|
+
: useSelfSigning
|
|
625
|
+
? yield this.findBatchAndSignIfNeeded(commandId, destChain, undefined, true)
|
|
626
|
+
: yield this.findBatchAndSignIfNeeded(commandId, destChain);
|
|
539
627
|
if (!(signTxRequest === null || signTxRequest === void 0 ? void 0 : signTxRequest.success)) {
|
|
540
628
|
return {
|
|
541
629
|
success: false,
|
|
542
630
|
error: signTxRequest.errorMessage || types_1.ApproveGatewayError.SIGN_COMMAND_FAILED,
|
|
543
631
|
};
|
|
544
632
|
}
|
|
545
|
-
const broadcastTxRequest = yield this.findBatchAndApproveGateway(commandId, destChain, evmWalletDetails);
|
|
633
|
+
const broadcastTxRequest = yield this.findBatchAndApproveGateway(commandId, destChain, evmWalletDetails, useSelfSigning);
|
|
546
634
|
if (!(broadcastTxRequest === null || broadcastTxRequest === void 0 ? void 0 : broadcastTxRequest.success)) {
|
|
547
635
|
return {
|
|
548
636
|
success: false,
|