@ledgerhq/ledger-wallet-framework 1.5.0 → 1.6.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/CHANGELOG.md +40 -0
- package/lib/api/types.d.ts +16 -3
- package/lib/api/types.d.ts.map +1 -1
- package/lib-es/api/types.d.ts +16 -3
- package/lib-es/api/types.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/api/types.ts +21 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @ledgerhq/ledger-wallet-framework
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#17423](https://github.com/LedgerHQ/ledger-live/pull/17423) [`822bc92`](https://github.com/LedgerHQ/ledger-live/commit/822bc92945248ddd31304aa7ca90854c849d217f) Thanks [@YazhuEth](https://github.com/YazhuEth)! - Change BridgeApi.getChainSpecificRules from a function returning ChainSpecificRules to a plain ChainSpecificRules field, and update Stellar accordingly (LIVE-28622)
|
|
8
|
+
|
|
9
|
+
- [#17528](https://github.com/LedgerHQ/ledger-live/pull/17528) [`62ec3e5`](https://github.com/LedgerHQ/ledger-live/commit/62ec3e5917ceee80c0384eea6ee0901faa58b08a) Thanks [@YazhuEth](https://github.com/YazhuEth)! - Move EVM staking types to `@ledgerhq/types-live` and strongly type the `BridgeApi.enrichStakingResources` hook so the generic coin framework no longer depends on `@ledgerhq/coin-evm`.
|
|
10
|
+
|
|
11
|
+
- [#16785](https://github.com/LedgerHQ/ledger-live/pull/16785) [`5de991c`](https://github.com/LedgerHQ/ledger-live/commit/5de991c8686f473d2323b9c6536c53b7badf5f3d) Thanks [@qperrot](https://github.com/qperrot)! - Feature: evm redelegation flow lwd
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`839537d`](https://github.com/LedgerHQ/ledger-live/commit/839537d42f9c2bf87ad0faf64e51966250976055), [`ef47541`](https://github.com/LedgerHQ/ledger-live/commit/ef47541f67995474a82446c416e0825623b5d063), [`bb25536`](https://github.com/LedgerHQ/ledger-live/commit/bb2553672eca7fc9a8e5b9c9b9869792b604a06a), [`a04a4c0`](https://github.com/LedgerHQ/ledger-live/commit/a04a4c0a8bbee5140f685836014409e98af33d02), [`9b75461`](https://github.com/LedgerHQ/ledger-live/commit/9b754610e67e4d31d3d49b566ba1590194265c6f), [`2eabd7f`](https://github.com/LedgerHQ/ledger-live/commit/2eabd7f56680e1399926a96b4bdeaf628e435999), [`62ec3e5`](https://github.com/LedgerHQ/ledger-live/commit/62ec3e5917ceee80c0384eea6ee0901faa58b08a), [`9ccd154`](https://github.com/LedgerHQ/ledger-live/commit/9ccd1540f6ea912107d9651fa9b66ffd12948111), [`603f343`](https://github.com/LedgerHQ/ledger-live/commit/603f343d64c9b69a5708b419eb7ebfe7cec94554), [`a61f904`](https://github.com/LedgerHQ/ledger-live/commit/a61f90478795bff6956d2a9083ec47d44e6e9a46)]:
|
|
16
|
+
- @ledgerhq/cryptoassets@13.49.0
|
|
17
|
+
- @ledgerhq/types-cryptoassets@7.37.0
|
|
18
|
+
- @ledgerhq/types-live@6.109.0
|
|
19
|
+
- @ledgerhq/live-currency-format@0.9.0
|
|
20
|
+
- @ledgerhq/live-env@2.36.0
|
|
21
|
+
- @ledgerhq/live-network@2.6.2
|
|
22
|
+
|
|
23
|
+
## 1.6.0-next.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- [#17423](https://github.com/LedgerHQ/ledger-live/pull/17423) [`822bc92`](https://github.com/LedgerHQ/ledger-live/commit/822bc92945248ddd31304aa7ca90854c849d217f) Thanks [@YazhuEth](https://github.com/YazhuEth)! - Change BridgeApi.getChainSpecificRules from a function returning ChainSpecificRules to a plain ChainSpecificRules field, and update Stellar accordingly (LIVE-28622)
|
|
28
|
+
|
|
29
|
+
- [#17528](https://github.com/LedgerHQ/ledger-live/pull/17528) [`62ec3e5`](https://github.com/LedgerHQ/ledger-live/commit/62ec3e5917ceee80c0384eea6ee0901faa58b08a) Thanks [@YazhuEth](https://github.com/YazhuEth)! - Move EVM staking types to `@ledgerhq/types-live` and strongly type the `BridgeApi.enrichStakingResources` hook so the generic coin framework no longer depends on `@ledgerhq/coin-evm`.
|
|
30
|
+
|
|
31
|
+
- [#16785](https://github.com/LedgerHQ/ledger-live/pull/16785) [`5de991c`](https://github.com/LedgerHQ/ledger-live/commit/5de991c8686f473d2323b9c6536c53b7badf5f3d) Thanks [@qperrot](https://github.com/qperrot)! - Feature: evm redelegation flow lwd
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [[`839537d`](https://github.com/LedgerHQ/ledger-live/commit/839537d42f9c2bf87ad0faf64e51966250976055), [`ef47541`](https://github.com/LedgerHQ/ledger-live/commit/ef47541f67995474a82446c416e0825623b5d063), [`bb25536`](https://github.com/LedgerHQ/ledger-live/commit/bb2553672eca7fc9a8e5b9c9b9869792b604a06a), [`a04a4c0`](https://github.com/LedgerHQ/ledger-live/commit/a04a4c0a8bbee5140f685836014409e98af33d02), [`9b75461`](https://github.com/LedgerHQ/ledger-live/commit/9b754610e67e4d31d3d49b566ba1590194265c6f), [`2eabd7f`](https://github.com/LedgerHQ/ledger-live/commit/2eabd7f56680e1399926a96b4bdeaf628e435999), [`62ec3e5`](https://github.com/LedgerHQ/ledger-live/commit/62ec3e5917ceee80c0384eea6ee0901faa58b08a), [`9ccd154`](https://github.com/LedgerHQ/ledger-live/commit/9ccd1540f6ea912107d9651fa9b66ffd12948111), [`603f343`](https://github.com/LedgerHQ/ledger-live/commit/603f343d64c9b69a5708b419eb7ebfe7cec94554), [`a61f904`](https://github.com/LedgerHQ/ledger-live/commit/a61f90478795bff6956d2a9083ec47d44e6e9a46)]:
|
|
36
|
+
- @ledgerhq/cryptoassets@13.49.0-next.0
|
|
37
|
+
- @ledgerhq/types-cryptoassets@7.37.0-next.0
|
|
38
|
+
- @ledgerhq/types-live@6.109.0-next.0
|
|
39
|
+
- @ledgerhq/live-currency-format@0.9.0-next.0
|
|
40
|
+
- @ledgerhq/live-env@2.36.0-next.0
|
|
41
|
+
- @ledgerhq/live-network@2.6.2-next.0
|
|
42
|
+
|
|
3
43
|
## 1.5.0
|
|
4
44
|
|
|
5
45
|
### Minor Changes
|
package/lib/api/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AssetInfo, BalanceOptions } from "@ledgerhq/coin-module-framework/api/types";
|
|
2
|
-
import type { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
|
-
import type { Operation as LiveOperation } from "@ledgerhq/types-live";
|
|
2
|
+
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
|
+
import type { Operation as LiveOperation, StakingResources } from "@ledgerhq/types-live";
|
|
4
4
|
export type ChainSpecificRules = {
|
|
5
5
|
getAccountShape: (address: string) => void;
|
|
6
6
|
getTransactionStatus: {
|
|
@@ -8,7 +8,7 @@ export type ChainSpecificRules = {
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export type BridgeApi = {
|
|
11
|
-
getChainSpecificRules?:
|
|
11
|
+
getChainSpecificRules?: ChainSpecificRules;
|
|
12
12
|
getTokenFromAsset?: (asset: AssetInfo) => Promise<TokenCurrency | undefined>;
|
|
13
13
|
getAssetFromToken?: (token: TokenCurrency, owner: string) => AssetInfo;
|
|
14
14
|
computeIntentType?: (transaction: Record<string, unknown>) => string;
|
|
@@ -29,5 +29,18 @@ export type BridgeApi = {
|
|
|
29
29
|
*/
|
|
30
30
|
usesStakingPositions?: boolean;
|
|
31
31
|
balanceOptions?: BalanceOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Optional hook called after operations are merged, allowing a chain bridge to
|
|
34
|
+
* enrich the staking resources built from `getBalance` data (e.g. by fetching
|
|
35
|
+
* redelegations from a REST API or reconstructing them from on-chain tx history
|
|
36
|
+
* when the standard API does not surface them).
|
|
37
|
+
*
|
|
38
|
+
* @param currency - The crypto currency of the account being synced.
|
|
39
|
+
* @param address - The account address.
|
|
40
|
+
* @param operations - The full merged operation list.
|
|
41
|
+
* @param stakingResources - The current staking resources to enrich.
|
|
42
|
+
* @returns The enriched staking resources, or the same object unchanged when no enrichment is needed.
|
|
43
|
+
*/
|
|
44
|
+
enrichStakingResources?: (currency: CryptoCurrency, address: string, operations: LiveOperation[], stakingResources: StakingResources) => Promise<StakingResources>;
|
|
32
45
|
};
|
|
33
46
|
//# sourceMappingURL=types.d.ts.map
|
package/lib/api/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,oBAAoB,EAAE;QACpB,uBAAuB,CAAC,EAAE,OAAO,CAAC;KACnC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,qBAAqB,CAAC,EAAE,kBAAkB,CAAC;IAC3C,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;IAC7E,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;IACrE,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC9E,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IACnF;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;;;;;;OAWG;IACH,sBAAsB,CAAC,EAAE,CACvB,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,aAAa,EAAE,EAC3B,gBAAgB,EAAE,gBAAgB,KAC/B,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAChC,CAAC"}
|
package/lib-es/api/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AssetInfo, BalanceOptions } from "@ledgerhq/coin-module-framework/api/types";
|
|
2
|
-
import type { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
|
-
import type { Operation as LiveOperation } from "@ledgerhq/types-live";
|
|
2
|
+
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
|
+
import type { Operation as LiveOperation, StakingResources } from "@ledgerhq/types-live";
|
|
4
4
|
export type ChainSpecificRules = {
|
|
5
5
|
getAccountShape: (address: string) => void;
|
|
6
6
|
getTransactionStatus: {
|
|
@@ -8,7 +8,7 @@ export type ChainSpecificRules = {
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export type BridgeApi = {
|
|
11
|
-
getChainSpecificRules?:
|
|
11
|
+
getChainSpecificRules?: ChainSpecificRules;
|
|
12
12
|
getTokenFromAsset?: (asset: AssetInfo) => Promise<TokenCurrency | undefined>;
|
|
13
13
|
getAssetFromToken?: (token: TokenCurrency, owner: string) => AssetInfo;
|
|
14
14
|
computeIntentType?: (transaction: Record<string, unknown>) => string;
|
|
@@ -29,5 +29,18 @@ export type BridgeApi = {
|
|
|
29
29
|
*/
|
|
30
30
|
usesStakingPositions?: boolean;
|
|
31
31
|
balanceOptions?: BalanceOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Optional hook called after operations are merged, allowing a chain bridge to
|
|
34
|
+
* enrich the staking resources built from `getBalance` data (e.g. by fetching
|
|
35
|
+
* redelegations from a REST API or reconstructing them from on-chain tx history
|
|
36
|
+
* when the standard API does not surface them).
|
|
37
|
+
*
|
|
38
|
+
* @param currency - The crypto currency of the account being synced.
|
|
39
|
+
* @param address - The account address.
|
|
40
|
+
* @param operations - The full merged operation list.
|
|
41
|
+
* @param stakingResources - The current staking resources to enrich.
|
|
42
|
+
* @returns The enriched staking resources, or the same object unchanged when no enrichment is needed.
|
|
43
|
+
*/
|
|
44
|
+
enrichStakingResources?: (currency: CryptoCurrency, address: string, operations: LiveOperation[], stakingResources: StakingResources) => Promise<StakingResources>;
|
|
32
45
|
};
|
|
33
46
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,oBAAoB,EAAE;QACpB,uBAAuB,CAAC,EAAE,OAAO,CAAC;KACnC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,qBAAqB,CAAC,EAAE,kBAAkB,CAAC;IAC3C,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;IAC7E,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;IACrE,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC9E,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IACnF;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;;;;;;OAWG;IACH,sBAAsB,CAAC,EAAE,CACvB,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,aAAa,EAAE,EAC3B,gBAAgB,EAAE,gBAAgB,KAC/B,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/ledger-wallet-framework",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Framework for Ledger Wallet",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
},
|
|
89
89
|
"license": "Apache-2.0",
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@ledgerhq/coin-module-framework": "
|
|
91
|
+
"@ledgerhq/coin-module-framework": "3.0.0",
|
|
92
92
|
"axios": "1.13.2",
|
|
93
93
|
"bignumber.js": "^9.1.2",
|
|
94
94
|
"bip32-path": "^0.4.2",
|
|
@@ -100,16 +100,16 @@
|
|
|
100
100
|
"prando": "^6.0.1",
|
|
101
101
|
"rxjs": "7.8.2",
|
|
102
102
|
"uuid": "11.1.0",
|
|
103
|
-
"@ledgerhq/cryptoassets": "^13.
|
|
104
|
-
"@ledgerhq/devices": "8.14.2",
|
|
103
|
+
"@ledgerhq/cryptoassets": "^13.49.0",
|
|
105
104
|
"@ledgerhq/errors": "^6.35.0",
|
|
106
105
|
"@ledgerhq/live-config": "^3.7.0",
|
|
107
|
-
"@ledgerhq/live-env": "^2.
|
|
108
|
-
"@ledgerhq/live-currency-format": "^0.
|
|
109
|
-
"@ledgerhq/live-network": "^2.6.
|
|
106
|
+
"@ledgerhq/live-env": "^2.36.0",
|
|
107
|
+
"@ledgerhq/live-currency-format": "^0.9.0",
|
|
108
|
+
"@ledgerhq/live-network": "^2.6.2",
|
|
109
|
+
"@ledgerhq/devices": "8.14.2",
|
|
110
110
|
"@ledgerhq/logs": "^6.17.0",
|
|
111
|
-
"@ledgerhq/types-cryptoassets": "^7.
|
|
112
|
-
"@ledgerhq/types-live": "^6.
|
|
111
|
+
"@ledgerhq/types-cryptoassets": "^7.37.0",
|
|
112
|
+
"@ledgerhq/types-live": "^6.109.0"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@types/imurmurhash": "^0.1.4",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"@swc/jest": "0.2.39",
|
|
127
127
|
"@swc/core": "1.15.11",
|
|
128
128
|
"@ledgerhq/hw-transport-node-speculos": "^6.34.2",
|
|
129
|
-
"@ledgerhq/live-dmk-speculos": "^0.8.
|
|
129
|
+
"@ledgerhq/live-dmk-speculos": "^0.8.8"
|
|
130
130
|
},
|
|
131
131
|
"scripts": {
|
|
132
132
|
"clean": "rm -rf lib lib-es",
|
package/src/api/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AssetInfo, BalanceOptions } from "@ledgerhq/coin-module-framework/api/types";
|
|
2
|
-
import type { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
|
-
import type { Operation as LiveOperation } from "@ledgerhq/types-live";
|
|
2
|
+
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
|
+
import type { Operation as LiveOperation, StakingResources } from "@ledgerhq/types-live";
|
|
4
4
|
|
|
5
5
|
export type ChainSpecificRules = {
|
|
6
6
|
getAccountShape: (address: string) => void;
|
|
@@ -10,7 +10,7 @@ export type ChainSpecificRules = {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export type BridgeApi = {
|
|
13
|
-
getChainSpecificRules?:
|
|
13
|
+
getChainSpecificRules?: ChainSpecificRules;
|
|
14
14
|
getTokenFromAsset?: (asset: AssetInfo) => Promise<TokenCurrency | undefined>;
|
|
15
15
|
getAssetFromToken?: (token: TokenCurrency, owner: string) => AssetInfo;
|
|
16
16
|
computeIntentType?: (transaction: Record<string, unknown>) => string;
|
|
@@ -29,4 +29,22 @@ export type BridgeApi = {
|
|
|
29
29
|
*/
|
|
30
30
|
usesStakingPositions?: boolean;
|
|
31
31
|
balanceOptions?: BalanceOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Optional hook called after operations are merged, allowing a chain bridge to
|
|
34
|
+
* enrich the staking resources built from `getBalance` data (e.g. by fetching
|
|
35
|
+
* redelegations from a REST API or reconstructing them from on-chain tx history
|
|
36
|
+
* when the standard API does not surface them).
|
|
37
|
+
*
|
|
38
|
+
* @param currency - The crypto currency of the account being synced.
|
|
39
|
+
* @param address - The account address.
|
|
40
|
+
* @param operations - The full merged operation list.
|
|
41
|
+
* @param stakingResources - The current staking resources to enrich.
|
|
42
|
+
* @returns The enriched staking resources, or the same object unchanged when no enrichment is needed.
|
|
43
|
+
*/
|
|
44
|
+
enrichStakingResources?: (
|
|
45
|
+
currency: CryptoCurrency,
|
|
46
|
+
address: string,
|
|
47
|
+
operations: LiveOperation[],
|
|
48
|
+
stakingResources: StakingResources,
|
|
49
|
+
) => Promise<StakingResources>;
|
|
32
50
|
};
|