@rosen-bridge/rosen-extractor 7.2.1 → 7.2.2
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/lib/getRosenData/abstract/types.d.ts +13 -13
- package/dist/lib/getRosenData/bitcoin/types.d.ts +66 -66
- package/dist/lib/getRosenData/bitcoin/utils.d.ts +1 -1
- package/dist/lib/getRosenData/cardano/CardanoBlockFrostRosenExtractor.d.ts +13 -16
- package/dist/lib/getRosenData/cardano/CardanoGraphQLRosenExtractor.d.ts +13 -16
- package/dist/lib/getRosenData/cardano/CardanoOgmiosRosenExtractor.d.ts +13 -16
- package/dist/lib/getRosenData/cardano/CardanoRosenExtractor.d.ts +13 -16
- package/dist/lib/getRosenData/ergo/types.d.ts +24 -24
- package/dist/lib/getRosenData/evm/EvmEthersRosenExtractor.d.ts +6 -0
- package/dist/lib/getRosenData/evm/EvmEthersRosenExtractor.d.ts.map +1 -1
- package/dist/lib/getRosenData/evm/EvmEthersRosenExtractor.js +25 -2
- package/dist/lib/getRosenData/evm/utils.d.ts +5 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/lib/getRosenData/Utils.d.ts +0 -59
- package/dist/lib/getRosenData/Utils.d.ts.map +0 -1
- package/dist/lib/getRosenData/Utils.js +0 -96
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
interface RosenData {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
toChain: string;
|
|
3
|
+
toAddress: string;
|
|
4
|
+
bridgeFee: string;
|
|
5
|
+
networkFee: string;
|
|
6
|
+
fromAddress: string;
|
|
7
|
+
sourceChainTokenId: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
targetChainTokenId: string;
|
|
10
|
+
sourceTxId: string;
|
|
11
11
|
}
|
|
12
12
|
interface TokenTransformation {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
from: string;
|
|
14
|
+
to: string;
|
|
15
|
+
amount: string;
|
|
16
16
|
}
|
|
17
17
|
export { RosenData, TokenTransformation };
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,89 +1,89 @@
|
|
|
1
1
|
export interface OpReturnData {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
toChain: string;
|
|
3
|
+
toAddress: string;
|
|
4
|
+
bridgeFee: string;
|
|
5
|
+
networkFee: string;
|
|
6
6
|
}
|
|
7
7
|
export interface EsploraTxInput {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
txid: string;
|
|
9
|
+
vout: number;
|
|
10
|
+
prevout: {
|
|
11
|
+
scriptpubkey: string;
|
|
12
|
+
scriptpubkey_asm: string;
|
|
13
|
+
scriptpubkey_type: string;
|
|
14
|
+
scriptpubkey_address: string;
|
|
15
|
+
value: number;
|
|
16
|
+
};
|
|
17
|
+
scriptsig: string;
|
|
18
|
+
scriptsig_asm: string;
|
|
19
|
+
is_coinbase: false;
|
|
20
|
+
sequence: number;
|
|
21
|
+
}
|
|
22
|
+
export interface EsploraTxOutput {
|
|
11
23
|
scriptpubkey: string;
|
|
12
24
|
scriptpubkey_asm: string;
|
|
13
25
|
scriptpubkey_type: string;
|
|
14
26
|
scriptpubkey_address: string;
|
|
15
27
|
value: number;
|
|
16
|
-
};
|
|
17
|
-
scriptsig: string;
|
|
18
|
-
scriptsig_asm: string;
|
|
19
|
-
is_coinbase: false;
|
|
20
|
-
sequence: number;
|
|
21
|
-
}
|
|
22
|
-
export interface EsploraTxOutput {
|
|
23
|
-
scriptpubkey: string;
|
|
24
|
-
scriptpubkey_asm: string;
|
|
25
|
-
scriptpubkey_type: string;
|
|
26
|
-
scriptpubkey_address: string;
|
|
27
|
-
value: number;
|
|
28
28
|
}
|
|
29
29
|
export interface BitcoinEsploraTransaction {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
txid: string;
|
|
31
|
+
version: number;
|
|
32
|
+
locktime: number;
|
|
33
|
+
vin: Array<EsploraTxInput>;
|
|
34
|
+
vout: Array<EsploraTxOutput>;
|
|
35
|
+
size: number;
|
|
36
|
+
weight: number;
|
|
37
|
+
fee: number;
|
|
38
|
+
status: {
|
|
39
|
+
confirmed: true;
|
|
40
|
+
block_height: number;
|
|
41
|
+
block_hash: string;
|
|
42
|
+
block_time: number;
|
|
43
|
+
};
|
|
44
44
|
}
|
|
45
45
|
export interface BitcoinTxInput {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
txId: string;
|
|
47
|
+
index: number;
|
|
48
|
+
scriptPubKey: string;
|
|
49
49
|
}
|
|
50
50
|
export interface BitcoinTxOutput {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
scriptPubKey: string;
|
|
52
|
+
value: bigint;
|
|
53
53
|
}
|
|
54
54
|
export interface BitcoinTx {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
id: string;
|
|
56
|
+
inputs: BitcoinTxInput[];
|
|
57
|
+
outputs: BitcoinTxOutput[];
|
|
58
58
|
}
|
|
59
59
|
export interface BitcoinRpcTxInput {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
txid: string;
|
|
61
|
+
vout: number;
|
|
62
|
+
scriptSig: {
|
|
63
|
+
asm: string;
|
|
64
|
+
hex: string;
|
|
65
|
+
};
|
|
66
|
+
txinwitness: Array<string>;
|
|
67
|
+
sequence: number;
|
|
68
68
|
}
|
|
69
69
|
export interface BitcoinRpcTxOutput {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
value: number;
|
|
71
|
+
n: number;
|
|
72
|
+
scriptPubKey: {
|
|
73
|
+
asm: string;
|
|
74
|
+
hex: string;
|
|
75
|
+
};
|
|
76
76
|
}
|
|
77
77
|
export interface BitcoinRpcTransaction {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
txid: string;
|
|
79
|
+
hash: string;
|
|
80
|
+
version: number;
|
|
81
|
+
size: number;
|
|
82
|
+
vsize: number;
|
|
83
|
+
weight: number;
|
|
84
|
+
locktime: number;
|
|
85
|
+
vin: Array<BitcoinRpcTxInput>;
|
|
86
|
+
vout: Array<BitcoinRpcTxOutput>;
|
|
87
|
+
hex: string;
|
|
88
88
|
}
|
|
89
|
-
//# sourceMappingURL=types.d.ts.map
|
|
89
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -2,20 +2,17 @@ import { RosenData, TokenTransformation } from '../abstract/types';
|
|
|
2
2
|
import AbstractRosenDataExtractor from '../abstract/AbstractRosenDataExtractor';
|
|
3
3
|
import { BlockFrostOutputBox, BlockFrostTransaction } from './types';
|
|
4
4
|
export declare class CardanoBlockFrostRosenExtractor extends AbstractRosenDataExtractor<BlockFrostTransaction> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
box: BlockFrostOutputBox,
|
|
18
|
-
toChain: string
|
|
19
|
-
) => TokenTransformation | undefined;
|
|
5
|
+
readonly chain = "cardano";
|
|
6
|
+
/**
|
|
7
|
+
* extracts RosenData from given lock transaction in blockfrost format
|
|
8
|
+
* @param transaction the lock transaction in blockfrost format
|
|
9
|
+
*/
|
|
10
|
+
extractRawData: (transaction: BlockFrostTransaction) => RosenData | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* extracts and builds token transformation from UTXO and tokenMap
|
|
13
|
+
* @param box transaction output
|
|
14
|
+
* @param toChain event target chain
|
|
15
|
+
*/
|
|
16
|
+
getAssetTransformation: (box: BlockFrostOutputBox, toChain: string) => TokenTransformation | undefined;
|
|
20
17
|
}
|
|
21
|
-
//# sourceMappingURL=CardanoBlockFrostRosenExtractor.d.ts.map
|
|
18
|
+
//# sourceMappingURL=CardanoBlockFrostRosenExtractor.d.ts.map
|
|
@@ -2,20 +2,17 @@ import { RosenData, TokenTransformation } from '../abstract/types';
|
|
|
2
2
|
import AbstractRosenDataExtractor from '../abstract/AbstractRosenDataExtractor';
|
|
3
3
|
import { GraphQLTransaction, GraphQLTxOutput } from './types';
|
|
4
4
|
export declare class CardanoGraphQLRosenExtractor extends AbstractRosenDataExtractor<GraphQLTransaction> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
box: GraphQLTxOutput,
|
|
18
|
-
toChain: string
|
|
19
|
-
) => TokenTransformation | undefined;
|
|
5
|
+
readonly chain = "cardano";
|
|
6
|
+
/**
|
|
7
|
+
* extracts RosenData from given lock transaction in graphql format
|
|
8
|
+
* @param transaction the lock transaction in graphql format
|
|
9
|
+
*/
|
|
10
|
+
extractRawData: (transaction: GraphQLTransaction) => RosenData | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* extracts and builds token transformation from UTXO and tokenMap
|
|
13
|
+
* @param box transaction output
|
|
14
|
+
* @param toChain event target chain
|
|
15
|
+
*/
|
|
16
|
+
getAssetTransformation: (box: GraphQLTxOutput, toChain: string) => TokenTransformation | undefined;
|
|
20
17
|
}
|
|
21
|
-
//# sourceMappingURL=CardanoGraphQLRosenExtractor.d.ts.map
|
|
18
|
+
//# sourceMappingURL=CardanoGraphQLRosenExtractor.d.ts.map
|
|
@@ -2,20 +2,17 @@ import { RosenData, TokenTransformation } from '../abstract/types';
|
|
|
2
2
|
import AbstractRosenDataExtractor from '../abstract/AbstractRosenDataExtractor';
|
|
3
3
|
import { Transaction, TransactionOutput } from '@cardano-ogmios/schema';
|
|
4
4
|
export declare class CardanoOgmiosRosenExtractor extends AbstractRosenDataExtractor<Transaction> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
box: TransactionOutput,
|
|
18
|
-
toChain: string
|
|
19
|
-
) => TokenTransformation | undefined;
|
|
5
|
+
readonly chain = "cardano";
|
|
6
|
+
/**
|
|
7
|
+
* extracts RosenData from given lock transaction in Ogmios format
|
|
8
|
+
* @param transaction the lock transaction in Koios format
|
|
9
|
+
*/
|
|
10
|
+
extractRawData: (transaction: Transaction) => RosenData | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* extracts and builds token transformation from TxOut and tokenMap
|
|
13
|
+
* @param box transaction output
|
|
14
|
+
* @param toChain event target chain
|
|
15
|
+
*/
|
|
16
|
+
getAssetTransformation: (box: TransactionOutput, toChain: string) => TokenTransformation | undefined;
|
|
20
17
|
}
|
|
21
|
-
//# sourceMappingURL=CardanoOgmiosRosenExtractor.d.ts.map
|
|
18
|
+
//# sourceMappingURL=CardanoOgmiosRosenExtractor.d.ts.map
|
|
@@ -2,20 +2,17 @@ import AbstractRosenDataExtractor from '../abstract/AbstractRosenDataExtractor';
|
|
|
2
2
|
import { RosenData, TokenTransformation } from '../abstract/types';
|
|
3
3
|
import { CardanoBoxCandidate } from './types';
|
|
4
4
|
export declare class CardanoRosenExtractor extends AbstractRosenDataExtractor<string> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
box: CardanoBoxCandidate,
|
|
18
|
-
toChain: string
|
|
19
|
-
) => TokenTransformation | undefined;
|
|
5
|
+
readonly chain = "cardano";
|
|
6
|
+
/**
|
|
7
|
+
* extracts RosenData from given lock transaction in CardanoTx format
|
|
8
|
+
* @param serializedTransaction stringified transaction in CardanoTx format
|
|
9
|
+
*/
|
|
10
|
+
extractRawData: (serializedTransaction: string) => RosenData | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* extracts and builds token transformation from CardanoBoxCandidate and tokenMap
|
|
13
|
+
* @param box transaction output in CardanoBoxCandidate format
|
|
14
|
+
* @param toChain event target chain
|
|
15
|
+
*/
|
|
16
|
+
getAssetTransformation: (box: CardanoBoxCandidate, toChain: string) => TokenTransformation | undefined;
|
|
20
17
|
}
|
|
21
|
-
//# sourceMappingURL=CardanoRosenExtractor.d.ts.map
|
|
18
|
+
//# sourceMappingURL=CardanoRosenExtractor.d.ts.map
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
interface NodeAsset {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
tokenId: string;
|
|
3
|
+
amount: bigint;
|
|
4
4
|
}
|
|
5
5
|
interface NodeAdditionalRegisters {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
R4?: string;
|
|
7
|
+
R5?: string;
|
|
8
|
+
R6?: string;
|
|
9
|
+
R7?: string;
|
|
10
|
+
R8?: string;
|
|
11
|
+
R9?: string;
|
|
12
12
|
}
|
|
13
13
|
interface NodeOutputBox {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
boxId: string;
|
|
15
|
+
value: bigint;
|
|
16
|
+
ergoTree: string;
|
|
17
|
+
creationHeight: bigint | number;
|
|
18
|
+
assets?: Array<NodeAsset>;
|
|
19
|
+
additionalRegisters?: NodeAdditionalRegisters;
|
|
20
|
+
transactionId: string;
|
|
21
|
+
index: bigint | number;
|
|
22
22
|
}
|
|
23
23
|
interface NodeInputBox {
|
|
24
|
-
|
|
24
|
+
boxId: string;
|
|
25
25
|
}
|
|
26
26
|
interface NodeDataInput {
|
|
27
|
-
|
|
27
|
+
boxId: string;
|
|
28
28
|
}
|
|
29
29
|
interface NodeTransaction {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
id: string;
|
|
31
|
+
inputs: Array<NodeInputBox>;
|
|
32
|
+
dataInputs: Array<NodeDataInput>;
|
|
33
|
+
outputs: Array<NodeOutputBox>;
|
|
34
|
+
size?: bigint;
|
|
35
35
|
}
|
|
36
36
|
export { NodeOutputBox, NodeTransaction };
|
|
37
|
-
//# sourceMappingURL=types.d.ts.map
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -7,11 +7,17 @@ import { EvmRpcRosenExtractor } from './EvmRpcRosenExtractor';
|
|
|
7
7
|
export declare class EvmEthersRosenExtractor extends AbstractRosenDataExtractor<TransactionResponse> {
|
|
8
8
|
readonly chain: string;
|
|
9
9
|
protected rpcExtractor: EvmRpcRosenExtractor;
|
|
10
|
+
protected supportedTokens: string[];
|
|
10
11
|
constructor(lockAddress: string, tokens: TokenMap, chain: string, nativeToken: string, logger?: AbstractLogger);
|
|
11
12
|
/**
|
|
12
13
|
* extracts RosenData from given lock transaction in ethers TransactionResponse format
|
|
13
14
|
* @param txRes the lock transaction in ethers TransactionResponse format
|
|
14
15
|
*/
|
|
15
16
|
extractRawData: (txRes: TransactionResponse) => RosenData | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* update supported tokens
|
|
19
|
+
* @param tokens
|
|
20
|
+
*/
|
|
21
|
+
updateSupportedTokens: () => void;
|
|
16
22
|
}
|
|
17
23
|
//# sourceMappingURL=EvmEthersRosenExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmEthersRosenExtractor.d.ts","sourceRoot":"","sources":["../../../../lib/getRosenData/evm/EvmEthersRosenExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,0BAA0B,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAe,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,qBAAa,uBAAwB,SAAQ,0BAA0B,CAAC,mBAAmB,CAAC;IAC1F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,YAAY,EAAE,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"EvmEthersRosenExtractor.d.ts","sourceRoot":"","sources":["../../../../lib/getRosenData/evm/EvmEthersRosenExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,0BAA0B,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAe,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,qBAAa,uBAAwB,SAAQ,0BAA0B,CAAC,mBAAmB,CAAC;IAC1F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC7C,SAAS,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;gBAGlC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,cAAc;IAezB;;;OAGG;IACH,cAAc,UAAW,mBAAmB,KAAG,SAAS,GAAG,SAAS,CAuBlE;IAEF;;;OAGG;IACH,qBAAqB,aAOnB;CACH"}
|
|
@@ -4,10 +4,13 @@ import { EvmRpcRosenExtractor } from './EvmRpcRosenExtractor';
|
|
|
4
4
|
export class EvmEthersRosenExtractor extends AbstractRosenDataExtractor {
|
|
5
5
|
chain;
|
|
6
6
|
rpcExtractor;
|
|
7
|
+
supportedTokens;
|
|
7
8
|
constructor(lockAddress, tokens, chain, nativeToken, logger) {
|
|
8
9
|
super(lockAddress, tokens, logger);
|
|
9
10
|
this.chain = chain;
|
|
10
11
|
this.rpcExtractor = new EvmRpcRosenExtractor(lockAddress, tokens, chain, nativeToken, logger);
|
|
12
|
+
this.updateSupportedTokens();
|
|
13
|
+
this.tokens.registerCallback(this.updateSupportedTokens);
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* extracts RosenData from given lock transaction in ethers TransactionResponse format
|
|
@@ -16,7 +19,15 @@ export class EvmEthersRosenExtractor extends AbstractRosenDataExtractor {
|
|
|
16
19
|
extractRawData = (txRes) => {
|
|
17
20
|
let transaction;
|
|
18
21
|
try {
|
|
19
|
-
|
|
22
|
+
const toAddress = txRes.to?.toLowerCase();
|
|
23
|
+
if (toAddress &&
|
|
24
|
+
(toAddress === this.lockAddress ||
|
|
25
|
+
this.supportedTokens.includes(toAddress))) {
|
|
26
|
+
transaction = Transaction.from(txRes);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
20
31
|
}
|
|
21
32
|
catch (e) {
|
|
22
33
|
this.logger.debug(`An error occurred while deserializing ${this.chain} tx to extract rosen data: ${e}`);
|
|
@@ -27,5 +38,17 @@ export class EvmEthersRosenExtractor extends AbstractRosenDataExtractor {
|
|
|
27
38
|
}
|
|
28
39
|
return this.rpcExtractor.extractRawData(transaction);
|
|
29
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* update supported tokens
|
|
43
|
+
* @param tokens
|
|
44
|
+
*/
|
|
45
|
+
updateSupportedTokens = () => {
|
|
46
|
+
const newSupportedTokens = [];
|
|
47
|
+
this.tokens.getConfig().forEach((tokenSet) => {
|
|
48
|
+
if (Object.hasOwn(tokenSet, this.chain))
|
|
49
|
+
newSupportedTokens.push(tokenSet[this.chain].tokenId);
|
|
50
|
+
});
|
|
51
|
+
this.supportedTokens = newSupportedTokens;
|
|
52
|
+
};
|
|
30
53
|
}
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXZtRXRoZXJzUm9zZW5FeHRyYWN0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWIvZ2V0Um9zZW5EYXRhL2V2bS9Fdm1FdGhlcnNSb3NlbkV4dHJhY3Rvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLDBCQUEwQixNQUFNLHdDQUF3QyxDQUFDO0FBQ2hGLE9BQU8sRUFBRSxXQUFXLEVBQXVCLE1BQU0sUUFBUSxDQUFDO0FBRzFELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRTlELE1BQU0sT0FBTyx1QkFBd0IsU0FBUSwwQkFBK0M7SUFDakYsS0FBSyxDQUFTO0lBQ2IsWUFBWSxDQUF1QjtJQUNuQyxlQUFlLENBQVc7SUFFcEMsWUFDRSxXQUFtQixFQUNuQixNQUFnQixFQUNoQixLQUFhL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Uuc3RhY2spIHtcbiAgICAgICAgdGhpcy5sb2dnZXIuZGVidWcoZS5zdGFjayk7XG4gICAgICB9XG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cbiAgICByZXR1cm4gdGhpcy5ycGNFeHRyYWN0b3IuZXh0cmFjdFJhd0RhdGEodHJhbnNhY3Rpb24pO1xuICB9O1xuXG4gIC8qKlxuICAgKiB1cGRhdGUgc3VwcG9ydGVkIHRva2Vuc1xuICAgKiBAcGFyYW0gdG9rZW5zXG4gICAqL1xuICB1cGRhdGVTdXBwb3J0ZWRUb2tlbnMgPSAoKSA9PiB7XG4gICAgY29uc3QgbmV3U3VwcG9ydGVkVG9rZW5zOiBzdHJpbmdbXSA9IFtdO1xuICAgIHRoaXMudG9rZW5zLmdldENvbmZpZygpLmZvckVhY2goKHRva2VuU2V0KSA9PiB7XG4gICAgICBpZiAoT2JqZWN0Lmhhc093bih0b2tlblNldCwgdGhpcy5jaGFpbikpXG4gICAgICAgIG5ld1N1cHBvcnRlZFRva2Vucy5wdXNoKHRva2VuU2V0W3RoaXMuY2hhaW5dLnRva2VuSWQpO1xuICAgIH0pO1xuICAgIHRoaXMuc3VwcG9ydGVkVG9rZW5zID0gbmV3U3VwcG9ydGVkVG9rZW5zO1xuICB9O1xufVxuIl19
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
interface CallDataRosenData {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
toChain: string;
|
|
3
|
+
toAddress: string;
|
|
4
|
+
bridgeFee: string;
|
|
5
|
+
networkFee: string;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* extracts rosen data from transaction's remaining call data
|
|
@@ -10,4 +10,4 @@ interface CallDataRosenData {
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const parseRosenData: (callData: string) => CallDataRosenData;
|
|
12
12
|
export {};
|
|
13
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
13
|
+
//# sourceMappingURL=utils.d.ts.map
|