@bitgo-beta/sdk-coin-flrp 1.0.1-beta.9 → 1.0.1-beta.90
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 +82 -61
- package/dist/src/flrp.d.ts.map +1 -1
- package/dist/src/flrp.js +293 -134
- package/dist/src/lib/atomicTransactionBuilder.d.ts +42 -6
- package/dist/src/lib/atomicTransactionBuilder.d.ts.map +1 -1
- package/dist/src/lib/atomicTransactionBuilder.js +233 -29
- package/dist/src/lib/constants.d.ts +160 -1
- package/dist/src/lib/constants.d.ts.map +1 -1
- package/dist/src/lib/constants.js +213 -3
- package/dist/src/lib/delegatorTxBuilder.d.ts +58 -0
- package/dist/src/lib/delegatorTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/delegatorTxBuilder.js +224 -0
- package/dist/src/lib/exportInCTxBuilder.d.ts +1 -1
- package/dist/src/lib/exportInCTxBuilder.d.ts.map +1 -1
- package/dist/src/lib/exportInCTxBuilder.js +46 -17
- package/dist/src/lib/exportInPTxBuilder.d.ts +1 -1
- package/dist/src/lib/exportInPTxBuilder.d.ts.map +1 -1
- package/dist/src/lib/exportInPTxBuilder.js +70 -6
- package/dist/src/lib/iface.d.ts +52 -1
- package/dist/src/lib/iface.d.ts.map +1 -1
- package/dist/src/lib/iface.js +1 -1
- package/dist/src/lib/importInCTxBuilder.d.ts +67 -0
- package/dist/src/lib/importInCTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/importInCTxBuilder.js +403 -0
- package/dist/src/lib/importInPTxBuilder.d.ts +73 -0
- package/dist/src/lib/importInPTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/importInPTxBuilder.js +464 -0
- package/dist/src/lib/index.d.ts +7 -0
- package/dist/src/lib/index.d.ts.map +1 -1
- package/dist/src/lib/index.js +15 -2
- package/dist/src/lib/keyPair.d.ts.map +1 -1
- package/dist/src/lib/keyPair.js +4 -6
- package/dist/src/lib/permissionlessValidatorTxBuilder.d.ts +81 -0
- package/dist/src/lib/permissionlessValidatorTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/permissionlessValidatorTxBuilder.js +248 -0
- package/dist/src/lib/transaction.d.ts +111 -0
- package/dist/src/lib/transaction.d.ts.map +1 -0
- package/dist/src/lib/transaction.js +322 -0
- package/dist/src/lib/transactionBuilder.d.ts +85 -0
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -0
- package/dist/src/lib/transactionBuilder.js +167 -0
- package/dist/src/lib/transactionBuilderFactory.d.ts +37 -0
- package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -0
- package/dist/src/lib/transactionBuilderFactory.js +91 -0
- package/dist/src/lib/types.d.ts +78 -0
- package/dist/src/lib/types.d.ts.map +1 -0
- package/dist/src/lib/types.js +5 -0
- package/dist/src/lib/utils.d.ts +59 -0
- package/dist/src/lib/utils.d.ts.map +1 -1
- package/dist/src/lib/utils.js +160 -52
- package/dist/src/lib/validatorTxBuilder.d.ts +40 -0
- package/dist/src/lib/validatorTxBuilder.d.ts.map +1 -0
- package/dist/src/lib/validatorTxBuilder.js +180 -0
- package/dist/test/unit/delegatorTxBuilder.test.d.ts +2 -0
- package/dist/test/unit/delegatorTxBuilder.test.d.ts.map +1 -0
- package/dist/test/unit/delegatorTxBuilder.test.js +233 -0
- package/dist/test/unit/lib/atomicTransactionBuilder.js +37 -11
- package/dist/test/unit/lib/exportInCTxBuilder.d.ts +2 -0
- package/dist/test/unit/lib/exportInCTxBuilder.d.ts.map +1 -0
- package/dist/test/unit/lib/exportInCTxBuilder.js +584 -0
- package/dist/test/unit/lib/exportInPTxBuilder.d.ts +2 -0
- package/dist/test/unit/lib/exportInPTxBuilder.d.ts.map +1 -0
- package/dist/test/unit/lib/exportInPTxBuilder.js +377 -0
- package/dist/test/unit/lib/importInCTxBuilder.d.ts +2 -0
- package/dist/test/unit/lib/importInCTxBuilder.d.ts.map +1 -0
- package/dist/test/unit/lib/importInCTxBuilder.js +257 -0
- package/dist/test/unit/lib/importInPTxBuilder.d.ts +2 -0
- package/dist/test/unit/lib/importInPTxBuilder.d.ts.map +1 -0
- package/dist/test/unit/lib/importInPTxBuilder.js +500 -0
- package/dist/test/unit/lib/transaction.d.ts +2 -0
- package/dist/test/unit/lib/transaction.d.ts.map +1 -0
- package/dist/test/unit/lib/transaction.js +460 -0
- package/dist/test/unit/lib/utils.js +55 -1
- package/dist/test/unit/permissionlessValidatorTxBuilder.test.d.ts +2 -0
- package/dist/test/unit/permissionlessValidatorTxBuilder.test.d.ts.map +1 -0
- package/dist/test/unit/permissionlessValidatorTxBuilder.test.js +271 -0
- package/dist/test/unit/transactionBuilder.test.d.ts +2 -0
- package/dist/test/unit/transactionBuilder.test.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder.test.js +114 -0
- package/dist/test/unit/validatorTxBuilder.test.d.ts +2 -0
- package/dist/test/unit/validatorTxBuilder.test.d.ts.map +1 -0
- package/dist/test/unit/validatorTxBuilder.test.js +293 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/.eslintignore +0 -5
- package/.eslintrc.json +0 -7
- package/.mocharc.yml +0 -8
- package/CHANGELOG.md +0 -0
- package/dist/test/unit/lib/exportTxBuilder.d.ts +0 -2
- package/dist/test/unit/lib/exportTxBuilder.d.ts.map +0 -1
- package/dist/test/unit/lib/exportTxBuilder.js +0 -45
package/dist/src/flrp.d.ts
CHANGED
|
@@ -1,70 +1,91 @@
|
|
|
1
|
-
import { BaseCoin, BitGoBase, VerifyAddressOptions, ParsedTransaction, ParseTransactionOptions, KeyPair, SignTransactionOptions, SignedTransaction, InitiateRecoveryOptions, SupplementGenerateWalletOptions, KeychainsTriplet, TransactionPrebuild, PresignTransactionOptions, FeeEstimateOptions, DeriveKeyWithSeedOptions, AuditKeyParams, PopulatedIntent, PrebuildTransactionWithIntentOptions, TokenTransferRecipientParams, BuildNftTransferDataOptions, BaseBroadcastTransactionOptions, BaseBroadcastTransactionResult, MPCAlgorithm, Wallet, IInscriptionBuilder, ExtraPrebuildParamsOptions, ValidMofNOptions, VerifyTransactionOptions, ITransactionExplanation, RecoverTokenTransaction, RecoverWalletTokenOptions, PrecreateBitGoOptions, IWallet } from '@bitgo-beta/sdk-core';
|
|
2
1
|
import { BaseCoin as StaticsBaseCoin, CoinFamily } from '@bitgo-beta/statics';
|
|
3
|
-
import {
|
|
2
|
+
import { BaseCoin, BitGoBase, KeyPair, VerifyAddressOptions, SignedTransaction, ParseTransactionOptions, ITransactionRecipient, ParsedTransaction, MultisigType, AuditDecryptedKeyParams } from '@bitgo-beta/sdk-core';
|
|
3
|
+
import * as FlrpLib from './lib';
|
|
4
|
+
import { FlrpSignTransactionOptions, ExplainTransactionOptions, FlrpVerifyTransactionOptions, FlrpTransactionStakingOptions, FlrpTransactionParams } from './lib/iface';
|
|
4
5
|
export declare class Flrp extends BaseCoin {
|
|
5
6
|
protected readonly _staticsCoin: Readonly<StaticsBaseCoin>;
|
|
6
|
-
|
|
7
|
+
constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>);
|
|
7
8
|
static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin;
|
|
8
9
|
getChain(): string;
|
|
9
10
|
getFamily(): CoinFamily;
|
|
10
11
|
getFullName(): string;
|
|
11
|
-
getBaseFactor():
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
12
|
+
getBaseFactor(): string | number;
|
|
13
|
+
/** inherited doc */
|
|
14
|
+
getDefaultMultisigType(): MultisigType;
|
|
15
|
+
/**
|
|
16
|
+
* Check if staking txn is valid, based on expected tx params.
|
|
17
|
+
*
|
|
18
|
+
* @param {FlrpTransactionStakingOptions} stakingOptions expected staking params to check against
|
|
19
|
+
* @param {FlrpLib.TransactionExplanation} explainedTx explained staking transaction
|
|
20
|
+
*/
|
|
21
|
+
validateStakingTx(stakingOptions: FlrpTransactionStakingOptions, explainedTx: FlrpLib.TransactionExplanation): void;
|
|
22
|
+
/**
|
|
23
|
+
* Check if export txn is valid, based on expected tx params.
|
|
24
|
+
*
|
|
25
|
+
* @param {ITransactionRecipient[]} recipients expected recipients and info
|
|
26
|
+
* @param {FlrpLib.TransactionExplanation} explainedTx explained export transaction
|
|
27
|
+
*/
|
|
28
|
+
validateExportTx(recipients: ITransactionRecipient[], explainedTx: FlrpLib.TransactionExplanation): void;
|
|
29
|
+
/**
|
|
30
|
+
* Check if import txn into P is valid, based on expected tx params.
|
|
31
|
+
*
|
|
32
|
+
* @param {FlrpLib.FlrpEntry[]} explainedTxInputs tx inputs (unspents to be imported)
|
|
33
|
+
* @param {FlrpTransactionParams} txParams expected tx info to check against
|
|
34
|
+
*/
|
|
35
|
+
validateImportTx(explainedTxInputs: FlrpLib.FlrpEntry[], txParams: FlrpTransactionParams): void;
|
|
36
|
+
verifyTransaction(params: FlrpVerifyTransactionOptions): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Check if address is valid, then make sure it matches the root address.
|
|
39
|
+
*
|
|
40
|
+
* @param params.address address to validate
|
|
41
|
+
* @param params.keychains public keys to generate the wallet
|
|
42
|
+
*/
|
|
43
|
+
isWalletAddress(params: VerifyAddressOptions): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Validate that two multisig address arrays have the same elements, order doesnt matter
|
|
46
|
+
* @param addressArray1
|
|
47
|
+
* @param addressArray2
|
|
48
|
+
* @returns true if address arrays have the same addresses
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
private adressesArraysMatch;
|
|
52
|
+
/**
|
|
53
|
+
* Generate Flrp key pair
|
|
54
|
+
*
|
|
55
|
+
* @param {Buffer} seed - Seed from which the new keypair should be generated, otherwise a random seed is used
|
|
56
|
+
* @returns {Object} object with generated pub and prv
|
|
57
|
+
*/
|
|
58
|
+
generateKeyPair(seed?: Buffer): KeyPair;
|
|
59
|
+
/**
|
|
60
|
+
* Return boolean indicating whether input is valid public key for the coin
|
|
61
|
+
*
|
|
62
|
+
* @param {string} pub the prv to be checked
|
|
63
|
+
* @returns is it valid?
|
|
64
|
+
*/
|
|
65
|
+
isValidPub(pub: string): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Return boolean indicating whether input is valid private key for the coin
|
|
68
|
+
*
|
|
69
|
+
* @param {string} prv the prv to be checked
|
|
70
|
+
* @returns is it valid?
|
|
71
|
+
*/
|
|
72
|
+
isValidPrv(prv: string): boolean;
|
|
73
|
+
isValidAddress(address: string | string[]): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Signs Flrp transaction
|
|
76
|
+
*/
|
|
77
|
+
signTransaction(params: FlrpSignTransactionOptions): Promise<SignedTransaction>;
|
|
78
|
+
parseTransaction(params: ParseTransactionOptions): Promise<ParsedTransaction>;
|
|
79
|
+
/**
|
|
80
|
+
* Explain a Flrp transaction from txHex
|
|
81
|
+
* @param params
|
|
82
|
+
* @param callback
|
|
83
|
+
*/
|
|
84
|
+
explainTransaction(params: ExplainTransactionOptions): Promise<FlrpLib.TransactionExplanation>;
|
|
85
|
+
recoverySignature(message: Buffer, signature: Buffer): Buffer;
|
|
86
|
+
signMessage(key: KeyPair, message: string | Buffer): Promise<Buffer>;
|
|
87
|
+
private getBuilder;
|
|
88
|
+
/** @inheritDoc */
|
|
89
|
+
auditDecryptedKey(params: AuditDecryptedKeyParams): void;
|
|
69
90
|
}
|
|
70
91
|
//# sourceMappingURL=flrp.d.ts.map
|
package/dist/src/flrp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flrp.d.ts","sourceRoot":"","sources":["../../src/flrp.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"flrp.d.ts","sourceRoot":"","sources":["../../src/flrp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,IAAI,eAAe,EAAE,UAAU,EAAS,MAAM,qBAAqB,CAAC;AACnG,OAAO,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EAOvB,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EAEZ,uBAAuB,EAExB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,OAAO,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAIrB,qBAAa,IAAK,SAAQ,QAAQ;IAChC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;gBAE/C,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;IAUrE,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,QAAQ;IAI1F,QAAQ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