@bitgo/abstract-cosmos 11.13.1 → 11.14.1
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/CHANGELOG.md +10 -0
- package/dist/src/cosmosCoin.d.ts +44 -2
- package/dist/src/cosmosCoin.d.ts.map +1 -1
- package/dist/src/cosmosCoin.js +209 -76
- package/dist/src/lib/iface.d.ts +19 -0
- package/dist/src/lib/iface.d.ts.map +1 -1
- package/dist/src/lib/iface.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.14.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.14.0...@bitgo/abstract-cosmos@11.14.1) (2025-08-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @bitgo/abstract-cosmos
|
|
9
|
+
|
|
10
|
+
# [11.14.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.13.1...@bitgo/abstract-cosmos@11.14.0) (2025-08-29)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **abstract-cosmos:** add non-bitgo token recovery support on wrw ([86f44eb](https://github.com/BitGo/BitGoJS/commit/86f44ebbae563085dab6323ebae12301753fbbe4))
|
|
15
|
+
|
|
6
16
|
## [11.13.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.13.0...@bitgo/abstract-cosmos@11.13.1) (2025-08-27)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @bitgo/abstract-cosmos
|
package/dist/src/cosmosCoin.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AuditDecryptedKeyParams, BaseCoin, BitGoBase, ExplanationResult, KeyPair, MPCAlgorithm, MultisigType, ParsedTransaction, ParseTransactionOptions, SignedTransaction, SignTransactionOptions, VerifyAddressOptions, VerifyTransactionOptions } from '@bitgo/sdk-core';
|
|
2
2
|
import { BaseCoin as StaticsBaseCoin, CoinFamily } from '@bitgo/statics';
|
|
3
|
+
import { Coin } from '@cosmjs/stargate';
|
|
3
4
|
import { Buffer } from 'buffer';
|
|
4
5
|
import { Hash } from 'crypto';
|
|
5
6
|
import * as request from 'superagent';
|
|
6
|
-
import { CosmosKeyPair, CosmosLikeCoinRecoveryOutput, GasAmountDetails, RecoveryOptions } from './lib';
|
|
7
|
+
import { CosmosKeyPair, CosmosLikeCoinRecoveryOutput, CosmosTransaction, GasAmountDetails, RecoveryOptions, CosmosTransactionBuilder, KeyShares } from './lib';
|
|
7
8
|
/**
|
|
8
9
|
* Cosmos accounts support memo Id based addresses
|
|
9
10
|
*/
|
|
@@ -47,6 +48,47 @@ export declare class CosmosCoin<CustomMessage = never> extends BaseCoin {
|
|
|
47
48
|
* of the address being swept
|
|
48
49
|
*/
|
|
49
50
|
recover(params: RecoveryOptions): Promise<CosmosLikeCoinRecoveryOutput>;
|
|
51
|
+
/**
|
|
52
|
+
* Validates the recovery parameters
|
|
53
|
+
*/
|
|
54
|
+
private validateRecoveryParams;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if this is an unsigned sweep operation
|
|
57
|
+
*/
|
|
58
|
+
private isUnsignedSweep;
|
|
59
|
+
/**
|
|
60
|
+
* Gets sender details including address, public key and key shares
|
|
61
|
+
*/
|
|
62
|
+
private getSenderDetails;
|
|
63
|
+
/**
|
|
64
|
+
* Gets key shares from recovery parameters
|
|
65
|
+
*/
|
|
66
|
+
private getKeyShares;
|
|
67
|
+
/**
|
|
68
|
+
* Processes account balances and validates sufficient funds
|
|
69
|
+
*/
|
|
70
|
+
private processBalances;
|
|
71
|
+
/**
|
|
72
|
+
* Builds transaction messages for all balances
|
|
73
|
+
*/
|
|
74
|
+
private buildTransactionMessages;
|
|
75
|
+
/**
|
|
76
|
+
* Builds and signs the transaction
|
|
77
|
+
*/
|
|
78
|
+
private buildAndSignTransaction;
|
|
79
|
+
/**
|
|
80
|
+
* Signs the transaction with MPC
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Signs the transaction using MPC (Multi-Party Computation)
|
|
84
|
+
* @param unsignedTransaction The unsigned transaction to sign
|
|
85
|
+
* @param txnBuilder The transaction builder instance
|
|
86
|
+
* @param keyShares The key shares for MPC signing
|
|
87
|
+
* @param publicKey The public key for verification
|
|
88
|
+
* @returns The signed transaction output
|
|
89
|
+
* @throws Error if validation fails or signing process encounters an error
|
|
90
|
+
*/
|
|
91
|
+
protected signTransactionWithMpc(unsignedTransaction: CosmosTransaction<CustomMessage>, txnBuilder: CosmosTransactionBuilder, keyShares: KeyShares, publicKey: string): Promise<CosmosLikeCoinRecoveryOutput>;
|
|
50
92
|
/**
|
|
51
93
|
* Builds a redelegate transaction
|
|
52
94
|
* @param {RecoveryOptions} params parameters needed to construct and
|
|
@@ -99,7 +141,7 @@ export declare class CosmosCoin<CustomMessage = never> extends BaseCoin {
|
|
|
99
141
|
/**
|
|
100
142
|
* Helper to fetch account balance
|
|
101
143
|
*/
|
|
102
|
-
protected getAccountBalance(senderAddress: string): Promise<
|
|
144
|
+
protected getAccountBalance(senderAddress: string): Promise<Coin[]>;
|
|
103
145
|
/**
|
|
104
146
|
* Helper to fetch chainId
|
|
105
147
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosCoin.d.ts","sourceRoot":"","sources":["../../src/cosmosCoin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,QAAQ,EAER,SAAS,EAGT,iBAAiB,EAGjB,OAAO,EACP,YAAY,EACZ,YAAY,EAEZ,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EAEjB,sBAAsB,EAGtB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;A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