@rosen-bridge/rosen-extractor 3.3.0 → 3.5.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/lib/getRosenData/abstract/AbstractRosenDataExtractor.d.ts +13 -9
- package/dist/lib/getRosenData/abstract/types.d.ts +13 -13
- package/dist/lib/getRosenData/bitcoin/BitcoinEsploraRosenExtractor.d.ts +22 -20
- package/dist/lib/getRosenData/bitcoin/BitcoinEsploraRosenExtractor.d.ts.map +1 -1
- package/dist/lib/getRosenData/bitcoin/BitcoinEsploraRosenExtractor.js +4 -42
- package/dist/lib/getRosenData/bitcoin/BitcoinRosenExtractor.d.ts +28 -0
- package/dist/lib/getRosenData/bitcoin/BitcoinRosenExtractor.d.ts.map +1 -0
- package/dist/lib/getRosenData/bitcoin/BitcoinRosenExtractor.js +94 -0
- package/dist/lib/getRosenData/bitcoin/types.d.ts +48 -34
- package/dist/lib/getRosenData/bitcoin/types.d.ts.map +1 -1
- package/dist/lib/getRosenData/bitcoin/types.js +1 -1
- package/dist/lib/getRosenData/bitcoin/utils.d.ts +7 -0
- package/dist/lib/getRosenData/bitcoin/utils.d.ts.map +1 -0
- package/dist/lib/getRosenData/bitcoin/utils.js +41 -0
- package/dist/lib/getRosenData/cardano/CardanoBlockFrostRosenExtractor.d.ts +15 -12
- package/dist/lib/getRosenData/cardano/CardanoGraphQLRosenExtractor.d.ts +15 -12
- package/dist/lib/getRosenData/cardano/CardanoKoiosRosenExtractor.d.ts +15 -12
- package/dist/lib/getRosenData/cardano/CardanoOgmiosRosenExtractor.d.ts +15 -12
- package/dist/lib/getRosenData/cardano/CardanoRosenExtractor.d.ts +15 -12
- package/dist/lib/getRosenData/cardano/types.d.ts +110 -90
- package/dist/lib/getRosenData/const.d.ts +2 -0
- package/dist/lib/getRosenData/const.d.ts.map +1 -1
- package/dist/lib/getRosenData/const.js +9 -2
- package/dist/lib/getRosenData/ergo/ErgoNodeRosenExtractor.d.ts +21 -14
- package/dist/lib/getRosenData/ergo/ErgoRosenExtractor.d.ts +12 -8
- package/dist/lib/getRosenData/ergo/types.d.ts +24 -24
- package/dist/lib/getRosenData/evm/EvmRpcRosenExtractor.d.ts +26 -0
- package/dist/lib/getRosenData/evm/EvmRpcRosenExtractor.d.ts.map +1 -0
- package/dist/lib/getRosenData/evm/EvmRpcRosenExtractor.js +118 -0
- package/dist/lib/getRosenData/evm/utils.d.ts +13 -0
- package/dist/lib/getRosenData/evm/utils.d.ts.map +1 -0
- package/dist/lib/getRosenData/evm/utils.js +31 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
|
@@ -2,16 +2,19 @@ import { RosenData, TokenTransformation } from '../abstract/types';
|
|
|
2
2
|
import AbstractRosenDataExtractor from '../abstract/AbstractRosenDataExtractor';
|
|
3
3
|
import { KoiosTransaction, Utxo } from './types';
|
|
4
4
|
export declare class CardanoKoiosRosenExtractor extends AbstractRosenDataExtractor<KoiosTransaction> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
/**
|
|
6
|
+
* extracts RosenData from given lock transaction in Koios format
|
|
7
|
+
* @param transaction the lock transaction in Koios format
|
|
8
|
+
*/
|
|
9
|
+
get: (transaction: KoiosTransaction) => RosenData | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* extracts and builds token transformation from UTXO and tokenMap
|
|
12
|
+
* @param box transaction output
|
|
13
|
+
* @param toChain event target chain
|
|
14
|
+
*/
|
|
15
|
+
getAssetTransformation: (
|
|
16
|
+
box: Utxo,
|
|
17
|
+
toChain: string
|
|
18
|
+
) => TokenTransformation | undefined;
|
|
16
19
|
}
|
|
17
|
-
//# sourceMappingURL=CardanoKoiosRosenExtractor.d.ts.map
|
|
20
|
+
//# sourceMappingURL=CardanoKoiosRosenExtractor.d.ts.map
|
|
@@ -2,16 +2,19 @@ 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
|
-
|
|
5
|
+
/**
|
|
6
|
+
* extracts RosenData from given lock transaction in Ogmios format
|
|
7
|
+
* @param transaction the lock transaction in Koios format
|
|
8
|
+
*/
|
|
9
|
+
get: (transaction: Transaction) => RosenData | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* extracts and builds token transformation from TxOut and tokenMap
|
|
12
|
+
* @param box transaction output
|
|
13
|
+
* @param toChain event target chain
|
|
14
|
+
*/
|
|
15
|
+
getAssetTransformation: (
|
|
16
|
+
box: TransactionOutput,
|
|
17
|
+
toChain: string
|
|
18
|
+
) => TokenTransformation | undefined;
|
|
16
19
|
}
|
|
17
|
-
//# sourceMappingURL=CardanoOgmiosRosenExtractor.d.ts.map
|
|
20
|
+
//# sourceMappingURL=CardanoOgmiosRosenExtractor.d.ts.map
|
|
@@ -2,16 +2,19 @@ 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
|
-
|
|
5
|
+
/**
|
|
6
|
+
* extracts RosenData from given lock transaction in CardanoTx format
|
|
7
|
+
* @param serializedTransaction stringified transaction in CardanoTx format
|
|
8
|
+
*/
|
|
9
|
+
get: (serializedTransaction: string) => RosenData | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* extracts and builds token transformation from CardanoBoxCandidate and tokenMap
|
|
12
|
+
* @param box transaction output in CardanoBoxCandidate format
|
|
13
|
+
* @param toChain event target chain
|
|
14
|
+
*/
|
|
15
|
+
getAssetTransformation: (
|
|
16
|
+
box: CardanoBoxCandidate,
|
|
17
|
+
toChain: string
|
|
18
|
+
) => TokenTransformation | undefined;
|
|
16
19
|
}
|
|
17
|
-
//# sourceMappingURL=CardanoRosenExtractor.d.ts.map
|
|
20
|
+
//# 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
|
|
@@ -2,6 +2,8 @@ export declare const CARDANO_NATIVE_TOKEN = "ada";
|
|
|
2
2
|
export declare const ERGO_NATIVE_TOKEN = "erg";
|
|
3
3
|
export declare const BITCOIN_NATIVE_TOKEN = "btc";
|
|
4
4
|
export declare const BITCOIN_CHAIN = "bitcoin";
|
|
5
|
+
export declare const ETHEREUM_CHAIN = "ethereum";
|
|
6
|
+
export declare const ETHEREUM_NATIVE_TOKEN = "eth";
|
|
5
7
|
export declare const CARDANO_CHAIN = "cardano";
|
|
6
8
|
export declare const ERGO_CHAIN = "ergo";
|
|
7
9
|
export declare const SUPPORTED_CHAINS: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../lib/getRosenData/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAC1C,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAC1C,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,UAAU,SAAS,CAAC;AACjC,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../lib/getRosenData/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAC1C,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAC1C,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAC3C,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,UAAU,SAAS,CAAC;AACjC,eAAO,MAAM,gBAAgB,UAK5B,CAAC"}
|
|
@@ -2,7 +2,14 @@ export const CARDANO_NATIVE_TOKEN = 'ada';
|
|
|
2
2
|
export const ERGO_NATIVE_TOKEN = 'erg';
|
|
3
3
|
export const BITCOIN_NATIVE_TOKEN = 'btc';
|
|
4
4
|
export const BITCOIN_CHAIN = 'bitcoin';
|
|
5
|
+
export const ETHEREUM_CHAIN = 'ethereum';
|
|
6
|
+
export const ETHEREUM_NATIVE_TOKEN = 'eth';
|
|
5
7
|
export const CARDANO_CHAIN = 'cardano';
|
|
6
8
|
export const ERGO_CHAIN = 'ergo';
|
|
7
|
-
export const SUPPORTED_CHAINS = [
|
|
8
|
-
|
|
9
|
+
export const SUPPORTED_CHAINS = [
|
|
10
|
+
ERGO_CHAIN,
|
|
11
|
+
CARDANO_CHAIN,
|
|
12
|
+
BITCOIN_CHAIN,
|
|
13
|
+
ETHEREUM_CHAIN,
|
|
14
|
+
];
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9saWIvZ2V0Um9zZW5EYXRhL2NvbnN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxNQUFNLG9CQUFvQixHQUFHLEtBQUssQ0FBQztBQUMxQyxNQUFNLENBQUMsTUFBTSxpQkFBaUIsR0FBRyxLQUFLLENBQUM7QUFDdkMsTUFBTSxDQUFDLE1BQU0sb0JBQW9CLEdBQUcsS0FBSyxDQUFDO0FBQzFDLE1BQU0sQ0FBQyxNQUFNLGFBQWEsR0FBRyxTQUFTLENBQUM7QUFDdkMsTUFBTSxDQUFDLE1BQU0sY0FBYyxHQUFHLFVBQVUsQ0FBQztBQUN6QyxNQUFNLENBQUMsTUFBTSxxQkFBcUIsR0FBRyxLQUFLLENBQUM7QUFDM0MsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLFNBQVMsQ0FBQztBQUN2QyxNQUFNLENBQUMsTUFBTSxVQUFVLEdBQUcsTUFBTSxDQUFDO0FBQ2pDLE1BQU0sQ0FBQyxNQUFNLGdCQUFnQixHQUFHO0lBQzlCLFVBQVU7SUFDVixhQUFhO0lBQ2IsYUFBYTtJQUNiLGNBQWM7Q0FDZixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IENBUkRBTk9fTkFUSVZFX1RPS0VOID0gJ2FkYSc7XG5leHBvcnQgY29uc3QgRVJHT19OQVRJVkVfVE9LRU4gPSAnZXJnJztcbmV4cG9ydCBjb25zdCBCSVRDT0lOX05BVElWRV9UT0tFTiA9ICdidGMnO1xuZXhwb3J0IGNvbnN0IEJJVENPSU5fQ0hBSU4gPSAnYml0Y29pbic7XG5leHBvcnQgY29uc3QgRVRIRVJFVU1fQ0hBSU4gPSAnZXRoZXJldW0nO1xuZXhwb3J0IGNvbnN0IEVUSEVSRVVNX05BVElWRV9UT0tFTiA9ICdldGgnO1xuZXhwb3J0IGNvbnN0IENBUkRBTk9fQ0hBSU4gPSAnY2FyZGFubyc7XG5leHBvcnQgY29uc3QgRVJHT19DSEFJTiA9ICdlcmdvJztcbmV4cG9ydCBjb25zdCBTVVBQT1JURURfQ0hBSU5TID0gW1xuICBFUkdPX0NIQUlOLFxuICBDQVJEQU5PX0NIQUlOLFxuICBCSVRDT0lOX0NIQUlOLFxuICBFVEhFUkVVTV9DSEFJTixcbl07XG4iXX0=
|
|
@@ -4,18 +4,25 @@ 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
|
-
|
|
7
|
+
lockErgoTree: string;
|
|
8
|
+
constructor(
|
|
9
|
+
lockAddress: string,
|
|
10
|
+
tokens: RosenTokens,
|
|
11
|
+
logger?: AbstractLogger
|
|
12
|
+
);
|
|
13
|
+
/**
|
|
14
|
+
* extracts RosenData from given lock transaction in Node format
|
|
15
|
+
* @param transaction the lock transaction in Node format
|
|
16
|
+
*/
|
|
17
|
+
get: (transaction: NodeTransaction) => RosenData | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* extracts and builds token transformation from NodeOutputBox and tokenMap
|
|
20
|
+
* @param box transaction output
|
|
21
|
+
* @param toChain event target chain
|
|
22
|
+
*/
|
|
23
|
+
getAssetTransformation: (
|
|
24
|
+
box: NodeOutputBox,
|
|
25
|
+
toChain: string
|
|
26
|
+
) => TokenTransformation | undefined;
|
|
20
27
|
}
|
|
21
|
-
//# sourceMappingURL=ErgoNodeRosenExtractor.d.ts.map
|
|
28
|
+
//# sourceMappingURL=ErgoNodeRosenExtractor.d.ts.map
|
|
@@ -3,12 +3,16 @@ 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
|
-
|
|
6
|
+
private nodeExtractor;
|
|
7
|
+
constructor(
|
|
8
|
+
lockAddress: string,
|
|
9
|
+
tokens: RosenTokens,
|
|
10
|
+
logger?: AbstractLogger
|
|
11
|
+
);
|
|
12
|
+
/**
|
|
13
|
+
* extracts RosenData from given lock transaction in wasm sigma serialized bytes
|
|
14
|
+
* @param serializedTransaction the sigma serialized bytes of transaction
|
|
15
|
+
*/
|
|
16
|
+
get: (serializedTransaction: string) => RosenData | undefined;
|
|
13
17
|
}
|
|
14
|
-
//# sourceMappingURL=ErgoRosenExtractor.d.ts.map
|
|
18
|
+
//# 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
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RosenData } from '../abstract/types';
|
|
2
|
+
import AbstractRosenDataExtractor from '../abstract/AbstractRosenDataExtractor';
|
|
3
|
+
import { TransactionResponse } from 'ethers';
|
|
4
|
+
import { RosenTokens } from '@rosen-bridge/tokens';
|
|
5
|
+
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
6
|
+
export declare class EvmRpcRosenExtractor extends AbstractRosenDataExtractor<TransactionResponse> {
|
|
7
|
+
protected chain: string;
|
|
8
|
+
protected nativeToken: string;
|
|
9
|
+
constructor(lockAddress: string, tokens: RosenTokens, chain: string, nativeToken: string, logger?: AbstractLogger);
|
|
10
|
+
/**
|
|
11
|
+
* extracts RosenData from given lock transaction in RPC format
|
|
12
|
+
* cheks:
|
|
13
|
+
* Native token transfer:
|
|
14
|
+
* 1. `to` must be the lock address
|
|
15
|
+
* 2. the entire calldata must represent a valid CallDataRosenData
|
|
16
|
+
* ERC20 transfer:
|
|
17
|
+
* 1. `to` address is one of the supported assets
|
|
18
|
+
* 2. first four bytes of the call data indicate `transfer` function call: a9059cbb
|
|
19
|
+
* 3. bytes from 5 to 37 must be the lock address
|
|
20
|
+
* 4. bytes from 37 to 69 show the amount
|
|
21
|
+
* 5. bytes after 69 must represnt a valid CallDataRosenData
|
|
22
|
+
* @param transaction the lock transaction in RPC format
|
|
23
|
+
*/
|
|
24
|
+
get: (transaction: TransactionResponse) => RosenData | undefined;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=EvmRpcRosenExtractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmRpcRosenExtractor.d.ts","sourceRoot":"","sources":["../../../../lib/getRosenData/evm/EvmRpcRosenExtractor.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;AAC7C,OAAO,EAAE,WAAW,EAAmB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,qBAAa,oBAAqB,SAAQ,0BAA0B,CAAC,mBAAmB,CAAC;IACvF,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;gBAG5B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,cAAc;IAOzB;;;;;;;;;;;;;OAaG;IACH,GAAG,gBAAiB,mBAAmB,KAAG,SAAS,GAAG,SAAS,CAwG7D;CACH"}
|