@molpha/sdk 0.2.0-dev-20261002062009 → 0.2.0-dev-20261005112114
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/README.md +31 -14
- package/dist/index.d.ts +82 -41
- package/dist/index.js +111 -80
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/{wallet-HfGXPpOp.d.ts → wallet-LqCFWwV4.d.ts} +13 -11
- package/idl/molpha.json +8 -8
- package/package.json +1 -1
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Wallet } from '@anchor-lang/core';
|
|
2
|
-
import { r as SolanaKeypair, M as MolphaWallet } from './wallet-
|
|
2
|
+
import { r as SolanaKeypair, M as MolphaWallet } from './wallet-LqCFWwV4.js';
|
|
3
3
|
import '@solana/kit';
|
|
4
4
|
|
|
5
5
|
/** Load a Solana CLI keypair JSON file (array of 64 bytes) into a `Keypair`. */
|
|
@@ -17,21 +17,23 @@ interface Node {
|
|
|
17
17
|
/** Node secp256k1 public key (hex). Used for ECDH config encryption. */
|
|
18
18
|
signingKey: string;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Node-key material that must be authenticated before private API encryption. Secrets are
|
|
22
|
+
* encrypted for every node of the registry, because the committee is not known until the
|
|
23
|
+
* gateway has assigned the round's timestamp.
|
|
24
|
+
*/
|
|
21
25
|
interface NodeKeyVerifierArgs {
|
|
22
26
|
/** 32-byte source id, hex. */
|
|
23
27
|
sourceId: string;
|
|
24
28
|
/** On-chain registry version the gateway round is bound to. */
|
|
25
29
|
registryVersion: number;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
/** Gateway-provided selected nodes whose keys must be authenticated. */
|
|
31
|
-
selectedNodes: readonly Node[];
|
|
30
|
+
/** Every node index of that registry version, ascending. */
|
|
31
|
+
nodeIndexes: readonly number[];
|
|
32
|
+
/** Gateway-provided nodes, one per index, whose keys must be authenticated. */
|
|
33
|
+
nodes: readonly Node[];
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
|
-
* Authenticates
|
|
36
|
+
* Authenticates gateway-provided node encryption keys. Throwing fails the
|
|
35
37
|
* private API request before secrets are encrypted or posted.
|
|
36
38
|
*/
|
|
37
39
|
type NodeKeyVerifier = (args: NodeKeyVerifierArgs) => void | Promise<void>;
|
|
@@ -121,8 +123,8 @@ interface AttestationPayload {
|
|
|
121
123
|
sourceId: string;
|
|
122
124
|
registryVersion: number;
|
|
123
125
|
signaturesRequired: number;
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
+
/** Gateway-assigned round time in unix MILLISECONDS (u64). Divide by 1000 for seconds. */
|
|
127
|
+
timestamp: number;
|
|
126
128
|
}
|
|
127
129
|
/**
|
|
128
130
|
* Threshold-signed oracle attestation from a completed gateway round, ready to submit on-chain.
|
|
@@ -224,7 +226,7 @@ type SolanaAccountMeta = {
|
|
|
224
226
|
};
|
|
225
227
|
|
|
226
228
|
/**
|
|
227
|
-
* Unified wallet surface: Anchor txs +
|
|
229
|
+
* Unified wallet surface: Anchor txs + gateway request-auth signing.
|
|
228
230
|
*/
|
|
229
231
|
|
|
230
232
|
/** Anchor `Wallet` plus optional gateway auth override. */
|
package/idl/molpha.json
CHANGED
|
@@ -4629,7 +4629,7 @@
|
|
|
4629
4629
|
{
|
|
4630
4630
|
"code": 6030,
|
|
4631
4631
|
"name": "FeedNotNewer",
|
|
4632
|
-
"msg": "
|
|
4632
|
+
"msg": "timestamp <= feed.timestamp"
|
|
4633
4633
|
},
|
|
4634
4634
|
{
|
|
4635
4635
|
"code": 6031,
|
|
@@ -4774,12 +4774,12 @@
|
|
|
4774
4774
|
{
|
|
4775
4775
|
"code": 6059,
|
|
4776
4776
|
"name": "AttestationTooStale",
|
|
4777
|
-
"msg": "
|
|
4777
|
+
"msg": "timestamp is older than now - max_settlement_delay_seconds"
|
|
4778
4778
|
},
|
|
4779
4779
|
{
|
|
4780
4780
|
"code": 6060,
|
|
4781
4781
|
"name": "AttestationInFuture",
|
|
4782
|
-
"msg": "
|
|
4782
|
+
"msg": "timestamp is further ahead of cluster time than the allowed drift"
|
|
4783
4783
|
},
|
|
4784
4784
|
{
|
|
4785
4785
|
"code": 6061,
|
|
@@ -4904,7 +4904,7 @@
|
|
|
4904
4904
|
{
|
|
4905
4905
|
"code": 6085,
|
|
4906
4906
|
"name": "RoundOutsideEpoch",
|
|
4907
|
-
"msg": "
|
|
4907
|
+
"msg": "timestamp is outside the epoch window"
|
|
4908
4908
|
},
|
|
4909
4909
|
{
|
|
4910
4910
|
"code": 6086,
|
|
@@ -5061,7 +5061,7 @@
|
|
|
5061
5061
|
"type": "u8"
|
|
5062
5062
|
},
|
|
5063
5063
|
{
|
|
5064
|
-
"name": "
|
|
5064
|
+
"name": "timestamp",
|
|
5065
5065
|
"type": "u64"
|
|
5066
5066
|
}
|
|
5067
5067
|
]
|
|
@@ -5712,7 +5712,7 @@
|
|
|
5712
5712
|
"type": "pubkey"
|
|
5713
5713
|
},
|
|
5714
5714
|
{
|
|
5715
|
-
"name": "
|
|
5715
|
+
"name": "timestamp",
|
|
5716
5716
|
"type": "u64"
|
|
5717
5717
|
},
|
|
5718
5718
|
{
|
|
@@ -5758,7 +5758,7 @@
|
|
|
5758
5758
|
"type": "u32"
|
|
5759
5759
|
},
|
|
5760
5760
|
{
|
|
5761
|
-
"name": "
|
|
5761
|
+
"name": "timestamp",
|
|
5762
5762
|
"type": "u64"
|
|
5763
5763
|
},
|
|
5764
5764
|
{
|
|
@@ -6813,7 +6813,7 @@
|
|
|
6813
6813
|
{
|
|
6814
6814
|
"name": "max_settlement_delay_seconds",
|
|
6815
6815
|
"docs": [
|
|
6816
|
-
"Max age in seconds of `
|
|
6816
|
+
"Max age in seconds of `timestamp` relative to cluster time at attestation",
|
|
6817
6817
|
"ingress, and the grace period of a superseded registry version."
|
|
6818
6818
|
],
|
|
6819
6819
|
"type": "u64"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molpha/sdk",
|
|
3
|
-
"version": "0.2.0-dev-
|
|
3
|
+
"version": "0.2.0-dev-20261005112114",
|
|
4
4
|
"description": "Molpha Consumer SDK — subscribe, request signed data from the gateway, submit attestations and read on-chain feeds.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|