@rosen-bridge/rosen-extractor 3.4.0 → 4.0.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 +21 -14
- package/dist/lib/getRosenData/bitcoin/BitcoinRosenExtractor.d.ts +21 -14
- package/dist/lib/getRosenData/bitcoin/types.d.ts +42 -42
- package/dist/lib/getRosenData/bitcoin/utils.d.ts +1 -1
- 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/EvmRosenExtractor.d.ts +16 -0
- package/dist/lib/getRosenData/evm/EvmRosenExtractor.d.ts.map +1 -0
- package/dist/lib/getRosenData/evm/EvmRosenExtractor.js +31 -0
- 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 +123 -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 +3 -2
|
@@ -2,13 +2,17 @@ import { RosenTokens, TokenMap } from '@rosen-bridge/tokens';
|
|
|
2
2
|
import { RosenData } from './types';
|
|
3
3
|
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
4
4
|
export default abstract class AbstractRosenDataExtractor<TransactionType> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
protected readonly logger: AbstractLogger;
|
|
6
|
+
protected readonly tokens: TokenMap;
|
|
7
|
+
protected readonly lockAddress: string;
|
|
8
|
+
constructor(
|
|
9
|
+
lockAddress: string,
|
|
10
|
+
tokens: RosenTokens,
|
|
11
|
+
logger?: AbstractLogger
|
|
12
|
+
);
|
|
13
|
+
/**
|
|
14
|
+
* extracts RosenData from given lock transaction
|
|
15
|
+
*/
|
|
16
|
+
abstract get: (transaction: TransactionType) => RosenData | undefined;
|
|
13
17
|
}
|
|
14
|
-
//# sourceMappingURL=AbstractRosenDataExtractor.d.ts.map
|
|
18
|
+
//# sourceMappingURL=AbstractRosenDataExtractor.d.ts.map
|
|
@@ -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
|
|
@@ -4,18 +4,25 @@ import { BitcoinEsploraTransaction, EsploraTxOutput } from './types';
|
|
|
4
4
|
import { RosenTokens } from '@rosen-bridge/tokens';
|
|
5
5
|
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
6
6
|
export declare class BitcoinEsploraRosenExtractor extends AbstractRosenDataExtractor<BitcoinEsploraTransaction> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
protected lockScriptPubKey: string;
|
|
8
|
+
constructor(
|
|
9
|
+
lockAddress: string,
|
|
10
|
+
tokens: RosenTokens,
|
|
11
|
+
logger?: AbstractLogger
|
|
12
|
+
);
|
|
13
|
+
/**
|
|
14
|
+
* extracts RosenData from given lock transaction in Esplora format
|
|
15
|
+
* @param transaction the lock transaction in Esplora format
|
|
16
|
+
*/
|
|
17
|
+
get: (transaction: BitcoinEsploraTransaction) => RosenData | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* extracts and builds token transformation from UTXO and tokenMap
|
|
20
|
+
* @param box transaction output
|
|
21
|
+
* @param toChain event target chain
|
|
22
|
+
*/
|
|
23
|
+
getAssetTransformation: (
|
|
24
|
+
box: EsploraTxOutput,
|
|
25
|
+
toChain: string
|
|
26
|
+
) => TokenTransformation | undefined;
|
|
20
27
|
}
|
|
21
|
-
//# sourceMappingURL=BitcoinEsploraRosenExtractor.d.ts.map
|
|
28
|
+
//# sourceMappingURL=BitcoinEsploraRosenExtractor.d.ts.map
|
|
@@ -4,18 +4,25 @@ import { BitcoinTxOutput } from './types';
|
|
|
4
4
|
import { RosenTokens } from '@rosen-bridge/tokens';
|
|
5
5
|
import { AbstractLogger } from '@rosen-bridge/abstract-logger';
|
|
6
6
|
export declare class BitcoinRosenExtractor extends AbstractRosenDataExtractor<string> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
protected lockScriptPubKey: string;
|
|
8
|
+
constructor(
|
|
9
|
+
lockAddress: string,
|
|
10
|
+
tokens: RosenTokens,
|
|
11
|
+
logger?: AbstractLogger
|
|
12
|
+
);
|
|
13
|
+
/**
|
|
14
|
+
* extracts RosenData from given lock transaction in BitcoinTx format
|
|
15
|
+
* @param serializedTransaction stringified transaction in BitcoinTx format
|
|
16
|
+
*/
|
|
17
|
+
get: (serializedTransaction: string) => RosenData | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* extracts and builds token transformation from UTXO and tokenMap
|
|
20
|
+
* @param box transaction output
|
|
21
|
+
* @param toChain event target chain
|
|
22
|
+
*/
|
|
23
|
+
getAssetTransformation: (
|
|
24
|
+
box: BitcoinTxOutput,
|
|
25
|
+
toChain: string
|
|
26
|
+
) => TokenTransformation | undefined;
|
|
20
27
|
}
|
|
21
|
-
//# sourceMappingURL=BitcoinRosenExtractor.d.ts.map
|
|
28
|
+
//# sourceMappingURL=BitcoinRosenExtractor.d.ts.map
|
|
@@ -1,59 +1,59 @@
|
|
|
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
|
-
|
|
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 {
|
|
8
|
+
txid: string;
|
|
9
|
+
vout: number;
|
|
10
|
+
prevout: {
|
|
23
11
|
scriptpubkey: string;
|
|
24
12
|
scriptpubkey_asm: string;
|
|
25
13
|
scriptpubkey_type: string;
|
|
26
14
|
scriptpubkey_address: string;
|
|
27
15
|
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
|
-
//# sourceMappingURL=types.d.ts.map
|
|
59
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -2,16 +2,19 @@ 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
|
-
|
|
5
|
+
/**
|
|
6
|
+
* extracts RosenData from given lock transaction in blockfrost format
|
|
7
|
+
* @param transaction the lock transaction in blockfrost format
|
|
8
|
+
*/
|
|
9
|
+
get: (transaction: BlockFrostTransaction) => 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: BlockFrostOutputBox,
|
|
17
|
+
toChain: string
|
|
18
|
+
) => TokenTransformation | undefined;
|
|
16
19
|
}
|
|
17
|
-
//# sourceMappingURL=CardanoBlockFrostRosenExtractor.d.ts.map
|
|
20
|
+
//# sourceMappingURL=CardanoBlockFrostRosenExtractor.d.ts.map
|
|
@@ -2,16 +2,19 @@ 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
|
-
|
|
5
|
+
/**
|
|
6
|
+
* extracts RosenData from given lock transaction in graphql format
|
|
7
|
+
* @param transaction the lock transaction in graphql format
|
|
8
|
+
*/
|
|
9
|
+
get: (transaction: GraphQLTransaction) => 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: GraphQLTxOutput,
|
|
17
|
+
toChain: string
|
|
18
|
+
) => TokenTransformation | undefined;
|
|
16
19
|
}
|
|
17
|
-
//# sourceMappingURL=CardanoGraphQLRosenExtractor.d.ts.map
|
|
20
|
+
//# sourceMappingURL=CardanoGraphQLRosenExtractor.d.ts.map
|
|
@@ -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
|