@rango-dev/queue-manager-rango-preset 0.1.10-next.77 → 0.1.10-next.78

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.
@@ -1 +1 @@
1
- {"version":3,"file":"shared-api.d.ts","sourceRoot":"","sources":["src/shared-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAe,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EACL,qBAAqB,EAErB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EAIb,MAAM,iBAAiB,CAAC;AAQzB,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA4BvC;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC,CAoCpC;AAED,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CAmBhC;AAMD,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,YAAY,CAoBd;AAED,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,GAAG,IAAI,GAC5B,OAAO,CAAC,IAAI,CAAC,CAkBf"}
1
+ {"version":3,"file":"shared-api.d.ts","sourceRoot":"","sources":["src/shared-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAe,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EACL,qBAAqB,EAErB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EAIb,MAAM,iBAAiB,CAAC;AASzB,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA4BvC;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC,CAoCpC;AAED,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CAmBhC;AAMD,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,YAAY,CAoBd;AAED,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,GAAG,IAAI,GAC5B,OAAO,CAAC,IAAI,CAAC,CAkBf"}
package/dist/shared.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Network, Transaction, TransferTransaction, WalletType } from '@rango-dev/wallets-shared';
2
- import { CosmosTransaction, EvmBlockchainMeta, EvmTransaction, SimulationResult, SolanaTransaction, StarknetTransaction, TronTransaction } from 'rango-sdk';
1
+ import { Network, WalletType } from '@rango-dev/wallets-shared';
2
+ import { CosmosTransaction, EvmBlockchainMeta, EvmTransaction, SimulationResult, SolanaTransaction, StarknetTransaction, Transaction, TronTransaction, Transfer as TransferTransaction } from 'rango-sdk';
3
3
  import { BigNumber } from 'bignumber.js';
4
4
  import { ErrorDetail } from './shared-errors';
5
5
  export declare type SwapperStatusResponse = {
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,WAAW,EAC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C,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,4BAA4B,SACjC,WAAW,QACX,eAAe,KACpB,OAAO,GAAG,IAMZ,CAAC;AAEF,eAAO,MAAM,sBAAsB,SAC3B,WAAW,QACX,eAAe,KACpB,OAuBF,CAAC;AAEF,eAAO,MAAM,gBAAgB,OACvB,MAAM,WACD,OAAO,uBACK,iBAAiB,EAAE,KACvC,MAgBF,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAS,OAAO,KAAG,WAsBnD,CAAC;AAEF,wBAAgB,WAAW,IAAI,MAAM,CAWpC;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,eAAe,GAC3B,eAAe,GAAG,IAAI,CASxB;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,eAAe,GAC3B,oBAAoB,GAAG,IAAI,CAM7B"}
package/dist/types.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { QueueStorage, QueueDef } from '@rango-dev/queue-manager-core';
2
2
  import { QueueContext } from '@rango-dev/queue-manager-core/dist/queue';
3
3
  import { ConnectResult, Providers } from '@rango-dev/wallets-core';
4
- import { EvmBlockchainMeta, Meta, Network, WalletSigners, WalletState, WalletType } from '@rango-dev/wallets-shared';
4
+ import { Meta, Network, WalletState, WalletType } from '@rango-dev/wallets-shared';
5
5
  import { PendingSwap, SwapProgressNotification, Wallet } from './shared';
6
+ import { EvmBlockchainMeta, SignerFactory } from 'rango-types';
6
7
  export declare type SwapQueueDef = QueueDef<SwapStorage, SwapActionTypes, SwapQueueContext>;
7
8
  export interface SwapStorage extends QueueStorage {
8
9
  swapDetails: PendingSwap;
@@ -29,7 +30,7 @@ export interface SwapQueueContext extends QueueContext {
29
30
  meta: Meta;
30
31
  wallets: Wallet | null;
31
32
  providers: Providers;
32
- getSigners: (type: WalletType) => WalletSigners;
33
+ getSigners: (type: WalletType) => SignerFactory;
33
34
  switchNetwork: (wallet: WalletType, network: Network) => Promise<ConnectResult> | undefined;
34
35
  connect: (wallet: WalletType, network: Network) => Promise<ConnectResult> | undefined;
35
36
  state: (type: WalletType) => WalletState;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EACL,iBAAiB,EACjB,IAAI,EACJ,OAAO,EACP,aAAa,EACb,WAAW,EACX,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEzE,oBAAY,YAAY,GAAG,QAAQ,CACjC,WAAW,EACX,eAAe,EACf,gBAAgB,CACjB,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,wBAAwB,6BAA6B;CACtD;AAED,oBAAY,iBAAiB,GAAG,CAC9B,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,OAAO,KACb,MAAM,GAAG,SAAS,CAAC;AAExB,oBAAY,WAAW;IACrB,uBAAuB,kCAAkC;IACzD,uBAAuB,+BAA+B;IACtD,uBAAuB,4BAA4B;CACpD;AAGD,MAAM,WAAW,KAAK,CAAC,CAAC,GAAG,GAAG;IAC5B,MAAM,EAAE,WAAW,CA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KAAK,WAAW,CAAC;IACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAGnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,UAAU,GAAG,SAAS,CAAC;IAC3C,uBAAuB,EAAE,MAAM,IAAI,CAAC;IACpC,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/queue-manager-rango-preset",
3
- "version": "0.1.10-next.77",
3
+ "version": "0.1.10-next.78",
4
4
  "license": "MIT",
5
5
  "module": "dist/queue-manager-rango-preset.esm.js",
6
6
  "main": "dist/index.js",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "scripts": {
13
13
  "dev": "tsdx watch",
14
- "build": "tsdx build",
14
+ "build": "tsdx build --tsconfig ./tsconfig.json",
15
15
  "test": "tsdx test",
16
16
  "lint": "tsdx lint",
17
17
  "size": "size-limit",
@@ -21,8 +21,8 @@
21
21
  "@rango-dev/queue-manager-core": "*",
22
22
  "@rango-dev/wallets-core": "*",
23
23
  "@rango-dev/wallets-shared": "*",
24
- "@sentry/browser": "*",
25
24
  "bignumber.js": "*",
25
+ "rango-types": "^0.1.21",
26
26
  "uuid": "*"
27
27
  },
28
28
  "husky": {
@@ -50,6 +50,7 @@
50
50
  "@types/uuid": "^8.3.4"
51
51
  },
52
52
  "dependencies": {
53
+ "@sentry/browser": "^6.12.0",
53
54
  "rango-sdk": "^0.1.17",
54
55
  "uuid": "^9.0.0"
55
56
  },
package/src/helpers.ts CHANGED
@@ -7,12 +7,9 @@ import {
7
7
  SwapStorage,
8
8
  } from './types';
9
9
  import {
10
- EvmBlockchainMeta,
11
10
  getBlockChainNameFromId,
12
11
  Meta,
13
12
  Network,
14
- Transaction,
15
- TransactionType,
16
13
  WalletState,
17
14
  WalletType,
18
15
  } from '@rango-dev/wallets-shared';
@@ -25,6 +22,9 @@ import {
25
22
  EvmTransaction,
26
23
  SolanaTransaction,
27
24
  Transfer as TransferTransaction,
25
+ Transaction,
26
+ TransactionType,
27
+ EvmBlockchainMeta,
28
28
  } from 'rango-sdk';
29
29
 
30
30
  import {
@@ -526,7 +526,7 @@ export function getRelatedWallet(
526
526
  const walletType = wallet?.walletType;
527
527
  if (walletType === WalletType.UNKNOWN || wallet === null)
528
528
  throw PrettyError.AssertionFailed(
529
- `Wallet for source ${blockchain} not passed to transfer: walletType: ${walletType}`
529
+ `Wallet for source ${blockchain} not passed: walletType: ${walletType}`
530
530
  );
531
531
  return wallet;
532
532
  }
@@ -764,6 +764,7 @@ export function singTransaction(
764
764
  transferTransaction,
765
765
  } = currentStep;
766
766
  const sourceWallet = getRelatedWallet(swap, currentStep);
767
+ const walletAddress = getCurrentAddressOf(swap, currentStep);
767
768
  const walletSigners = getSigners(sourceWallet.walletType);
768
769
  const onFinish = () => {
769
770
  if (actions.context.resetClaimedBy) {
@@ -799,65 +800,73 @@ export function singTransaction(
799
800
  });
800
801
 
801
802
  // Execute transaction
802
- walletSigners.executeEvmTransaction(evmApprovalTransaction, meta).then(
803
- (hash) => {
804
- console.debug('transaction of approval minted successfully', hash);
805
- const approveUrl = getEvmApproveUrl(
806
- hash,
807
- getCurrentBlockchainOf(swap, currentStep),
808
- meta.evmBasedChains
809
- );
810
- currentStep.explorerUrl = [
811
- ...(currentStep.explorerUrl || []),
812
- {
813
- url: approveUrl,
814
- description: `approve`,
815
- },
816
- ];
817
-
818
- // `currentStep` has been mutated, let's update storage.
819
- setStorage({
820
- ...getStorage(),
821
- swapDetails: swap,
822
- });
823
- schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
824
- next();
825
- onFinish();
826
- },
803
+ walletSigners
804
+ .getSigner(TransactionType.EVM)
805
+ .signAndSendTx(evmApprovalTransaction, walletAddress, null)
806
+ .then(
807
+ (hash) => {
808
+ console.debug('transaction of approval minted successfully', hash);
809
+ const approveUrl = getEvmApproveUrl(
810
+ hash,
811
+ getCurrentBlockchainOf(swap, currentStep),
812
+ meta.evmBasedChains
813
+ );
814
+ currentStep.explorerUrl = [
815
+ ...(currentStep.explorerUrl || []),
816
+ {
817
+ url: approveUrl,
818
+ description: `approve`,
819
+ },
820
+ ];
827
821
 
828
- (error) => {
829
- if (swap.status === 'failed') return;
830
- console.debug('error in approving', error);
831
- const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
832
- prettifyErrorMessage(error);
833
- if (
834
- error &&
835
- error?.root &&
836
- error?.root?.message &&
837
- error?.root?.code &&
838
- error?.root?.reason
839
- ) {
840
- logRPCError(error.root, swap, currentStep, sourceWallet?.walletType);
841
- }
822
+ // `currentStep` has been mutated, let's update storage.
823
+ setStorage({
824
+ ...getStorage(),
825
+ swapDetails: swap,
826
+ });
827
+ schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
828
+ next();
829
+ onFinish();
830
+ },
842
831
 
843
- const updateResult = updateSwapStatus({
844
- getStorage,
845
- setStorage,
846
- nextStatus: 'failed',
847
- nextStepStatus: 'failed',
848
- message: extraMessage,
849
- details: extraMessageDetail,
850
- errorCode: extraMessageErrorCode,
851
- });
852
- notifier({
853
- eventType: 'contract_rejected',
854
- ...updateResult,
855
- });
832
+ (error) => {
833
+ if (swap.status === 'failed') return;
834
+ console.debug('error in approving', error);
835
+ const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
836
+ prettifyErrorMessage(error);
837
+ if (
838
+ error &&
839
+ error?.root &&
840
+ error?.root?.message &&
841
+ error?.root?.code &&
842
+ error?.root?.reason
843
+ ) {
844
+ logRPCError(
845
+ error.root,
846
+ swap,
847
+ currentStep,
848
+ sourceWallet?.walletType
849
+ );
850
+ }
856
851
 
857
- failed();
858
- onFinish();
859
- }
860
- );
852
+ const updateResult = updateSwapStatus({
853
+ getStorage,
854
+ setStorage,
855
+ nextStatus: 'failed',
856
+ nextStepStatus: 'failed',
857
+ message: extraMessage,
858
+ details: extraMessageDetail,
859
+ errorCode: extraMessageErrorCode,
860
+ });
861
+ notifier({
862
+ eventType: 'contract_rejected',
863
+ ...updateResult,
864
+ });
865
+
866
+ failed();
867
+ onFinish();
868
+ }
869
+ );
861
870
  return;
862
871
  }
863
872
 
@@ -881,34 +890,37 @@ export function singTransaction(
881
890
  ...updateResult,
882
891
  });
883
892
 
884
- walletSigners.executeTransfer(transferTransaction, meta).then(
885
- (txId) => {
886
- setStepTransactionIds(actions, txId, 'transfer_confirmed', notifier);
887
- schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
888
- next();
889
- onFinish();
890
- },
891
- (error) => {
892
- if (swap.status === 'failed') return;
893
- const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
894
- prettifyErrorMessage(error);
895
- const updateResult = updateSwapStatus({
896
- getStorage,
897
- setStorage,
898
- nextStatus: 'failed',
899
- nextStepStatus: 'failed',
900
- message: extraMessage,
901
- details: extraMessageDetail,
902
- errorCode: extraMessageErrorCode,
903
- });
904
- notifier({
905
- eventType: 'transfer_rejected',
906
- ...updateResult,
907
- });
908
- failed();
909
- onFinish();
910
- }
911
- );
893
+ walletSigners
894
+ .getSigner(TransactionType.TRANSFER)
895
+ .signAndSendTx(transferTransaction, walletAddress, null)
896
+ .then(
897
+ (txId) => {
898
+ setStepTransactionIds(actions, txId, 'transfer_confirmed', notifier);
899
+ schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
900
+ next();
901
+ onFinish();
902
+ },
903
+ (error) => {
904
+ if (swap.status === 'failed') return;
905
+ const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
906
+ prettifyErrorMessage(error);
907
+ const updateResult = updateSwapStatus({
908
+ getStorage,
909
+ setStorage,
910
+ nextStatus: 'failed',
911
+ nextStepStatus: 'failed',
912
+ message: extraMessage,
913
+ details: extraMessageDetail,
914
+ errorCode: extraMessageErrorCode,
915
+ });
916
+ notifier({
917
+ eventType: 'transfer_rejected',
918
+ ...updateResult,
919
+ });
920
+ failed();
921
+ onFinish();
922
+ }
923
+ );
912
924
  } else if (!!evmTransaction) {
913
925
  const updateResult = updateSwapStatus({
914
926
  getStorage,
@@ -922,44 +934,52 @@ export function singTransaction(
922
934
  ...updateResult,
923
935
  });
924
936
 
925
- walletSigners.executeEvmTransaction(evmTransaction, meta).then(
926
- (id) => {
927
- setStepTransactionIds(actions, id, 'smart_contract_called', notifier);
928
- schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
929
- next();
930
- onFinish();
931
- },
932
- (error) => {
933
- if (swap.status === 'failed') return;
934
- const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
935
- prettifyErrorMessage(error);
936
- if (
937
- error &&
938
- error?.root &&
939
- error?.root?.message &&
940
- error?.root?.code &&
941
- error?.root?.reason
942
- ) {
943
- logRPCError(error.root, swap, currentStep, sourceWallet?.walletType);
944
- }
945
- const updateResult = updateSwapStatus({
946
- getStorage,
947
- setStorage,
948
- nextStatus: 'failed',
949
- nextStepStatus: 'failed',
950
- message: extraMessage,
951
- details: extraMessageDetail,
952
- errorCode: extraMessageErrorCode,
953
- });
954
- notifier({
955
- eventType: 'smart_contract_call_failed',
956
- ...updateResult,
957
- });
937
+ walletSigners
938
+ .getSigner(TransactionType.EVM)
939
+ .signAndSendTx(evmTransaction, walletAddress, null)
940
+ .then(
941
+ (id) => {
942
+ setStepTransactionIds(actions, id, 'smart_contract_called', notifier);
943
+ schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
944
+ next();
945
+ onFinish();
946
+ },
947
+ (error) => {
948
+ if (swap.status === 'failed') return;
949
+ const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
950
+ prettifyErrorMessage(error);
951
+ if (
952
+ error &&
953
+ error?.root &&
954
+ error?.root?.message &&
955
+ error?.root?.code &&
956
+ error?.root?.reason
957
+ ) {
958
+ logRPCError(
959
+ error.root,
960
+ swap,
961
+ currentStep,
962
+ sourceWallet?.walletType
963
+ );
964
+ }
965
+ const updateResult = updateSwapStatus({
966
+ getStorage,
967
+ setStorage,
968
+ nextStatus: 'failed',
969
+ nextStepStatus: 'failed',
970
+ message: extraMessage,
971
+ details: extraMessageDetail,
972
+ errorCode: extraMessageErrorCode,
973
+ });
974
+ notifier({
975
+ eventType: 'smart_contract_call_failed',
976
+ ...updateResult,
977
+ });
958
978
 
959
- failed();
960
- onFinish();
961
- }
962
- );
979
+ failed();
980
+ onFinish();
981
+ }
982
+ );
963
983
  } else if (!!cosmosTransaction) {
964
984
  const updateResult = updateSwapStatus({
965
985
  getStorage,
@@ -1005,35 +1025,38 @@ export function singTransaction(
1005
1025
  return;
1006
1026
  }
1007
1027
 
1008
- walletSigners.executeCosmosMessage(cosmosTransaction, meta).then(
1009
- // todo
1010
- (id: string | null) => {
1011
- setStepTransactionIds(actions, id, 'smart_contract_called', notifier);
1012
- schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
1013
- next();
1014
- onFinish();
1015
- },
1016
- (error: string | null) => {
1017
- if (swap.status === 'failed') return;
1018
- const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
1019
- prettifyErrorMessage(error);
1020
- const updateResult = updateSwapStatus({
1021
- getStorage,
1022
- setStorage,
1023
- nextStatus: 'failed',
1024
- nextStepStatus: 'failed',
1025
- message: extraMessage,
1026
- details: extraMessageDetail,
1027
- errorCode: extraMessageErrorCode,
1028
- });
1029
- notifier({
1030
- eventType: 'smart_contract_call_failed',
1031
- ...updateResult,
1032
- });
1033
- failed();
1034
- onFinish();
1035
- }
1036
- );
1028
+ walletSigners
1029
+ .getSigner(TransactionType.COSMOS)
1030
+ .signAndSendTx(cosmosTransaction, walletAddress, null)
1031
+ .then(
1032
+ // todo
1033
+ (id: string | null) => {
1034
+ setStepTransactionIds(actions, id, 'smart_contract_called', notifier);
1035
+ schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
1036
+ next();
1037
+ onFinish();
1038
+ },
1039
+ (error: string | null) => {
1040
+ if (swap.status === 'failed') return;
1041
+ const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
1042
+ prettifyErrorMessage(error);
1043
+ const updateResult = updateSwapStatus({
1044
+ getStorage,
1045
+ setStorage,
1046
+ nextStatus: 'failed',
1047
+ nextStepStatus: 'failed',
1048
+ message: extraMessage,
1049
+ details: extraMessageDetail,
1050
+ errorCode: extraMessageErrorCode,
1051
+ });
1052
+ notifier({
1053
+ eventType: 'smart_contract_call_failed',
1054
+ ...updateResult,
1055
+ });
1056
+ failed();
1057
+ onFinish();
1058
+ }
1059
+ );
1037
1060
  } else if (!!solanaTransaction) {
1038
1061
  const updateResult = updateSwapStatus({
1039
1062
  getStorage,
@@ -1048,34 +1071,42 @@ export function singTransaction(
1048
1071
  });
1049
1072
 
1050
1073
  const tx = solanaTransaction;
1051
- walletSigners.executeSolanaTransaction(tx, swap.requestId).then(
1052
- (txId) => {
1053
- setStepTransactionIds(actions, txId, 'smart_contract_called', notifier);
1054
- schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
1055
- next();
1056
- onFinish();
1057
- },
1058
- (error) => {
1059
- if (swap.status === 'failed') return;
1060
- const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
1061
- prettifyErrorMessage(error);
1062
- const updateResult = updateSwapStatus({
1063
- getStorage,
1064
- setStorage,
1065
- nextStatus: 'failed',
1066
- nextStepStatus: 'failed',
1067
- message: extraMessage,
1068
- details: extraMessageDetail,
1069
- errorCode: extraMessageErrorCode,
1070
- });
1071
- notifier({
1072
- eventType: 'smart_contract_call_failed',
1073
- ...updateResult,
1074
- });
1075
- failed();
1076
- onFinish();
1077
- }
1078
- );
1074
+ walletSigners
1075
+ .getSigner(TransactionType.SOLANA)
1076
+ .signAndSendTx(tx, walletAddress, null)
1077
+ .then(
1078
+ (txId) => {
1079
+ setStepTransactionIds(
1080
+ actions,
1081
+ txId,
1082
+ 'smart_contract_called',
1083
+ notifier
1084
+ );
1085
+ schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
1086
+ next();
1087
+ onFinish();
1088
+ },
1089
+ (error) => {
1090
+ if (swap.status === 'failed') return;
1091
+ const { extraMessage, extraMessageDetail, extraMessageErrorCode } =
1092
+ prettifyErrorMessage(error);
1093
+ const updateResult = updateSwapStatus({
1094
+ getStorage,
1095
+ setStorage,
1096
+ nextStatus: 'failed',
1097
+ nextStepStatus: 'failed',
1098
+ message: extraMessage,
1099
+ details: extraMessageDetail,
1100
+ errorCode: extraMessageErrorCode,
1101
+ });
1102
+ notifier({
1103
+ eventType: 'smart_contract_call_failed',
1104
+ ...updateResult,
1105
+ });
1106
+ failed();
1107
+ onFinish();
1108
+ }
1109
+ );
1079
1110
  }
1080
1111
  }
1081
1112
 
package/src/shared-api.ts CHANGED
@@ -1,8 +1,4 @@
1
- import {
2
- isWalletErrorCode,
3
- WalletErrorCode,
4
- WalletType,
5
- } from '@rango-dev/wallets-shared';
1
+ import { WalletType } from '@rango-dev/wallets-shared';
6
2
  import { getCookieId, SwapperStatusResponse } from './shared';
7
3
  import {
8
4
  CheckApprovalResponse,
@@ -22,6 +18,7 @@ import {
22
18
  RANGO_COOKIE_HEADER,
23
19
  RANGO_DAPP_ID_QUERY,
24
20
  } from './constants';
21
+ import { isSignerErrorCode, SignerErrorCode } from 'rango-types';
25
22
 
26
23
  export async function checkSwapStatus(
27
24
  requestId: string,
@@ -131,14 +128,14 @@ export function mapAppErrorCodesToAPIErrorCode(
131
128
  try {
132
129
  if (!errorCode) return defaultErrorCode;
133
130
  if (isAPIErrorCode(errorCode)) return errorCode;
134
- if (isWalletErrorCode(errorCode)) {
135
- const t: { [key in WalletErrorCode]: APIErrorCode } = {
136
- [WalletErrorCode.REJECTED_BY_USER]: APIErrorCode.USER_REJECT,
137
- [WalletErrorCode.SIGN_TX_ERROR]: APIErrorCode.CALL_WALLET_FAILED,
138
- [WalletErrorCode.SEND_TX_ERROR]: APIErrorCode.SEND_TX_FAILED,
139
- [WalletErrorCode.NOT_IMPLEMENTED]: defaultErrorCode,
140
- [WalletErrorCode.OPERATION_UNSUPPORTED]: defaultErrorCode,
141
- [WalletErrorCode.UNEXPECTED_BEHAVIOUR]: defaultErrorCode,
131
+ if (isSignerErrorCode(errorCode)) {
132
+ const t: { [key in SignerErrorCode]: APIErrorCode } = {
133
+ [SignerErrorCode.REJECTED_BY_USER]: APIErrorCode.USER_REJECT,
134
+ [SignerErrorCode.SIGN_TX_ERROR]: APIErrorCode.CALL_WALLET_FAILED,
135
+ [SignerErrorCode.SEND_TX_ERROR]: APIErrorCode.SEND_TX_FAILED,
136
+ [SignerErrorCode.NOT_IMPLEMENTED]: defaultErrorCode,
137
+ [SignerErrorCode.OPERATION_UNSUPPORTED]: defaultErrorCode,
138
+ [SignerErrorCode.UNEXPECTED_BEHAVIOUR]: defaultErrorCode,
142
139
  };
143
140
  return t[errorCode];
144
141
  }
@@ -16,7 +16,7 @@ export function logRPCError(
16
16
  swapper: currentStep?.swapperId || '',
17
17
  walletType: walletType || '',
18
18
  },
19
- level: 'warning',
19
+ level: 'warning' as any,
20
20
  });
21
21
  } catch (e) {
22
22
  console.log({ e });