@rosen-bridge/rosen-extractor 6.2.0 → 6.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/Utils.d.ts +59 -0
- package/dist/lib/getRosenData/Utils.d.ts.map +1 -0
- package/dist/lib/getRosenData/Utils.js +96 -0
- package/dist/lib/getRosenData/abstract/AbstractRosenDataExtractor.d.ts +20 -14
- package/dist/lib/getRosenData/abstract/types.d.ts +13 -13
- package/dist/lib/getRosenData/bitcoin/BitcoinEsploraRosenExtractor.d.ts +24 -15
- package/dist/lib/getRosenData/bitcoin/BitcoinRosenExtractor.d.ts +22 -15
- package/dist/lib/getRosenData/bitcoin/BitcoinRpcRosenExtractor.d.ts +22 -15
- 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 +16 -13
- package/dist/lib/getRosenData/cardano/CardanoGraphQLRosenExtractor.d.ts +16 -13
- package/dist/lib/getRosenData/cardano/CardanoKoiosRosenExtractor.d.ts +16 -13
- package/dist/lib/getRosenData/cardano/CardanoOgmiosRosenExtractor.d.ts +16 -13
- package/dist/lib/getRosenData/cardano/CardanoRosenExtractor.d.ts +16 -13
- package/dist/lib/getRosenData/cardano/types.d.ts +110 -90
- package/dist/lib/getRosenData/cardano/utils.d.ts +10 -8
- package/dist/lib/getRosenData/const.d.ts +9 -9
- package/dist/lib/getRosenData/ergo/ErgoNodeRosenExtractor.d.ts +22 -15
- package/dist/lib/getRosenData/ergo/ErgoRosenExtractor.d.ts +13 -9
- package/dist/lib/getRosenData/ergo/types.d.ts +24 -24
- package/dist/lib/getRosenData/evm/EvmEthersRosenExtractor.d.ts +15 -9
- package/dist/lib/getRosenData/evm/EvmRosenExtractor.d.ts +15 -9
- package/dist/lib/getRosenData/evm/EvmRpcRosenExtractor.d.ts +25 -19
- package/dist/lib/getRosenData/evm/utils.d.ts +5 -5
- package/dist/lib/index.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -2,17 +2,20 @@ 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
|
-
|
|
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: (
|
|
17
|
+
box: TransactionOutput,
|
|
18
|
+
toChain: string
|
|
19
|
+
) => TokenTransformation | undefined;
|
|
17
20
|
}
|
|
18
|
-
//# sourceMappingURL=CardanoOgmiosRosenExtractor.d.ts.map
|
|
21
|
+
//# sourceMappingURL=CardanoOgmiosRosenExtractor.d.ts.map
|
|
@@ -2,17 +2,20 @@ 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
|
-
|
|
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: (
|
|
17
|
+
box: CardanoBoxCandidate,
|
|
18
|
+
toChain: string
|
|
19
|
+
) => TokenTransformation | undefined;
|
|
17
20
|
}
|
|
18
|
-
//# sourceMappingURL=CardanoRosenExtractor.d.ts.map
|
|
21
|
+
//# sourceMappingURL=CardanoRosenExtractor.d.ts.map
|
|
@@ -1,126 +1,146 @@
|
|
|
1
1
|
import { components } from '@blockfrost/openapi';
|
|
2
2
|
interface PaymentAddr {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
bech32: string;
|
|
4
|
+
cred: string;
|
|
5
5
|
}
|
|
6
6
|
interface Asset {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
policy_id: string;
|
|
8
|
+
asset_name: string;
|
|
9
|
+
quantity: string;
|
|
10
10
|
}
|
|
11
11
|
interface Utxo {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
payment_addr: PaymentAddr;
|
|
13
|
+
stake_addr?: string | null;
|
|
14
|
+
tx_hash: string;
|
|
15
|
+
tx_index: number;
|
|
16
|
+
value: string;
|
|
17
|
+
asset_list: Array<Asset>;
|
|
18
18
|
}
|
|
19
19
|
interface Metadata {
|
|
20
|
-
|
|
20
|
+
[key: string]: Record<string, unknown>;
|
|
21
21
|
}
|
|
22
22
|
interface KoiosTransaction {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
tx_hash: string;
|
|
24
|
+
block_hash: string;
|
|
25
|
+
inputs: Array<Utxo>;
|
|
26
|
+
outputs: Array<Utxo>;
|
|
27
|
+
metadata?: Metadata;
|
|
28
28
|
}
|
|
29
29
|
interface CardanoRosenData {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
toChain: string;
|
|
31
|
+
toAddress: string;
|
|
32
|
+
bridgeFee: string;
|
|
33
|
+
networkFee: string;
|
|
34
|
+
fromAddress: string;
|
|
35
35
|
}
|
|
36
36
|
interface CardanoMetadataRosenData {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
to: string;
|
|
38
|
+
networkFee: string;
|
|
39
|
+
bridgeFee: string;
|
|
40
|
+
toAddress: string;
|
|
41
|
+
fromAddress: string[];
|
|
42
42
|
}
|
|
43
43
|
type ListObject = Array<MetadataObject>;
|
|
44
44
|
type NativeValue = string | undefined;
|
|
45
45
|
interface JsonObject {
|
|
46
|
-
|
|
46
|
+
[key: string]: MetadataObject;
|
|
47
47
|
}
|
|
48
48
|
type MetadataObject = JsonObject | ListObject | NativeValue;
|
|
49
49
|
interface CardanoAsset {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
policy_id: string;
|
|
51
|
+
asset_name: string;
|
|
52
|
+
quantity: string;
|
|
53
53
|
}
|
|
54
54
|
interface CardanoUtxo {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
txId: string;
|
|
56
|
+
index: number;
|
|
57
|
+
value: bigint;
|
|
58
|
+
assets: Array<CardanoAsset>;
|
|
59
59
|
}
|
|
60
60
|
interface CardanoBoxCandidate {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
address: string;
|
|
62
|
+
value: bigint;
|
|
63
|
+
assets: Array<CardanoAsset>;
|
|
64
64
|
}
|
|
65
65
|
type CardanoMetadata = Record<string, string | Record<string, any>>;
|
|
66
66
|
interface CardanoTx {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
id: string;
|
|
68
|
+
inputs: CardanoUtxo[];
|
|
69
|
+
outputs: CardanoBoxCandidate[];
|
|
70
|
+
fee: bigint;
|
|
71
|
+
metadata?: CardanoMetadata;
|
|
72
72
|
}
|
|
73
73
|
interface BlockFrostTransaction {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
utxos: components['schemas']['tx_content_utxo'];
|
|
75
|
+
metadata: components['schemas']['tx_content_metadata'];
|
|
76
76
|
}
|
|
77
|
-
type BlockFrostOutputBox =
|
|
77
|
+
type BlockFrostOutputBox =
|
|
78
|
+
components['schemas']['tx_content_utxo']['outputs'][0];
|
|
78
79
|
type GraphQLBlockTxsQuery = {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} | null>;
|
|
100
|
-
}>;
|
|
101
|
-
outputs: Array<{
|
|
102
|
-
__typename?: 'TransactionOutput';
|
|
103
|
-
address: string;
|
|
104
|
-
value: any;
|
|
105
|
-
tokens: Array<{
|
|
106
|
-
__typename?: 'Token';
|
|
107
|
-
quantity: string;
|
|
108
|
-
asset: {
|
|
109
|
-
__typename?: 'Asset';
|
|
110
|
-
assetName?: any | null;
|
|
111
|
-
policyId: any;
|
|
112
|
-
};
|
|
113
|
-
}>;
|
|
114
|
-
} | null>;
|
|
115
|
-
metadata?: Array<{
|
|
116
|
-
__typename?: 'TransactionMetadata';
|
|
117
|
-
key: string;
|
|
118
|
-
value: any;
|
|
119
|
-
} | null> | null;
|
|
80
|
+
__typename?: 'Query';
|
|
81
|
+
blocks: Array<{
|
|
82
|
+
__typename?: 'Block';
|
|
83
|
+
transactions: Array<{
|
|
84
|
+
__typename?: 'Transaction';
|
|
85
|
+
hash: any;
|
|
86
|
+
fee: any;
|
|
87
|
+
inputs: Array<{
|
|
88
|
+
__typename?: 'TransactionInput';
|
|
89
|
+
sourceTxIndex: number;
|
|
90
|
+
sourceTxHash: any;
|
|
91
|
+
value: any;
|
|
92
|
+
tokens: Array<{
|
|
93
|
+
__typename?: 'Token';
|
|
94
|
+
quantity: string;
|
|
95
|
+
asset: {
|
|
96
|
+
__typename?: 'Asset';
|
|
97
|
+
assetName?: any | null;
|
|
98
|
+
policyId: any;
|
|
99
|
+
};
|
|
120
100
|
} | null>;
|
|
101
|
+
}>;
|
|
102
|
+
outputs: Array<{
|
|
103
|
+
__typename?: 'TransactionOutput';
|
|
104
|
+
address: string;
|
|
105
|
+
value: any;
|
|
106
|
+
tokens: Array<{
|
|
107
|
+
__typename?: 'Token';
|
|
108
|
+
quantity: string;
|
|
109
|
+
asset: {
|
|
110
|
+
__typename?: 'Asset';
|
|
111
|
+
assetName?: any | null;
|
|
112
|
+
policyId: any;
|
|
113
|
+
};
|
|
114
|
+
}>;
|
|
115
|
+
} | null>;
|
|
116
|
+
metadata?: Array<{
|
|
117
|
+
__typename?: 'TransactionMetadata';
|
|
118
|
+
key: string;
|
|
119
|
+
value: any;
|
|
120
|
+
} | null> | null;
|
|
121
121
|
} | null>;
|
|
122
|
+
} | null>;
|
|
122
123
|
};
|
|
123
|
-
type GraphQLTransaction = NonNullable<
|
|
124
|
+
type GraphQLTransaction = NonNullable<
|
|
125
|
+
NonNullable<GraphQLBlockTxsQuery['blocks'][0]>['transactions'][0]
|
|
126
|
+
>;
|
|
124
127
|
type GraphQLTxOutput = NonNullable<GraphQLTransaction['outputs'][0]>;
|
|
125
|
-
export {
|
|
126
|
-
|
|
128
|
+
export {
|
|
129
|
+
Utxo,
|
|
130
|
+
KoiosTransaction,
|
|
131
|
+
CardanoRosenData,
|
|
132
|
+
CardanoMetadataRosenData,
|
|
133
|
+
Metadata,
|
|
134
|
+
MetadataObject,
|
|
135
|
+
JsonObject,
|
|
136
|
+
ListObject,
|
|
137
|
+
NativeValue,
|
|
138
|
+
CardanoMetadata,
|
|
139
|
+
CardanoTx,
|
|
140
|
+
CardanoBoxCandidate,
|
|
141
|
+
BlockFrostTransaction,
|
|
142
|
+
BlockFrostOutputBox,
|
|
143
|
+
GraphQLTransaction,
|
|
144
|
+
GraphQLTxOutput,
|
|
145
|
+
};
|
|
146
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* @param data
|
|
4
4
|
* @returns Rosen data or undefined if metadata is invalid
|
|
5
5
|
*/
|
|
6
|
-
export declare const parseRosenData: (data: any) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
export declare const parseRosenData: (data: any) =>
|
|
7
|
+
| {
|
|
8
|
+
toChain: any;
|
|
9
|
+
toAddress: any;
|
|
10
|
+
bridgeFee: any;
|
|
11
|
+
networkFee: any;
|
|
12
|
+
fromAddress: any;
|
|
13
|
+
}
|
|
14
|
+
| undefined;
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare const CARDANO_NATIVE_TOKEN =
|
|
2
|
-
export declare const ERGO_NATIVE_TOKEN =
|
|
3
|
-
export declare const BITCOIN_NATIVE_TOKEN =
|
|
4
|
-
export declare const BITCOIN_CHAIN =
|
|
5
|
-
export declare const ETHEREUM_CHAIN =
|
|
6
|
-
export declare const ETHEREUM_NATIVE_TOKEN =
|
|
7
|
-
export declare const CARDANO_CHAIN =
|
|
8
|
-
export declare const ERGO_CHAIN =
|
|
1
|
+
export declare const CARDANO_NATIVE_TOKEN = 'ada';
|
|
2
|
+
export declare const ERGO_NATIVE_TOKEN = 'erg';
|
|
3
|
+
export declare const BITCOIN_NATIVE_TOKEN = 'btc';
|
|
4
|
+
export declare const BITCOIN_CHAIN = 'bitcoin';
|
|
5
|
+
export declare const ETHEREUM_CHAIN = 'ethereum';
|
|
6
|
+
export declare const ETHEREUM_NATIVE_TOKEN = 'eth';
|
|
7
|
+
export declare const CARDANO_CHAIN = 'cardano';
|
|
8
|
+
export declare const ERGO_CHAIN = 'ergo';
|
|
9
9
|
export declare const SUPPORTED_CHAINS: string[];
|
|
10
|
-
//# sourceMappingURL=const.d.ts.map
|
|
10
|
+
//# sourceMappingURL=const.d.ts.map
|
|
@@ -4,19 +4,26 @@ import { NodeOutputBox, NodeTransaction } from './types';
|
|
|
4
4
|
import { RosenTokens } from '@rosen-bridge/tokens';
|
|
5
5
|
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
6
6
|
export declare class ErgoNodeRosenExtractor extends AbstractRosenDataExtractor<NodeTransaction> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
readonly chain = 'ergo';
|
|
8
|
+
lockErgoTree: string;
|
|
9
|
+
constructor(
|
|
10
|
+
lockAddress: string,
|
|
11
|
+
tokens: RosenTokens,
|
|
12
|
+
logger?: AbstractLogger
|
|
13
|
+
);
|
|
14
|
+
/**
|
|
15
|
+
* extracts RosenData from given lock transaction in Node format
|
|
16
|
+
* @param transaction the lock transaction in Node format
|
|
17
|
+
*/
|
|
18
|
+
extractRawData: (transaction: NodeTransaction) => RosenData | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* extracts and builds token transformation from NodeOutputBox and tokenMap
|
|
21
|
+
* @param box transaction output
|
|
22
|
+
* @param toChain event target chain
|
|
23
|
+
*/
|
|
24
|
+
getAssetTransformation: (
|
|
25
|
+
box: NodeOutputBox,
|
|
26
|
+
toChain: string
|
|
27
|
+
) => TokenTransformation | undefined;
|
|
21
28
|
}
|
|
22
|
-
//# sourceMappingURL=ErgoNodeRosenExtractor.d.ts.map
|
|
29
|
+
//# sourceMappingURL=ErgoNodeRosenExtractor.d.ts.map
|
|
@@ -3,13 +3,17 @@ import AbstractRosenDataExtractor from '../abstract/AbstractRosenDataExtractor';
|
|
|
3
3
|
import { RosenTokens } from '@rosen-bridge/tokens';
|
|
4
4
|
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
5
5
|
export declare class ErgoRosenExtractor extends AbstractRosenDataExtractor<string> {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
readonly chain = 'ergo';
|
|
7
|
+
private nodeExtractor;
|
|
8
|
+
constructor(
|
|
9
|
+
lockAddress: string,
|
|
10
|
+
tokens: RosenTokens,
|
|
11
|
+
logger?: AbstractLogger
|
|
12
|
+
);
|
|
13
|
+
/**
|
|
14
|
+
* extracts RosenData from given lock transaction in wasm sigma serialized bytes
|
|
15
|
+
* @param serializedTransaction the sigma serialized bytes of transaction
|
|
16
|
+
*/
|
|
17
|
+
extractRawData: (serializedTransaction: string) => RosenData | undefined;
|
|
14
18
|
}
|
|
15
|
-
//# sourceMappingURL=ErgoRosenExtractor.d.ts.map
|
|
19
|
+
//# sourceMappingURL=ErgoRosenExtractor.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
|
|
@@ -5,13 +5,19 @@ import { RosenTokens } from '@rosen-bridge/tokens';
|
|
|
5
5
|
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
6
6
|
import { EvmRpcRosenExtractor } from './EvmRpcRosenExtractor';
|
|
7
7
|
export declare class EvmEthersRosenExtractor extends AbstractRosenDataExtractor<TransactionResponse> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
readonly chain: string;
|
|
9
|
+
protected rpcExtractor: EvmRpcRosenExtractor;
|
|
10
|
+
constructor(
|
|
11
|
+
lockAddress: string,
|
|
12
|
+
tokens: RosenTokens,
|
|
13
|
+
chain: string,
|
|
14
|
+
nativeToken: string,
|
|
15
|
+
logger?: AbstractLogger
|
|
16
|
+
);
|
|
17
|
+
/**
|
|
18
|
+
* extracts RosenData from given lock transaction in ethers TransactionResponse format
|
|
19
|
+
* @param txRes the lock transaction in ethers TransactionResponse format
|
|
20
|
+
*/
|
|
21
|
+
extractRawData: (txRes: TransactionResponse) => RosenData | undefined;
|
|
16
22
|
}
|
|
17
|
-
//# sourceMappingURL=EvmEthersRosenExtractor.d.ts.map
|
|
23
|
+
//# sourceMappingURL=EvmEthersRosenExtractor.d.ts.map
|
|
@@ -4,13 +4,19 @@ import { RosenTokens } from '@rosen-bridge/tokens';
|
|
|
4
4
|
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
5
5
|
import { EvmRpcRosenExtractor } from './EvmRpcRosenExtractor';
|
|
6
6
|
export declare class EvmRosenExtractor extends AbstractRosenDataExtractor<string> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
readonly chain: string;
|
|
8
|
+
protected rpcExtractor: EvmRpcRosenExtractor;
|
|
9
|
+
constructor(
|
|
10
|
+
lockAddress: string,
|
|
11
|
+
tokens: RosenTokens,
|
|
12
|
+
chain: string,
|
|
13
|
+
nativeToken: string,
|
|
14
|
+
logger?: AbstractLogger
|
|
15
|
+
);
|
|
16
|
+
/**
|
|
17
|
+
* extracts RosenData from given lock transaction in ethers Transaction format
|
|
18
|
+
* @param serializedTransaction signed serialized transaction in ethers Transaction format
|
|
19
|
+
*/
|
|
20
|
+
extractRawData: (serializedTransaction: string) => RosenData | undefined;
|
|
15
21
|
}
|
|
16
|
-
//# sourceMappingURL=EvmRosenExtractor.d.ts.map
|
|
22
|
+
//# sourceMappingURL=EvmRosenExtractor.d.ts.map
|
|
@@ -4,23 +4,29 @@ import { Transaction } from 'ethers';
|
|
|
4
4
|
import { RosenTokens } from '@rosen-bridge/tokens';
|
|
5
5
|
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
6
6
|
export declare class EvmRpcRosenExtractor extends AbstractRosenDataExtractor<Transaction> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
readonly chain: string;
|
|
8
|
+
protected nativeToken: string;
|
|
9
|
+
constructor(
|
|
10
|
+
lockAddress: string,
|
|
11
|
+
tokens: RosenTokens,
|
|
12
|
+
chain: string,
|
|
13
|
+
nativeToken: string,
|
|
14
|
+
logger?: AbstractLogger
|
|
15
|
+
);
|
|
16
|
+
/**
|
|
17
|
+
* extracts RosenData from given lock transaction in ethers Transaction object
|
|
18
|
+
* checks:
|
|
19
|
+
* Native token transfer:
|
|
20
|
+
* 1. `to` must be the lock address
|
|
21
|
+
* 2. the entire calldata must represent a valid CallDataRosenData
|
|
22
|
+
* ERC20 transfer:
|
|
23
|
+
* 1. `to` address is one of the supported assets
|
|
24
|
+
* 2. first four bytes of the call data indicate `transfer` function call: a9059cbb
|
|
25
|
+
* 3. bytes from 5 to 37 must be the lock address
|
|
26
|
+
* 4. bytes from 37 to 69 show the amount
|
|
27
|
+
* 5. bytes after 69 must represent a valid CallDataRosenData
|
|
28
|
+
* @param transaction the lock transaction in ethers Transaction object
|
|
29
|
+
*/
|
|
30
|
+
extractRawData: (transaction: Transaction) => RosenData | undefined;
|
|
25
31
|
}
|
|
26
|
-
//# sourceMappingURL=EvmRpcRosenExtractor.d.ts.map
|
|
32
|
+
//# sourceMappingURL=EvmRpcRosenExtractor.d.ts.map
|
|
@@ -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
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ export { CardanoGraphQLRosenExtractor } from './getRosenData/cardano/CardanoGrap
|
|
|
13
13
|
export { ErgoRosenExtractor } from './getRosenData/ergo/ErgoRosenExtractor';
|
|
14
14
|
export { ErgoNodeRosenExtractor } from './getRosenData/ergo/ErgoNodeRosenExtractor';
|
|
15
15
|
export { RosenData } from './getRosenData/abstract/types';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|