@bitgo-beta/sdk-coin-flrp 1.0.1-beta.266 → 1.0.1-beta.267
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/src/flrp.d.ts +6 -75
- package/dist/src/flrp.d.ts.map +1 -1
- package/dist/src/flrp.js +13 -298
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -2
- package/dist/src/lib/ExportInCTxBuilder.d.ts +50 -0
- package/dist/src/lib/ExportInCTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/ExportInCTxBuilder.js +163 -0
- package/dist/src/lib/ExportInPTxBuilder.d.ts +36 -0
- package/dist/src/lib/ExportInPTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/ExportInPTxBuilder.js +128 -0
- package/dist/src/lib/ImportInCTxBuilder.d.ts +47 -0
- package/dist/src/lib/ImportInCTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/ImportInCTxBuilder.js +213 -0
- package/dist/src/lib/ImportInPTxBuilder.d.ts +23 -0
- package/dist/src/lib/ImportInPTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/ImportInPTxBuilder.js +101 -0
- package/dist/src/lib/atomicInCTransactionBuilder.d.ts +18 -16
- package/dist/src/lib/atomicInCTransactionBuilder.d.ts.map +1 -1
- package/dist/src/lib/atomicInCTransactionBuilder.js +38 -36
- package/dist/src/lib/atomicTransactionBuilder.d.ts +34 -84
- package/dist/src/lib/atomicTransactionBuilder.d.ts.map +1 -1
- package/dist/src/lib/atomicTransactionBuilder.js +119 -288
- package/dist/src/lib/iface.d.ts +50 -51
- package/dist/src/lib/iface.d.ts.map +1 -1
- package/dist/src/lib/iface.js +22 -10
- package/dist/src/lib/index.d.ts +2 -3
- package/dist/src/lib/index.d.ts.map +1 -1
- package/dist/src/lib/index.js +5 -6
- package/dist/src/lib/keyPair.d.ts +1 -1
- package/dist/src/lib/keyPair.d.ts.map +1 -1
- package/dist/src/lib/keyPair.js +9 -5
- package/dist/src/lib/permissionlessValidatorTxBuilder.d.ts +32 -67
- package/dist/src/lib/permissionlessValidatorTxBuilder.d.ts.map +1 -1
- package/dist/src/lib/permissionlessValidatorTxBuilder.js +91 -205
- package/dist/src/lib/transaction.d.ts +8 -74
- package/dist/src/lib/transaction.d.ts.map +1 -1
- package/dist/src/lib/transaction.js +61 -210
- package/dist/src/lib/transactionBuilder.d.ts +56 -34
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilder.js +112 -69
- package/dist/src/lib/transactionBuilderFactory.d.ts +27 -30
- package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilderFactory.js +69 -75
- package/dist/src/lib/utils.d.ts +58 -157
- package/dist/src/lib/utils.d.ts.map +1 -1
- package/dist/src/lib/utils.js +134 -399
- package/dist/test/resources/transactionData/exportInC.d.ts +20 -0
- package/dist/test/resources/transactionData/exportInC.d.ts.map +1 -0
- package/dist/test/resources/transactionData/exportInC.js +30 -0
- package/dist/test/unit/lib/exportInCTxBuilder.js +92 -513
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -11
- package/dist/src/iface.d.ts +0 -25
- package/dist/src/iface.d.ts.map +0 -1
- package/dist/src/iface.js +0 -3
- package/dist/src/lib/constants.d.ts +0 -170
- package/dist/src/lib/constants.d.ts.map +0 -1
- package/dist/src/lib/constants.js +0 -227
- package/dist/src/lib/delegatorTxBuilder.d.ts +0 -58
- package/dist/src/lib/delegatorTxBuilder.d.ts.map +0 -1
- package/dist/src/lib/delegatorTxBuilder.js +0 -224
- package/dist/src/lib/errors.d.ts +0 -8
- package/dist/src/lib/errors.d.ts.map +0 -1
- package/dist/src/lib/errors.js +0 -19
- package/dist/src/lib/exportInCTxBuilder.d.ts +0 -77
- package/dist/src/lib/exportInCTxBuilder.d.ts.map +0 -1
- package/dist/src/lib/exportInCTxBuilder.js +0 -199
- package/dist/src/lib/exportInPTxBuilder.d.ts +0 -30
- package/dist/src/lib/exportInPTxBuilder.d.ts.map +0 -1
- package/dist/src/lib/exportInPTxBuilder.js +0 -120
- package/dist/src/lib/importInCTxBuilder.d.ts +0 -67
- package/dist/src/lib/importInCTxBuilder.d.ts.map +0 -1
- package/dist/src/lib/importInCTxBuilder.js +0 -403
- package/dist/src/lib/importInPTxBuilder.d.ts +0 -73
- package/dist/src/lib/importInPTxBuilder.d.ts.map +0 -1
- package/dist/src/lib/importInPTxBuilder.js +0 -464
- package/dist/src/lib/types.d.ts +0 -78
- package/dist/src/lib/types.d.ts.map +0 -1
- package/dist/src/lib/types.js +0 -5
- package/dist/src/lib/validatorTxBuilder.d.ts +0 -40
- package/dist/src/lib/validatorTxBuilder.d.ts.map +0 -1
- package/dist/src/lib/validatorTxBuilder.js +0 -180
- package/dist/test/unit/delegatorTxBuilder.test.d.ts +0 -2
- package/dist/test/unit/delegatorTxBuilder.test.d.ts.map +0 -1
- package/dist/test/unit/delegatorTxBuilder.test.js +0 -233
- package/dist/test/unit/flrp.d.ts +0 -2
- package/dist/test/unit/flrp.d.ts.map +0 -1
- package/dist/test/unit/flrp.js +0 -118
- package/dist/test/unit/lib/atomicTransactionBuilder.d.ts +0 -2
- package/dist/test/unit/lib/atomicTransactionBuilder.d.ts.map +0 -1
- package/dist/test/unit/lib/atomicTransactionBuilder.js +0 -222
- package/dist/test/unit/lib/exportInPTxBuilder.d.ts +0 -2
- package/dist/test/unit/lib/exportInPTxBuilder.d.ts.map +0 -1
- package/dist/test/unit/lib/exportInPTxBuilder.js +0 -377
- package/dist/test/unit/lib/importInCTxBuilder.d.ts +0 -2
- package/dist/test/unit/lib/importInCTxBuilder.d.ts.map +0 -1
- package/dist/test/unit/lib/importInCTxBuilder.js +0 -258
- package/dist/test/unit/lib/importInPTxBuilder.d.ts +0 -2
- package/dist/test/unit/lib/importInPTxBuilder.d.ts.map +0 -1
- package/dist/test/unit/lib/importInPTxBuilder.js +0 -501
- package/dist/test/unit/lib/transaction.d.ts +0 -2
- package/dist/test/unit/lib/transaction.d.ts.map +0 -1
- package/dist/test/unit/lib/transaction.js +0 -460
- package/dist/test/unit/lib/utils.d.ts +0 -2
- package/dist/test/unit/lib/utils.d.ts.map +0 -1
- package/dist/test/unit/lib/utils.js +0 -365
- package/dist/test/unit/permissionlessValidatorTxBuilder.test.d.ts +0 -2
- package/dist/test/unit/permissionlessValidatorTxBuilder.test.d.ts.map +0 -1
- package/dist/test/unit/permissionlessValidatorTxBuilder.test.js +0 -271
- package/dist/test/unit/smoke.d.ts +0 -2
- package/dist/test/unit/smoke.d.ts.map +0 -1
- package/dist/test/unit/smoke.js +0 -23
- package/dist/test/unit/transactionBuilder.test.d.ts +0 -2
- package/dist/test/unit/transactionBuilder.test.d.ts.map +0 -1
- package/dist/test/unit/transactionBuilder.test.js +0 -114
- package/dist/test/unit/validatorTxBuilder.test.d.ts +0 -2
- package/dist/test/unit/validatorTxBuilder.test.d.ts.map +0 -1
- package/dist/test/unit/validatorTxBuilder.test.js +0 -293
|
@@ -1,96 +1,46 @@
|
|
|
1
1
|
import { BaseCoin as CoinConfig } from '@bitgo-beta/statics';
|
|
2
|
-
import { TransactionType
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_locktime: bigint;
|
|
22
|
-
_threshold: number;
|
|
23
|
-
_fee: {
|
|
24
|
-
fee: string;
|
|
25
|
-
feeRate?: string;
|
|
26
|
-
size?: number;
|
|
27
|
-
};
|
|
28
|
-
hasCredentials: boolean;
|
|
29
|
-
_tx?: unknown;
|
|
30
|
-
_signature?: unknown;
|
|
31
|
-
setTransaction: (tx: unknown) => void;
|
|
32
|
-
};
|
|
33
|
-
constructor(coinConfig: Readonly<CoinConfig>);
|
|
34
|
-
protected abstract get transactionType(): TransactionType;
|
|
35
|
-
/**
|
|
36
|
-
* Get the asset ID for Flare network transactions
|
|
37
|
-
* @returns Buffer containing the asset ID
|
|
38
|
-
*/
|
|
39
|
-
protected getAssetId(): Buffer;
|
|
40
|
-
validateAmount(amount: bigint): void;
|
|
41
|
-
/**
|
|
42
|
-
* Validates that credentials array is properly formed
|
|
43
|
-
* @param credentials - Array of credentials to validate
|
|
44
|
-
*/
|
|
45
|
-
protected validateCredentials(credentials: Credential[]): void;
|
|
46
|
-
/**
|
|
47
|
-
* Creates inputs, outputs, and credentials for Flare P-chain atomic transactions.
|
|
48
|
-
* Based on AVAX P-chain implementation adapted for FlareJS.
|
|
49
|
-
*
|
|
50
|
-
* Note: This is a simplified implementation that creates the core structure.
|
|
51
|
-
* The FlareJS type system integration will be refined in future iterations.
|
|
52
|
-
*
|
|
53
|
-
* @param total - Total amount needed including fees
|
|
54
|
-
* @returns Object containing TransferableInput[], TransferableOutput[], and Credential[]
|
|
55
|
-
*/
|
|
56
|
-
protected createInputOutput(total: bigint): {
|
|
2
|
+
import { TransactionType } from '@bitgo-beta/sdk-core';
|
|
3
|
+
import { TransactionBuilder } from './transactionBuilder';
|
|
4
|
+
import { Transaction } from './transaction';
|
|
5
|
+
import { TransferableInput } from '@flarenetwork/flarejs';
|
|
6
|
+
export declare abstract class AtomicTransactionBuilder extends TransactionBuilder {
|
|
7
|
+
protected _externalChainId: Buffer;
|
|
8
|
+
protected recoverSigner: boolean;
|
|
9
|
+
constructor(_coinConfig: Readonly<CoinConfig>);
|
|
10
|
+
/**
|
|
11
|
+
* Create inputs and outputs from UTXOs
|
|
12
|
+
* @param {bigint} amount Amount to transfer
|
|
13
|
+
* @return {
|
|
14
|
+
* inputs: TransferableInput[];
|
|
15
|
+
* outputs: TransferableInput[];
|
|
16
|
+
* credentials: Credential[];
|
|
17
|
+
* }
|
|
18
|
+
* @protected
|
|
19
|
+
*/
|
|
20
|
+
protected createInputOutput(amount: bigint): {
|
|
57
21
|
inputs: TransferableInput[];
|
|
58
|
-
outputs:
|
|
59
|
-
credentials:
|
|
22
|
+
outputs: TransferableInput[];
|
|
23
|
+
credentials: any[];
|
|
60
24
|
};
|
|
25
|
+
/** @inheritdoc */
|
|
26
|
+
protected buildImplementation(): Promise<Transaction>;
|
|
61
27
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* @param utxos - Array of decoded UTXO objects
|
|
65
|
-
* @returns this builder instance for chaining
|
|
28
|
+
* Builds the avax transaction. transaction field is changed.
|
|
66
29
|
*/
|
|
67
|
-
|
|
30
|
+
protected abstract buildFlareTransaction(): void;
|
|
31
|
+
protected abstract get transactionType(): TransactionType;
|
|
68
32
|
/**
|
|
69
|
-
*
|
|
70
|
-
* Creates a credential with the provided signatures
|
|
33
|
+
* Fee is fix for AVM atomic tx.
|
|
71
34
|
*
|
|
72
|
-
* @
|
|
73
|
-
* @
|
|
74
|
-
* @returns Credential instance
|
|
35
|
+
* @returns network.txFee
|
|
36
|
+
* @protected
|
|
75
37
|
*/
|
|
76
|
-
protected
|
|
38
|
+
protected get fixedFee(): string;
|
|
77
39
|
/**
|
|
78
|
-
*
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Sign transaction with private key using FlareJS compatibility
|
|
83
|
-
*/
|
|
84
|
-
sign(params: {
|
|
85
|
-
key: string;
|
|
86
|
-
}): this;
|
|
87
|
-
/**
|
|
88
|
-
* Build the transaction using FlareJS compatibility
|
|
89
|
-
*/
|
|
90
|
-
build(): Promise<BaseTransaction>;
|
|
91
|
-
/**
|
|
92
|
-
* Parse and explain a transaction from hex using FlareJS compatibility
|
|
40
|
+
* Set the transaction type
|
|
41
|
+
*
|
|
42
|
+
* @param {TransactionType} transactionType The transaction type to be set
|
|
93
43
|
*/
|
|
94
|
-
|
|
44
|
+
setTransactionType(transactionType: TransactionType): void;
|
|
95
45
|
}
|
|
96
46
|
//# sourceMappingURL=atomicTransactionBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomicTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/atomicTransactionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"atomicTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/atomicTransactionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAwB,MAAM,uBAAuB,CAAC;AAUhF,8BAAsB,wBAAyB,SAAQ,kBAAkB;IACvE,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC;IACnC,SAAS,CAAC,aAAa,UAAS;gBAEpB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC;IAK7C;;;;;;;;;OASG;IACH,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG;QAC3C,MAAM,EAAE,iBAAiB,EAAE,CAAC;QAC5B,OAAO,EAAE,iBAAiB,EAAE,CAAC;QAC7B,WAAW,EAAE,GAAG,EAAE,CAAC;KACpB;IAoHD,kBAAkB;cACF,mBAAmB,IAAI,OAAO,CAAC,WAAW,CAAC;IAY3D;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,qBAAqB,IAAI,IAAI;IAEhD,SAAS,CAAC,QAAQ,KAAK,eAAe,IAAI,eAAe,CAAC;IAE1D;;;;;OAKG;IACH,SAAS,KAAK,QAAQ,IAAI,MAAM,CAE/B;IAED;;;;OAIG;IACH,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;CAG3D"}
|