@vultisig/core-chain 2.20.0 → 2.22.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 +46 -0
- package/dist/chains/solana/staking/metadata/ValidatorMetadataProvider.d.ts +25 -0
- package/dist/chains/solana/staking/metadata/ValidatorMetadataProvider.d.ts.map +1 -0
- package/dist/chains/solana/staking/metadata/ValidatorMetadataProvider.js +2 -0
- package/dist/chains/solana/staking/metadata/ValidatorMetadataProvider.js.map +1 -0
- package/dist/chains/solana/staking/metadata/enrichValidators.d.ts +13 -0
- package/dist/chains/solana/staking/metadata/enrichValidators.d.ts.map +1 -0
- package/dist/chains/solana/staking/metadata/enrichValidators.js +18 -0
- package/dist/chains/solana/staking/metadata/enrichValidators.js.map +1 -0
- package/dist/chains/solana/staking/metadata/stakewizProvider.d.ts +3 -0
- package/dist/chains/solana/staking/metadata/stakewizProvider.d.ts.map +1 -0
- package/dist/chains/solana/staking/metadata/stakewizProvider.js +73 -0
- package/dist/chains/solana/staking/metadata/stakewizProvider.js.map +1 -0
- package/dist/chains/solana/staking/tx/buildUnsignedStakingTx.d.ts +27 -0
- package/dist/chains/solana/staking/tx/buildUnsignedStakingTx.d.ts.map +1 -0
- package/dist/chains/solana/staking/tx/buildUnsignedStakingTx.js +92 -0
- package/dist/chains/solana/staking/tx/buildUnsignedStakingTx.js.map +1 -0
- package/dist/chains/solana/staking/tx/stakingPayload.d.ts +44 -0
- package/dist/chains/solana/staking/tx/stakingPayload.d.ts.map +1 -0
- package/dist/chains/solana/staking/tx/stakingPayload.js +9 -0
- package/dist/chains/solana/staking/tx/stakingPayload.js.map +1 -0
- package/dist/tx/broadcast/resolvers/solana.d.ts.map +1 -1
- package/dist/tx/broadcast/resolvers/solana.js +27 -1
- package/dist/tx/broadcast/resolvers/solana.js.map +1 -1
- package/package.json +29 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @vultisig/core-chain
|
|
2
2
|
|
|
3
|
+
## 2.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#915](https://github.com/vultisig/vultisig-sdk/pull/915) [`4941508`](https://github.com/vultisig/vultisig-sdk/commit/4941508f5002e1251b5cc1cbc08ed0ebc379646a) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - feat(solana): native-staking transaction builder (byte-parity)
|
|
8
|
+
|
|
9
|
+
Phase 3 of Solana native staking. Adds the signing core for the delegate flow
|
|
10
|
+
(and the proto for the later unstake / withdraw / move-stake ops) under
|
|
11
|
+
`@vultisig/core-chain/chains/solana/staking/tx`:
|
|
12
|
+
|
|
13
|
+
- `stakingPayload` — discriminated staking-op intent (delegate / unstake /
|
|
14
|
+
withdraw / move-stake deactivate + redelegate sub-steps).
|
|
15
|
+
- `buildUnsignedStakingTx` — maps a payload to the wallet-core Solana stake
|
|
16
|
+
proto (`delegateStakeTransaction` derives the stake account; move-redelegate
|
|
17
|
+
sets it explicitly), compiles a zero-signature envelope via
|
|
18
|
+
`TransactionCompiler`, and returns it base64-encoded. This is the MPC
|
|
19
|
+
byte-parity contract: the initiating device builds these bytes once (pinning
|
|
20
|
+
the recent blockhash + the derived stake-account address) and relays them via
|
|
21
|
+
`signSolana.rawTransactions`, so every co-signer signs the identical message.
|
|
22
|
+
|
|
23
|
+
Adds `long` to core-chain deps (Long-typed proto amount fields). Byte-parity
|
|
24
|
+
tests build delegate / deactivate / withdraw / move-redelegate txs against real
|
|
25
|
+
wallet-core, decode them back, and assert determinism.
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- [#916](https://github.com/vultisig/vultisig-sdk/pull/916) [`17fcbc0`](https://github.com/vultisig/vultisig-sdk/commit/17fcbc0acf983959be7faaf4ab789b4268a83c31) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - Solana broadcast: surface the on-chain rejection reason. When `sendTransaction` is rejected at preflight, the RPC returns the actionable detail in `data.err` / `data.logs` (the program logs), which web3.js exposes via `SendTransactionError.logs` while leaving the bare `.message` ("failed to send transaction") uninformative. The broadcast resolver now folds those program logs into the thrown error's message (preserving the original error as `cause`), so consumers reading the top-level message see _why_ the network rejected the transaction — "insufficient lamports", a custom program error, a failed instruction — instead of just that it failed.
|
|
30
|
+
|
|
31
|
+
## 2.21.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- [#912](https://github.com/vultisig/vultisig-sdk/pull/912) [`403d5d5`](https://github.com/vultisig/vultisig-sdk/commit/403d5d5f7c7dba3e45cb818899db00f765541ecf) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - feat(solana): validator-metadata seam (Stakewiz, swappable)
|
|
36
|
+
|
|
37
|
+
Phase 2 of Solana native staking. Adds a swappable off-chain enrichment seam for
|
|
38
|
+
validator display metadata (name / logo / APY estimate / score) on top of the
|
|
39
|
+
Phase 1 on-chain `getVoteAccounts` rows, under
|
|
40
|
+
`@vultisig/core-chain/chains/solana/staking/metadata`:
|
|
41
|
+
|
|
42
|
+
- `ValidatorMetadataProvider` — provider interface; contract: never throws.
|
|
43
|
+
- `stakewizProvider` — concrete impl over api.stakewiz.com (`apy_estimate`
|
|
44
|
+
percent→fraction, `image`→logo, `wiz_score`→score). Degrades to an empty map
|
|
45
|
+
on any outage / non-OK / parse error so callers fall back to on-chain-only.
|
|
46
|
+
- `enrichValidators` — merges the metadata map onto the validator rows; the
|
|
47
|
+
provider is injectable for tests.
|
|
48
|
+
|
|
3
49
|
## 2.20.0
|
|
4
50
|
|
|
5
51
|
### Minor Changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ValidatorMetadata } from '../models/validator.js';
|
|
2
|
+
/**
|
|
3
|
+
* Swappable seam for off-chain validator enrichment (name / logo / APY /
|
|
4
|
+
* score). The core stake/commission/activation data comes from the on-chain
|
|
5
|
+
* `getVoteAccounts` read; this interface only supplies display metadata, which
|
|
6
|
+
* is the part most likely to change source (Stakewiz today, validators.app or
|
|
7
|
+
* an in-house endpoint tomorrow). Keeping it behind an interface lets the picker
|
|
8
|
+
* and views stay independent of any single provider.
|
|
9
|
+
*
|
|
10
|
+
* Contract: implementations MUST NOT throw on a provider outage. A failed or
|
|
11
|
+
* rate-limited source returns a partial or empty map so callers degrade
|
|
12
|
+
* gracefully — falling back to a truncated vote pubkey and the on-chain
|
|
13
|
+
* commission, with no logo, never a crash.
|
|
14
|
+
*
|
|
15
|
+
* Port of iOS `ValidatorMetadataProvider`.
|
|
16
|
+
*/
|
|
17
|
+
export type ValidatorMetadataProvider = {
|
|
18
|
+
/**
|
|
19
|
+
* Returns metadata keyed by vote pubkey for the requested validators. The
|
|
20
|
+
* returned map may be empty or cover only a subset of the input — a validator
|
|
21
|
+
* absent from the map simply has no enrichment available. Never throws.
|
|
22
|
+
*/
|
|
23
|
+
metadata: (votePubkeys: string[]) => Promise<Record<string, ValidatorMetadata>>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=ValidatorMetadataProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidatorMetadataProvider.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/metadata/ValidatorMetadataProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;;OAIG;IACH,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAA;CAChF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidatorMetadataProvider.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/metadata/ValidatorMetadataProvider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SolanaValidator } from '../models/validator.js';
|
|
2
|
+
import { ValidatorMetadataProvider } from './ValidatorMetadataProvider.js';
|
|
3
|
+
/**
|
|
4
|
+
* Merges off-chain metadata (name / logo / APY) onto on-chain validator rows
|
|
5
|
+
* via the swappable provider. The provider never throws — on an outage the rows
|
|
6
|
+
* pass through with empty metadata and the display layer falls back to a
|
|
7
|
+
* truncated vote pubkey + on-chain commission.
|
|
8
|
+
*
|
|
9
|
+
* Replaces the call site where iOS's view models invoke the
|
|
10
|
+
* `ValidatorMetadataProvider`; the provider is injectable for tests.
|
|
11
|
+
*/
|
|
12
|
+
export declare const enrichValidatorsWithMetadata: (validators: SolanaValidator[], provider?: ValidatorMetadataProvider) => Promise<SolanaValidator[]>;
|
|
13
|
+
//# sourceMappingURL=enrichValidators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enrichValidators.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/metadata/enrichValidators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAEvE;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACvC,YAAY,eAAe,EAAE,EAC7B,WAAU,yBAA6D,KACtE,OAAO,CAAC,eAAe,EAAE,CAM3B,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { stakewizValidatorMetadataProvider } from './stakewizProvider.js';
|
|
2
|
+
/**
|
|
3
|
+
* Merges off-chain metadata (name / logo / APY) onto on-chain validator rows
|
|
4
|
+
* via the swappable provider. The provider never throws — on an outage the rows
|
|
5
|
+
* pass through with empty metadata and the display layer falls back to a
|
|
6
|
+
* truncated vote pubkey + on-chain commission.
|
|
7
|
+
*
|
|
8
|
+
* Replaces the call site where iOS's view models invoke the
|
|
9
|
+
* `ValidatorMetadataProvider`; the provider is injectable for tests.
|
|
10
|
+
*/
|
|
11
|
+
export const enrichValidatorsWithMetadata = async (validators, provider = stakewizValidatorMetadataProvider) => {
|
|
12
|
+
const metadataByVotePubkey = await provider.metadata(validators.map(v => v.votePubkey));
|
|
13
|
+
return validators.map(validator => {
|
|
14
|
+
const metadata = metadataByVotePubkey[validator.votePubkey];
|
|
15
|
+
return metadata ? { ...validator, metadata } : validator;
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=enrichValidators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enrichValidators.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/metadata/enrichValidators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,oBAAoB,CAAA;AAGtE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAC/C,UAA6B,EAC7B,WAAsC,iCAAiC,EAC3C,EAAE;IAC9B,MAAM,oBAAoB,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;IACvF,OAAO,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;QAChC,MAAM,QAAQ,GAAG,oBAAoB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAC3D,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;IAC1D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stakewizProvider.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/metadata/stakewizProvider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAmDvE,eAAO,MAAM,iCAAiC,EAAE,yBAoC/C,CAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { attempt } from '@vultisig/lib-utils/attempt';
|
|
2
|
+
/**
|
|
3
|
+
* Concrete `ValidatorMetadataProvider` backed by Stakewiz
|
|
4
|
+
* (https://api.stakewiz.com). The `/validators` endpoint returns the full
|
|
5
|
+
* validator set in one response, so a single fetch enriches an arbitrary batch
|
|
6
|
+
* of vote pubkeys. A failed or rate-limited fetch yields an empty map — the
|
|
7
|
+
* call never throws, so callers degrade to on-chain-only display. The ~1h cache
|
|
8
|
+
* is handled by the consuming react-query hook's `staleTime`.
|
|
9
|
+
*
|
|
10
|
+
* Field mapping (Stakewiz → ValidatorMetadata):
|
|
11
|
+
* name → name
|
|
12
|
+
* image → logoUrl
|
|
13
|
+
* apy_estimate → apyEstimate (percent on the wire, stored as a fraction)
|
|
14
|
+
* wiz_score → score
|
|
15
|
+
*
|
|
16
|
+
* Port of iOS `StakewizValidatorMetadataProvider`.
|
|
17
|
+
*/
|
|
18
|
+
const stakewizValidatorsUrl = 'https://api.stakewiz.com/validators';
|
|
19
|
+
const asTrimmedString = (value) => typeof value === 'string' ? value.trim() || undefined : undefined;
|
|
20
|
+
const asFiniteNumber = (value) => typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Stakewiz reports `apy_estimate` as a percentage (e.g. 5.72) — store as a
|
|
23
|
+
* fraction. A genuine `0` is preserved (0% APY ≠ "no APY"); only missing /
|
|
24
|
+
* non-finite / negative values collapse to `undefined`.
|
|
25
|
+
*/
|
|
26
|
+
const apyFraction = (percent) => {
|
|
27
|
+
const value = asFiniteNumber(percent);
|
|
28
|
+
return value !== undefined && value >= 0 ? value / 100 : undefined;
|
|
29
|
+
};
|
|
30
|
+
const toMetadata = (row) => {
|
|
31
|
+
const wizScore = asFiniteNumber(row.wiz_score);
|
|
32
|
+
return {
|
|
33
|
+
name: asTrimmedString(row.name),
|
|
34
|
+
logoUrl: asTrimmedString(row.image),
|
|
35
|
+
apyEstimate: apyFraction(row.apy_estimate),
|
|
36
|
+
score: wizScore === undefined ? undefined : Math.round(wizScore),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export const stakewizValidatorMetadataProvider = {
|
|
40
|
+
metadata: async (votePubkeys) => {
|
|
41
|
+
const requested = new Set(votePubkeys.filter(Boolean));
|
|
42
|
+
if (requested.size === 0) {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
const result = await attempt(async () => {
|
|
46
|
+
const response = await fetch(stakewizValidatorsUrl, {
|
|
47
|
+
headers: { Accept: 'application/json' },
|
|
48
|
+
});
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
throw new Error(`Stakewiz responded ${response.status}`);
|
|
51
|
+
}
|
|
52
|
+
return (await response.json());
|
|
53
|
+
});
|
|
54
|
+
// Outage / rate-limit / malformed response — degrade to on-chain-only.
|
|
55
|
+
if ('error' in result || !Array.isArray(result.data)) {
|
|
56
|
+
return {};
|
|
57
|
+
}
|
|
58
|
+
const map = {};
|
|
59
|
+
for (const row of result.data) {
|
|
60
|
+
// Skip malformed elements (`null`, primitives, missing/invalid pubkey)
|
|
61
|
+
// rather than letting a field access throw — the never-throw contract.
|
|
62
|
+
if (typeof row !== 'object' || row === null) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const votePubkey = asTrimmedString(row.vote_identity);
|
|
66
|
+
if (votePubkey && requested.has(votePubkey)) {
|
|
67
|
+
map[votePubkey] = toMetadata(row);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return map;
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=stakewizProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stakewizProvider.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains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AAC,CAAA;YAC3D,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WalletCore } from '@trustwallet/wallet-core';
|
|
2
|
+
import { SolanaStakingPayload } from './stakingPayload.js';
|
|
3
|
+
type BuildUnsignedStakingTxInput = {
|
|
4
|
+
walletCore: WalletCore;
|
|
5
|
+
payload: SolanaStakingPayload;
|
|
6
|
+
/** The signer's Solana address (fee payer / stake authority). */
|
|
7
|
+
sender: string;
|
|
8
|
+
/** The signer's ed25519 public key, hex-encoded. */
|
|
9
|
+
hexPublicKey: string;
|
|
10
|
+
recentBlockHash: string;
|
|
11
|
+
priorityFeePrice: bigint;
|
|
12
|
+
priorityFeeLimit: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Compiles the unsigned staking transaction (zero-signature envelope) and
|
|
16
|
+
* returns it base64-encoded. This is the byte-parity contract for native
|
|
17
|
+
* staking: the initiating device builds these bytes once — pinning the recent
|
|
18
|
+
* blockhash and the wallet-core-derived stake-account address — and relays them
|
|
19
|
+
* via `SignSolana.rawTransactions`. Every co-signing device then signs the
|
|
20
|
+
* IDENTICAL message bytes through the raw-transaction path, so no device
|
|
21
|
+
* rebuilds the input from a non-round-tripped staking payload.
|
|
22
|
+
*
|
|
23
|
+
* Port of iOS `SolanaHelper.buildStakingUnsignedTransaction`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const buildUnsignedStakingTx: ({ walletCore, payload, sender, hexPublicKey, recentBlockHash, priorityFeePrice, priorityFeeLimit, }: BuildUnsignedStakingTxInput) => string;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=buildUnsignedStakingTx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildUnsignedStakingTx.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/tx/buildUnsignedStakingTx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAIzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAEvD,KAAK,2BAA2B,GAAG;IACjC,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,oBAAoB,CAAA;IAC7B,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAiDD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GAAI,qGAQpC,2BAA2B,KAAG,MAuChC,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { TW } from '@trustwallet/wallet-core';
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
3
|
+
import Long from 'long';
|
|
4
|
+
const toLong = (value) => Long.fromString(value.toString());
|
|
5
|
+
/**
|
|
6
|
+
* Maps a staking payload to the wallet-core `SigningInput` transaction-type
|
|
7
|
+
* oneof:
|
|
8
|
+
* - delegate: `delegateStakeTransaction` (stake account omitted →
|
|
9
|
+
* wallet-core derives it; emits create+initialize+
|
|
10
|
+
* delegate in one tx)
|
|
11
|
+
* - unstake / move-deactivate: `deactivateStakeTransaction` (existing account)
|
|
12
|
+
* - withdraw: `withdrawTransaction` (existing account + amount)
|
|
13
|
+
* - move-redelegate: `delegateStakeTransaction` with the existing account
|
|
14
|
+
* set EXPLICITLY (re-delegate, don't derive a new one)
|
|
15
|
+
*/
|
|
16
|
+
const transactionTypeFields = (payload) => {
|
|
17
|
+
switch (payload.op) {
|
|
18
|
+
case 'delegate':
|
|
19
|
+
return {
|
|
20
|
+
delegateStakeTransaction: TW.Solana.Proto.DelegateStake.create({
|
|
21
|
+
validatorPubkey: payload.votePubkey,
|
|
22
|
+
value: toLong(payload.lamports),
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
case 'unstake':
|
|
26
|
+
case 'moveStakeDeactivate':
|
|
27
|
+
return {
|
|
28
|
+
deactivateStakeTransaction: TW.Solana.Proto.DeactivateStake.create({
|
|
29
|
+
stakeAccount: payload.stakeAccount,
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
case 'withdraw':
|
|
33
|
+
return {
|
|
34
|
+
withdrawTransaction: TW.Solana.Proto.WithdrawStake.create({
|
|
35
|
+
stakeAccount: payload.stakeAccount,
|
|
36
|
+
value: toLong(payload.lamports),
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
39
|
+
case 'moveStakeRedelegate':
|
|
40
|
+
return {
|
|
41
|
+
delegateStakeTransaction: TW.Solana.Proto.DelegateStake.create({
|
|
42
|
+
validatorPubkey: payload.votePubkey,
|
|
43
|
+
value: toLong(payload.lamports),
|
|
44
|
+
stakeAccount: payload.stakeAccount,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Compiles the unsigned staking transaction (zero-signature envelope) and
|
|
51
|
+
* returns it base64-encoded. This is the byte-parity contract for native
|
|
52
|
+
* staking: the initiating device builds these bytes once — pinning the recent
|
|
53
|
+
* blockhash and the wallet-core-derived stake-account address — and relays them
|
|
54
|
+
* via `SignSolana.rawTransactions`. Every co-signing device then signs the
|
|
55
|
+
* IDENTICAL message bytes through the raw-transaction path, so no device
|
|
56
|
+
* rebuilds the input from a non-round-tripped staking payload.
|
|
57
|
+
*
|
|
58
|
+
* Port of iOS `SolanaHelper.buildStakingUnsignedTransaction`.
|
|
59
|
+
*/
|
|
60
|
+
export const buildUnsignedStakingTx = ({ walletCore, payload, sender, hexPublicKey, recentBlockHash, priorityFeePrice, priorityFeeLimit, }) => {
|
|
61
|
+
const input = TW.Solana.Proto.SigningInput.create({
|
|
62
|
+
v0Msg: true,
|
|
63
|
+
recentBlockhash: recentBlockHash,
|
|
64
|
+
sender,
|
|
65
|
+
priorityFeePrice: TW.Solana.Proto.PriorityFeePrice.create({
|
|
66
|
+
price: toLong(priorityFeePrice),
|
|
67
|
+
}),
|
|
68
|
+
priorityFeeLimit: TW.Solana.Proto.PriorityFeeLimit.create({
|
|
69
|
+
limit: priorityFeeLimit,
|
|
70
|
+
}),
|
|
71
|
+
...transactionTypeFields(payload),
|
|
72
|
+
});
|
|
73
|
+
const inputData = TW.Solana.Proto.SigningInput.encode(input).finish();
|
|
74
|
+
// Compile a zero-signature envelope: a single 64-byte zero signature plus the
|
|
75
|
+
// signer's public key, exactly as iOS does. The compiler assembles the wire
|
|
76
|
+
// message with the placeholder signature; peers re-sign the relayed bytes.
|
|
77
|
+
const signatures = walletCore.DataVector.create();
|
|
78
|
+
signatures.add(new Uint8Array(64));
|
|
79
|
+
const publicKeys = walletCore.DataVector.create();
|
|
80
|
+
publicKeys.add(Buffer.from(hexPublicKey, 'hex'));
|
|
81
|
+
const compiled = walletCore.TransactionCompiler.compileWithSignatures(walletCore.CoinType.solana, inputData, signatures, publicKeys);
|
|
82
|
+
const output = TW.Solana.Proto.SigningOutput.decode(compiled);
|
|
83
|
+
if (output.errorMessage) {
|
|
84
|
+
throw new Error(`solana staking compile failed: ${output.errorMessage}`);
|
|
85
|
+
}
|
|
86
|
+
// WalletCore emits base58 (the signing input never sets `txEncoding`).
|
|
87
|
+
// Normalize to base64 — the encoding `SignSolana.rawTransactions` and the
|
|
88
|
+
// raw-signing path consume.
|
|
89
|
+
const txBytes = walletCore.Base58.decodeNoCheck(output.encoded);
|
|
90
|
+
return Buffer.from(txBytes).toString('base64');
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=buildUnsignedStakingTx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildUnsignedStakingTx.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/tx/buildUnsignedStakingTx.ts"],"names":[],"mappings":"AAAA,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ACnE,UAAU,CAAC,QAAQ,CAAC,MAAM,EAC1B,SAAS,EACT,UAAU,EACV,UAAU,CACX,CAAA;IACD,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC7D,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,kCAAkC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAA;IAC1E,CAAC;IAED,uEAAuE;IACvE,0EAA0E;IAC1E,4BAA4B;IAC5B,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC/D,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAChD,CAAC,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carries the Solana staking-operation intent from the build-keysign step into
|
|
3
|
+
* the byte-parity unsigned-tx builder (wallet-core's Solana stake proto:
|
|
4
|
+
* delegate / deactivate / withdraw / move-stake).
|
|
5
|
+
*
|
|
6
|
+
* A move-stake (redelegate A → B) is a guided, multi-transaction, cross-epoch
|
|
7
|
+
* flow — Solana has no native redelegate. It decomposes into discrete sub-steps
|
|
8
|
+
* mapped onto existing wallet-core primitives so the cross-device byte-parity
|
|
9
|
+
* guarantee holds:
|
|
10
|
+
* - `moveStakeDeactivate` → DeactivateStake on the moved account (byte-
|
|
11
|
+
* identical to a plain unstake); begins the ~1-epoch cooldown.
|
|
12
|
+
* - `moveStakeRedelegate` → DelegateStake the now-inactive moved account to
|
|
13
|
+
* validator B, with the existing `stakeAccount` set EXPLICITLY (a fresh
|
|
14
|
+
* delegate omits it so wallet-core derives a new account).
|
|
15
|
+
* - The Stake-program `Split` instruction (a partial move) is not exposed by
|
|
16
|
+
* wallet-core's high-level Solana proto, so only whole-account moves are
|
|
17
|
+
* supported.
|
|
18
|
+
*
|
|
19
|
+
* Port of iOS `SolanaStakingPayload`.
|
|
20
|
+
*/
|
|
21
|
+
export type SolanaStakingPayload = {
|
|
22
|
+
op: 'delegate';
|
|
23
|
+
votePubkey: string;
|
|
24
|
+
lamports: bigint;
|
|
25
|
+
} | {
|
|
26
|
+
op: 'unstake';
|
|
27
|
+
stakeAccount: string;
|
|
28
|
+
} | {
|
|
29
|
+
op: 'withdraw';
|
|
30
|
+
stakeAccount: string;
|
|
31
|
+
lamports: bigint;
|
|
32
|
+
} | {
|
|
33
|
+
op: 'moveStakeDeactivate';
|
|
34
|
+
stakeAccount: string;
|
|
35
|
+
} | {
|
|
36
|
+
op: 'moveStakeRedelegate';
|
|
37
|
+
stakeAccount: string;
|
|
38
|
+
votePubkey: string;
|
|
39
|
+
lamports: bigint;
|
|
40
|
+
};
|
|
41
|
+
/** Discriminant union of every Solana staking op type. */
|
|
42
|
+
export declare const solanaStakingOps: readonly ["delegate", "unstake", "withdraw", "moveStakeDeactivate", "moveStakeRedelegate"];
|
|
43
|
+
export type SolanaStakingOp = (typeof solanaStakingOps)[number];
|
|
44
|
+
//# sourceMappingURL=stakingPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stakingPayload.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/tx/stakingPayload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,EAAE,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,EAAE,EAAE,qBAAqB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACnD;IACE,EAAE,EAAE,qBAAqB,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAEL,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,4FAMnB,CAAA;AAEV,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stakingPayload.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/solana/staking/tx/stakingPayload.ts"],"names":[],"mappings":"AAgCA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU;IACV,SAAS;IACT,UAAU;IACV,qBAAqB;IACrB,qBAAqB;CACb,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/tx/broadcast/resolvers/solana.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/tx/broadcast/resolvers/solana.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAMvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AA2BjD,eAAO,MAAM,iBAAiB,EAAE,mBAAmB,CAAC,UAAU,CAAC,MAAM,CA+CpE,CAAA"}
|
|
@@ -1,8 +1,30 @@
|
|
|
1
|
+
import { SendTransactionError } from '@solana/web3.js';
|
|
1
2
|
import { getSolanaClient } from '@vultisig/core-chain/chains/solana/client';
|
|
2
3
|
import { sendJitoTransaction } from '@vultisig/core-chain/chains/solana/jito';
|
|
3
4
|
import { isInError } from '@vultisig/lib-utils/error/isInError';
|
|
4
5
|
import base58 from 'bs58';
|
|
5
6
|
import { verifyBroadcastByHash } from '../verifyBroadcastByHash.js';
|
|
7
|
+
/**
|
|
8
|
+
* Hoists the on-chain rejection reason into a Solana send error's message.
|
|
9
|
+
*
|
|
10
|
+
* On a preflight rejection the RPC returns the actionable detail in
|
|
11
|
+
* `data.err` / `data.logs` (the program logs), which `web3.js` exposes via
|
|
12
|
+
* `SendTransactionError.logs`. The bare `.message` ("failed to send
|
|
13
|
+
* transaction") hides it, so any consumer reading only the top-level message
|
|
14
|
+
* loses the reason. Fold the program logs into the message — preserving the
|
|
15
|
+
* original error as `cause` — so the real reason ("insufficient lamports",
|
|
16
|
+
* "custom program error: 0x1", a failed instruction) reaches the surface.
|
|
17
|
+
*/
|
|
18
|
+
const withSolanaBroadcastReason = (error) => {
|
|
19
|
+
if (!(error instanceof SendTransactionError)) {
|
|
20
|
+
return error;
|
|
21
|
+
}
|
|
22
|
+
const { logs } = error;
|
|
23
|
+
if (!logs || logs.length === 0) {
|
|
24
|
+
return error;
|
|
25
|
+
}
|
|
26
|
+
return new Error([error.message, ...logs].join('\n'), { cause: error });
|
|
27
|
+
};
|
|
6
28
|
export const broadcastSolanaTx = async ({ chain, tx }) => {
|
|
7
29
|
const rawTransaction = base58.decode(tx.encoded);
|
|
8
30
|
// Try JITO first for MEV protection, but still relay through standard RPC.
|
|
@@ -44,7 +66,11 @@ export const broadcastSolanaTx = async ({ chain, tx }) => {
|
|
|
44
66
|
if (isInError(error, 'already been processed', 'AlreadyProcessed')) {
|
|
45
67
|
return;
|
|
46
68
|
}
|
|
47
|
-
await verifyBroadcastByHash({
|
|
69
|
+
await verifyBroadcastByHash({
|
|
70
|
+
chain,
|
|
71
|
+
tx,
|
|
72
|
+
error: withSolanaBroadcastReason(error),
|
|
73
|
+
});
|
|
48
74
|
}
|
|
49
75
|
};
|
|
50
76
|
//# sourceMappingURL=solana.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/tx/broadcast/resolvers/solana.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/tx/broadcast/resolvers/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAA;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAC/D,OAAO,MAAM,MAAM,MAAM,CAAA;AAGzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE;;;;;;;;;;GAUG;AACH,MAAM,yBAAyB,GAAG,CAAC,KAAc,EAAW,EAAE;IAC5D,IAAI,CAAC,CAAC,KAAK,YAAY,oBAAoB,CAAC,EAAE,CAAC;QAC7C,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAA;IACtB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;AACzE,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAA2C,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE;IAC/F,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;IAEhD,2EAA2E;IAC3E,2EAA2E;IAC3E,4EAA4E;IAC5E,IAAI,CAAC;QACH,MAAM,mBAAmB,CAAC,cAAc,CAAC,CAAA;IAC3C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,qEAAqE,EAAE,GAAG,CAAC,CAAA;IAC1F,CAAC;IAED,MAAM,MAAM,GAAG,eAAe,EAAE,CAAA;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,kBAAkB,CAAC,cAAc,EAAE;YAC9C,aAAa,EAAE,KAAK;YACpB,mBAAmB,EAAE,WAAW;SACjC,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,yEAAyE;QACzE,sEAAsE;QACtE,oEAAoE;QACpE,oEAAoE;QACpE,wEAAwE;QACxE,EAAE;QACF,wEAAwE;QACxE,0EAA0E;QAC1E,0EAA0E;QAC1E,gEAAgE;QAChE,sEAAsE;QACtE,yEAAyE;QACzE,0EAA0E;QAC1E,wEAAwE;QACxE,2EAA2E;QAC3E,2DAA2D;QAC3D,uEAAuE;QACvE,uEAAuE;QACvE,mEAAmE;QACnE,IAAI,SAAS,CAAC,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,CAAC,EAAE,CAAC;YACnE,OAAM;QACR,CAAC;QACD,MAAM,qBAAqB,CAAC;YAC1B,KAAK;YACL,EAAE;YACF,KAAK,EAAE,yBAAyB,CAAC,KAAK,CAAC;SACxC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vultisig/core-chain",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.0",
|
|
4
4
|
"description": "Blockchain chain logic shared across Vultisig clients",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -690,6 +690,21 @@
|
|
|
690
690
|
"import": "./dist/chains/solana/staking/cooldownGate.js",
|
|
691
691
|
"default": "./dist/chains/solana/staking/cooldownGate.js"
|
|
692
692
|
},
|
|
693
|
+
"./chains/solana/staking/metadata/enrichValidators": {
|
|
694
|
+
"types": "./dist/chains/solana/staking/metadata/enrichValidators.d.ts",
|
|
695
|
+
"import": "./dist/chains/solana/staking/metadata/enrichValidators.js",
|
|
696
|
+
"default": "./dist/chains/solana/staking/metadata/enrichValidators.js"
|
|
697
|
+
},
|
|
698
|
+
"./chains/solana/staking/metadata/stakewizProvider": {
|
|
699
|
+
"types": "./dist/chains/solana/staking/metadata/stakewizProvider.d.ts",
|
|
700
|
+
"import": "./dist/chains/solana/staking/metadata/stakewizProvider.js",
|
|
701
|
+
"default": "./dist/chains/solana/staking/metadata/stakewizProvider.js"
|
|
702
|
+
},
|
|
703
|
+
"./chains/solana/staking/metadata/ValidatorMetadataProvider": {
|
|
704
|
+
"types": "./dist/chains/solana/staking/metadata/ValidatorMetadataProvider.d.ts",
|
|
705
|
+
"import": "./dist/chains/solana/staking/metadata/ValidatorMetadataProvider.js",
|
|
706
|
+
"default": "./dist/chains/solana/staking/metadata/ValidatorMetadataProvider.js"
|
|
707
|
+
},
|
|
693
708
|
"./chains/solana/staking/models/stakeAccount": {
|
|
694
709
|
"types": "./dist/chains/solana/staking/models/stakeAccount.d.ts",
|
|
695
710
|
"import": "./dist/chains/solana/staking/models/stakeAccount.js",
|
|
@@ -705,6 +720,16 @@
|
|
|
705
720
|
"import": "./dist/chains/solana/staking/rpc.js",
|
|
706
721
|
"default": "./dist/chains/solana/staking/rpc.js"
|
|
707
722
|
},
|
|
723
|
+
"./chains/solana/staking/tx/buildUnsignedStakingTx": {
|
|
724
|
+
"types": "./dist/chains/solana/staking/tx/buildUnsignedStakingTx.d.ts",
|
|
725
|
+
"import": "./dist/chains/solana/staking/tx/buildUnsignedStakingTx.js",
|
|
726
|
+
"default": "./dist/chains/solana/staking/tx/buildUnsignedStakingTx.js"
|
|
727
|
+
},
|
|
728
|
+
"./chains/solana/staking/tx/stakingPayload": {
|
|
729
|
+
"types": "./dist/chains/solana/staking/tx/stakingPayload.d.ts",
|
|
730
|
+
"import": "./dist/chains/solana/staking/tx/stakingPayload.js",
|
|
731
|
+
"default": "./dist/chains/solana/staking/tx/stakingPayload.js"
|
|
732
|
+
},
|
|
708
733
|
"./chains/sui/buildTransactionFromJson": {
|
|
709
734
|
"types": "./dist/chains/sui/buildTransactionFromJson.d.ts",
|
|
710
735
|
"import": "./dist/chains/sui/buildTransactionFromJson.js",
|
|
@@ -1994,7 +2019,7 @@
|
|
|
1994
2019
|
"@cosmjs/proto-signing": "^0.39.0",
|
|
1995
2020
|
"@cosmjs/stargate": "^0.39.0",
|
|
1996
2021
|
"@lifi/sdk": "^4.0.0",
|
|
1997
|
-
"@mysten/sui": "^2.
|
|
2022
|
+
"@mysten/sui": "^2.20.1",
|
|
1998
2023
|
"@noble/hashes": "^1.8.0",
|
|
1999
2024
|
"@polkadot/api": "^16.5.6",
|
|
2000
2025
|
"@polkadot/util": "^14.0.3",
|
|
@@ -2013,8 +2038,9 @@
|
|
|
2013
2038
|
"cbor-x": "^1.6.4",
|
|
2014
2039
|
"date-fns": "^4.4.0",
|
|
2015
2040
|
"ethers": "^6.17.0",
|
|
2041
|
+
"long": "^5.3.2",
|
|
2016
2042
|
"tiny-secp256k1": "^2.2.4",
|
|
2017
|
-
"viem": "^2.
|
|
2043
|
+
"viem": "^2.53.1",
|
|
2018
2044
|
"xrpl": "^5.0.0"
|
|
2019
2045
|
}
|
|
2020
2046
|
}
|