@palliora.org/chainsdk 0.4.0 → 0.5.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/AGENTS.md +61 -0
- package/CHAIN-RULES.md +760 -0
- package/README.md +161 -26
- package/dist/index.cjs +1313 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1311 -24
- package/dist/index.d.ts +1311 -24
- package/dist/index.js +1282 -93
- package/dist/index.js.map +1 -1
- package/package.json +20 -11
package/dist/index.d.ts
CHANGED
|
@@ -39,8 +39,37 @@ declare enum AccountSourceType {
|
|
|
39
39
|
* @returns The keypair object.
|
|
40
40
|
*/
|
|
41
41
|
declare function createAccount(input: string, type: AccountSourceType, name?: string, cryptoType?: CryptoType, signedMsg?: string): Promise<KeyringPair>;
|
|
42
|
+
/**
|
|
43
|
+
* Derives a Substrate account from a Magic Link (or other Ethereum-compatible)
|
|
44
|
+
* signature over the fixed message `createAccount` expects for signature-derived
|
|
45
|
+
* accounts, wiring passwordless/email-based onboarding into the existing
|
|
46
|
+
* `AccountSourceType.DERIVED` flow.
|
|
47
|
+
*
|
|
48
|
+
* @param signature - Hex-encoded signature (0x-prefixed) produced by the Magic Link signer.
|
|
49
|
+
*/
|
|
50
|
+
declare function createAccountFromMagicLink(signature: string, name?: string, cryptoType?: CryptoType): Promise<KeyringPair>;
|
|
42
51
|
declare function pairFromPrivateKeyHex(privateKeyHex: string, cryptoType: CryptoType): _polkadot_util_crypto_types.Keypair;
|
|
43
52
|
|
|
53
|
+
interface Balance {
|
|
54
|
+
free: bigint;
|
|
55
|
+
reserved: bigint;
|
|
56
|
+
frozen: bigint;
|
|
57
|
+
/** Free balance formatted with the chain's token symbol/decimals, e.g. "1.5 PALI". */
|
|
58
|
+
formatted: string;
|
|
59
|
+
}
|
|
60
|
+
/** Reads an account's free/reserved/frozen balance from `system.account`. */
|
|
61
|
+
declare function getBalance(address: string): Promise<Balance>;
|
|
62
|
+
|
|
63
|
+
interface AccountInfo {
|
|
64
|
+
address: string;
|
|
65
|
+
nonce: number;
|
|
66
|
+
balance: Balance;
|
|
67
|
+
/** On-chain identity display name, or `null` if none is set. */
|
|
68
|
+
displayName: string | null;
|
|
69
|
+
}
|
|
70
|
+
/** Convenience read combining balance, nonce, and identity display name for a single account. */
|
|
71
|
+
declare function getAccountInfo(address: string): Promise<AccountInfo>;
|
|
72
|
+
|
|
44
73
|
declare const API_RPC: {
|
|
45
74
|
kate: {
|
|
46
75
|
queryRows: {
|
|
@@ -299,6 +328,7 @@ declare const API_TYPES: {
|
|
|
299
328
|
Dataset: string;
|
|
300
329
|
Model: string;
|
|
301
330
|
Agent: string;
|
|
331
|
+
Executable: string;
|
|
302
332
|
Other: string;
|
|
303
333
|
};
|
|
304
334
|
};
|
|
@@ -348,13 +378,16 @@ declare const API_TYPES: {
|
|
|
348
378
|
fhe: string;
|
|
349
379
|
zkp: string;
|
|
350
380
|
};
|
|
381
|
+
ComputeType: {
|
|
382
|
+
_enum: string[];
|
|
383
|
+
};
|
|
351
384
|
GuardianPrefs: {
|
|
352
385
|
pubKey: string;
|
|
353
386
|
guardian: string;
|
|
354
387
|
verifier: string;
|
|
355
388
|
compute: string;
|
|
356
389
|
computePrefs: string;
|
|
357
|
-
|
|
390
|
+
feeThresholds: string;
|
|
358
391
|
};
|
|
359
392
|
BlockLengthColumns: string;
|
|
360
393
|
BlockLengthRows: string;
|
|
@@ -614,7 +647,7 @@ interface UploadOptions {
|
|
|
614
647
|
name: string;
|
|
615
648
|
description: string;
|
|
616
649
|
price: PaliAmountInput;
|
|
617
|
-
type: "model" | "dataset" | "agent";
|
|
650
|
+
type: "model" | "dataset" | "agent" | "executable";
|
|
618
651
|
guardianGroupInfo: GuardianGroupInfo;
|
|
619
652
|
ref?: string;
|
|
620
653
|
filePath?: string;
|
|
@@ -728,8 +761,8 @@ declare const FileFromMetadataRef: (mcryptApi: any, metadataRef: [number, number
|
|
|
728
761
|
* Returns the singleton {@link ApiPromise} instance, creating it if necessary.
|
|
729
762
|
*
|
|
730
763
|
* @remarks
|
|
731
|
-
* -
|
|
732
|
-
*
|
|
764
|
+
* - Throws if the SDK has not been initialized with a `pallioraWs` endpoint
|
|
765
|
+
* (see `init` in "../config").
|
|
733
766
|
* - When creating the API, the configured `rpc`, `types` and `signedExtensions`
|
|
734
767
|
* are applied.
|
|
735
768
|
* - In non-test environments, top-level API `error` and `disconnected` events
|
|
@@ -738,9 +771,19 @@ declare const FileFromMetadataRef: (mcryptApi: any, metadataRef: [number, number
|
|
|
738
771
|
*
|
|
739
772
|
* @param cb - Optional callback function to attach to the "disconnected" event.
|
|
740
773
|
*
|
|
741
|
-
* @returns The singleton {@link ApiPromise} instance
|
|
774
|
+
* @returns The singleton {@link ApiPromise} instance.
|
|
775
|
+
*/
|
|
776
|
+
declare function getApi(cb?: () => void): Promise<ApiPromise>;
|
|
777
|
+
/**
|
|
778
|
+
* disconnectApi()
|
|
779
|
+
*
|
|
780
|
+
* Tears down the singleton {@link ApiPromise} instance, if one exists.
|
|
781
|
+
*
|
|
782
|
+
* @remarks
|
|
783
|
+
* Safe to call when no API has been created yet (no-op). After this resolves,
|
|
784
|
+
* the next call to {@link getApi} creates a fresh instance.
|
|
742
785
|
*/
|
|
743
|
-
declare function
|
|
786
|
+
declare function disconnectApi(): Promise<void>;
|
|
744
787
|
/**
|
|
745
788
|
* getKeyring()
|
|
746
789
|
*
|
|
@@ -803,6 +846,30 @@ interface SubmissionReceipt {
|
|
|
803
846
|
/** Zero-based index of the result extrinsic within the block. */
|
|
804
847
|
extrinsicIndex: number;
|
|
805
848
|
}
|
|
849
|
+
/** Union of `AgreementStatus` variant names, read straight off {@link API_TYPES} (chain/spec.ts). */
|
|
850
|
+
type AgreementStatus = keyof typeof API_TYPES.AgreementStatus._enum;
|
|
851
|
+
/** Union of `ContractType` variant names, read straight off {@link API_TYPES} (chain/spec.ts). */
|
|
852
|
+
type ContractType = keyof typeof API_TYPES.ContractType._enum;
|
|
853
|
+
/**
|
|
854
|
+
* On-chain record for an agreement/contract, read back from `compute.agreementsInfo`.
|
|
855
|
+
* Mirrors the `ContractInfo` type registered in {@link API_TYPES} (chain/spec.ts).
|
|
856
|
+
*/
|
|
857
|
+
interface ContractInfo {
|
|
858
|
+
/** Current settlement status of the agreement. */
|
|
859
|
+
status: AgreementStatus;
|
|
860
|
+
/** Address of the account that owns the contract. */
|
|
861
|
+
owner: string;
|
|
862
|
+
/** Block number at which the contract originated. */
|
|
863
|
+
originBlock: number;
|
|
864
|
+
/** Block number at which the contract was last invoked. */
|
|
865
|
+
invocationBlock: number;
|
|
866
|
+
/** Sequential index assigned to the agreement. */
|
|
867
|
+
index: number;
|
|
868
|
+
/** Usage price charged per invocation, in atomic units. */
|
|
869
|
+
usagePrice: bigint;
|
|
870
|
+
/** Contract lifecycle type. */
|
|
871
|
+
contractType: ContractType;
|
|
872
|
+
}
|
|
806
873
|
|
|
807
874
|
declare const signAndSend: (request: SubmittableExtrinsic<"promise">, account: KeyringPair, opts?: Record<string, unknown>) => Promise<{
|
|
808
875
|
blockNumber: number;
|
|
@@ -810,12 +877,36 @@ declare const signAndSend: (request: SubmittableExtrinsic<"promise">, account: K
|
|
|
810
877
|
hash: `0x${string}`;
|
|
811
878
|
tx_result: ISubmittableResult;
|
|
812
879
|
}>;
|
|
880
|
+
/**
|
|
881
|
+
* Retries {@link signAndSend} with exponential backoff, for RPC endpoints that
|
|
882
|
+
* intermittently drop connections or time out mid-submission.
|
|
883
|
+
*
|
|
884
|
+
* @param request Unsigned extrinsic to submit
|
|
885
|
+
* @param account Signing account
|
|
886
|
+
* @param opts Extra signer options, forwarded to `signAndSend` (see its defaults)
|
|
887
|
+
* @param retries Number of retry attempts after the initial try (default 3)
|
|
888
|
+
* @param backoffMs Base delay before the first retry; doubles each subsequent attempt (default 1000)
|
|
889
|
+
*/
|
|
890
|
+
declare const retrySignAndSend: (request: SubmittableExtrinsic<"promise">, account: KeyringPair, opts?: Record<string, unknown>, retries?: number, backoffMs?: number) => Promise<{
|
|
891
|
+
blockNumber: number;
|
|
892
|
+
index: number;
|
|
893
|
+
hash: `0x${string}`;
|
|
894
|
+
tx_result: ISubmittableResult;
|
|
895
|
+
}>;
|
|
813
896
|
declare const getFileMetadataCall: (api: ApiPromise, metadataRef: [number, number]) => Promise<_polkadot_types_types.CallBase<_polkadot_types_types.AnyTuple, _polkadot_types_interfaces.FunctionMetadataLatest>>;
|
|
814
897
|
declare const getGuardianAddress: () => Promise<{
|
|
815
898
|
peerid: string;
|
|
816
899
|
address: string;
|
|
817
900
|
}[]>;
|
|
818
901
|
declare const getGuardianNwParams: () => Promise<string>;
|
|
902
|
+
/**
|
|
903
|
+
* Reads back the on-chain record for an agreement/contract created via
|
|
904
|
+
* `createAgreement`, from `compute.contracts`.
|
|
905
|
+
*
|
|
906
|
+
* @param contractId - Hex-encoded agreement ID (as returned by `createAgreement`).
|
|
907
|
+
* @returns The decoded {@link ContractInfo}, or `null` if no contract exists for that ID.
|
|
908
|
+
*/
|
|
909
|
+
declare function getContractInfo(contractId: string): Promise<ContractInfo | null>;
|
|
819
910
|
/**
|
|
820
911
|
* Fetches the block at `blockHeight`, extracts the extrinsic at
|
|
821
912
|
* `extrinsicIndex`, and returns both the raw codec object and its human-readable
|
|
@@ -827,6 +918,11 @@ declare function fetchAndDecodeExtrinsic(blockHeight: number, extrinsicIndex: nu
|
|
|
827
918
|
raw: any;
|
|
828
919
|
decoded: Record<string, unknown>;
|
|
829
920
|
}>;
|
|
921
|
+
/**
|
|
922
|
+
* Finds the first event record matching `section`/`method` (case-insensitive)
|
|
923
|
+
* among a transaction's emitted events, e.g. `tx_result.events` from {@link signAndSend}.
|
|
924
|
+
*/
|
|
925
|
+
declare function findEvent(events: EventRecord[], section: string, method: string): EventRecord | undefined;
|
|
830
926
|
type BlockScanFilter = {
|
|
831
927
|
/** Pallet name, e.g. "dataAvailability" (case-insensitive) */
|
|
832
928
|
section: string;
|
|
@@ -867,6 +963,14 @@ type BlockScanResult = {
|
|
|
867
963
|
* @param maxBlocks Reject after scanning this many blocks; pass 0 to wait indefinitely (default 20)
|
|
868
964
|
*/
|
|
869
965
|
declare const scanForBlockEvent: (api: ApiPromise, filter: BlockScanFilter, startBlock?: number, maxBlocks?: number) => Promise<BlockScanResult>;
|
|
966
|
+
/**
|
|
967
|
+
* Resolves as soon as the next block header is produced. Useful as a plain
|
|
968
|
+
* polling tick, e.g. between rounds of a manual wait loop.
|
|
969
|
+
*/
|
|
970
|
+
declare function waitForNextBlock(): Promise<{
|
|
971
|
+
blockNumber: number;
|
|
972
|
+
blockHash: string;
|
|
973
|
+
}>;
|
|
870
974
|
/**
|
|
871
975
|
* Subscribes to new block headers and scans each block's extrinsics until a
|
|
872
976
|
* `compute.result` extrinsic matching `requestId` is found. Resolves with the
|
|
@@ -886,6 +990,24 @@ declare function watchForSubmissionReceipt(requestId: string, timeoutMs?: number
|
|
|
886
990
|
*/
|
|
887
991
|
declare function getAgreementCreatedRequestId(blockHeight: number, extrinsicIndex: number): Promise<string | null>;
|
|
888
992
|
|
|
993
|
+
interface LatestBlock {
|
|
994
|
+
height: number;
|
|
995
|
+
hash: string;
|
|
996
|
+
time: number;
|
|
997
|
+
validator: string;
|
|
998
|
+
eventsCount: number;
|
|
999
|
+
extrinsicsCount: number;
|
|
1000
|
+
}
|
|
1001
|
+
interface LatestBlocksResult {
|
|
1002
|
+
blocks: LatestBlock[];
|
|
1003
|
+
latestHeight: number;
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Newest on-chain blocks first, paged backward from the current tip.
|
|
1007
|
+
* Uses RPC rather than the indexer `/api/blocks` list.
|
|
1008
|
+
*/
|
|
1009
|
+
declare function getLatestBlocks(count: number, page?: number, apiInstance?: ApiPromise): Promise<LatestBlocksResult>;
|
|
1010
|
+
|
|
889
1011
|
/**
|
|
890
1012
|
* Converts a {@link Fee} into the on-chain `fees` / `computeRate` pair.
|
|
891
1013
|
* `computeRate` only has meaning for `Active` contracts (it drives dynamic
|
|
@@ -896,6 +1018,42 @@ declare function buildFee(fee?: Fee): {
|
|
|
896
1018
|
fees: bigint;
|
|
897
1019
|
computeRate: bigint;
|
|
898
1020
|
};
|
|
1021
|
+
/** Zero `H256` — the `groupId` of a contract that belongs to no guardian group. */
|
|
1022
|
+
declare const NO_GUARDIAN_GROUP: string;
|
|
1023
|
+
/**
|
|
1024
|
+
* Classification carried in `ComputeMetadata.storeType`.
|
|
1025
|
+
*
|
|
1026
|
+
* Mirrors `pallet_compute::StoreType` variant-for-variant via {@link API_TYPES}.
|
|
1027
|
+
* Order is the encoding: the variant index is what goes on the wire, so an
|
|
1028
|
+
* omitted or reordered variant silently shifts every one after it.
|
|
1029
|
+
*/
|
|
1030
|
+
type StoreType = keyof typeof API_TYPES.StoreType._enum;
|
|
1031
|
+
interface ComputeMetadataInput {
|
|
1032
|
+
/** Human-readable name of the registered artifact. */
|
|
1033
|
+
name: string;
|
|
1034
|
+
/** Human-readable description of the registered artifact. */
|
|
1035
|
+
description: string;
|
|
1036
|
+
/** What kind of artifact this is. */
|
|
1037
|
+
storeType: StoreType;
|
|
1038
|
+
/**
|
|
1039
|
+
* H256 of the guardian group this entry belongs to. Defaults to
|
|
1040
|
+
* {@link NO_GUARDIAN_GROUP} — correct for plaintext contracts, which have no
|
|
1041
|
+
* group. The chain stores this field but never reads it.
|
|
1042
|
+
*/
|
|
1043
|
+
groupId?: string;
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Converts a {@link ComputeMetadataInput} into the on-chain `ComputeMetadata`,
|
|
1047
|
+
* whose `name` and `description` are byte vectors rather than strings.
|
|
1048
|
+
* Returns `null` for absent metadata, which is what `Option<ComputeMetadata>`
|
|
1049
|
+
* expects.
|
|
1050
|
+
*/
|
|
1051
|
+
declare function buildComputeMetadata(metadata?: ComputeMetadataInput): {
|
|
1052
|
+
name: number[];
|
|
1053
|
+
description: number[];
|
|
1054
|
+
storeType: "Dataset" | "Model" | "Agent" | "Executable" | "Other";
|
|
1055
|
+
groupId: string;
|
|
1056
|
+
} | null;
|
|
899
1057
|
interface ComputeContract {
|
|
900
1058
|
contractType: "Active" | "Dormant";
|
|
901
1059
|
guardians: GuardianAddress[];
|
|
@@ -912,6 +1070,26 @@ declare function createAgreement(contract: ComputeContract, account: KeyringPair
|
|
|
912
1070
|
hash: string;
|
|
913
1071
|
agreementId?: string;
|
|
914
1072
|
}>;
|
|
1073
|
+
interface InvokeAgreementInput {
|
|
1074
|
+
/** Guardian account IDs handling the invocation; matches the agreement's guardian set. */
|
|
1075
|
+
guardians: GuardianAddress[];
|
|
1076
|
+
/** Cipher suite describing how `data` is encrypted. Use "Plaintext" for unencrypted payloads. */
|
|
1077
|
+
cipher: unknown;
|
|
1078
|
+
/** Invocation payload bytes (already encrypted if `cipher` is not "Plaintext"). */
|
|
1079
|
+
data: Uint8Array | number[];
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Invokes an existing `Subscription`-type agreement with a new payload, via
|
|
1083
|
+
* `compute.invoke`.
|
|
1084
|
+
*
|
|
1085
|
+
* @param agreementId - Hex-encoded agreement ID (as returned by `createAgreement`).
|
|
1086
|
+
*/
|
|
1087
|
+
declare function invokeAgreement(agreementId: string, input: InvokeAgreementInput, account: KeyringPair, opts?: Record<string, unknown>): Promise<{
|
|
1088
|
+
blockNumber: number;
|
|
1089
|
+
index: number;
|
|
1090
|
+
hash: `0x${string}`;
|
|
1091
|
+
tx_result: _polkadot_types_types.ISubmittableResult;
|
|
1092
|
+
}>;
|
|
915
1093
|
declare function createSimpleAgreement(): Promise<{
|
|
916
1094
|
blockNumber: number;
|
|
917
1095
|
index: number;
|
|
@@ -920,8 +1098,13 @@ declare function createSimpleAgreement(): Promise<{
|
|
|
920
1098
|
}>;
|
|
921
1099
|
|
|
922
1100
|
interface DataContractParams {
|
|
923
|
-
/** URL pointing to the data to store. */
|
|
924
|
-
url
|
|
1101
|
+
/** URL pointing to the data to store. Mutually exclusive with `data`. */
|
|
1102
|
+
url?: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* Bytes carried in the extrinsic itself, for payloads small enough not to
|
|
1105
|
+
* warrant off-chain hosting. Mutually exclusive with `url`.
|
|
1106
|
+
*/
|
|
1107
|
+
data?: string | Uint8Array;
|
|
925
1108
|
/** Guardian account IDs that participate in this contract. */
|
|
926
1109
|
guardians: string[];
|
|
927
1110
|
/**
|
|
@@ -930,6 +1113,13 @@ interface DataContractParams {
|
|
|
930
1113
|
* compute rate only applies to `Active` contracts.
|
|
931
1114
|
*/
|
|
932
1115
|
fee: Fee;
|
|
1116
|
+
/**
|
|
1117
|
+
* Describes the registered artifact — name, description, and the `storeType`
|
|
1118
|
+
* saying what kind of thing it is. Omitted metadata registers the contract
|
|
1119
|
+
* anonymously, which leaves nothing on-chain to tell a stored dataset from a
|
|
1120
|
+
* stored program.
|
|
1121
|
+
*/
|
|
1122
|
+
metadata?: ComputeMetadataInput;
|
|
933
1123
|
/** Block number deadline. Defaults to 0 (no deadline). */
|
|
934
1124
|
deadline?: number;
|
|
935
1125
|
/** Trusted guardian index in the guardians list. Defaults to 0. */
|
|
@@ -940,9 +1130,15 @@ interface DataContractParams {
|
|
|
940
1130
|
*
|
|
941
1131
|
* - No encryption (Plaintext cipher suite)
|
|
942
1132
|
* - Trusted confidentiality mode
|
|
943
|
-
* - Input fetched from a URL
|
|
1133
|
+
* - Input fetched from a URL, or carried inline in the extrinsic
|
|
944
1134
|
* - No pre-check or post-check verifications
|
|
945
1135
|
* - Plain (unencrypted) result
|
|
1136
|
+
*
|
|
1137
|
+
* The artifact goes in `compute.input` and `compute.program` stays inert: a
|
|
1138
|
+
* `Dormant` contract registers something rather than running it. A later
|
|
1139
|
+
* `Active` contract reaches this artifact with `{ ContractId: { id } }`, in
|
|
1140
|
+
* either its own `input` or its `program`, and pays this contract's owner the
|
|
1141
|
+
* `fee` offered here as the usage price.
|
|
946
1142
|
*/
|
|
947
1143
|
declare function dataContract(params: DataContractParams, account: KeyringPair): Promise<{
|
|
948
1144
|
blockNumber: number;
|
|
@@ -951,6 +1147,68 @@ declare function dataContract(params: DataContractParams, account: KeyringPair):
|
|
|
951
1147
|
agreementId?: string;
|
|
952
1148
|
}>;
|
|
953
1149
|
|
|
1150
|
+
/**
|
|
1151
|
+
* The chain-side parameters the compute fee floor is derived from.
|
|
1152
|
+
*
|
|
1153
|
+
* All four are read live: the first three are root-settable storage values
|
|
1154
|
+
* (`compute.setMaxDaStorageSize`, `setProviderStorageRate`,
|
|
1155
|
+
* `setThresholdDecryptionFee`), so a hard-coded copy goes stale silently and
|
|
1156
|
+
* surfaces only as an `InsufficientFreeBalance` at submission time.
|
|
1157
|
+
*/
|
|
1158
|
+
interface FeeParams {
|
|
1159
|
+
/** Bytes of DA storage a result is priced against. */
|
|
1160
|
+
maxDaStorageSize: bigint;
|
|
1161
|
+
/** Price per byte of DA storage, in atomic units. */
|
|
1162
|
+
providerStorageRate: bigint;
|
|
1163
|
+
/** Flat fee split between the contract's guardians, in atomic units. */
|
|
1164
|
+
thresholdDecryptionFee: bigint;
|
|
1165
|
+
/** Block time in milliseconds, the multiplier applied to `computeRate`. */
|
|
1166
|
+
millisecondsPerBlock: bigint;
|
|
1167
|
+
}
|
|
1168
|
+
interface MinFeeInput {
|
|
1169
|
+
/** Per-millisecond compute rate the contract offers, in PALI. */
|
|
1170
|
+
computeRate: PaliAmountInput;
|
|
1171
|
+
/** Contract ID supplying the input, whose owner is owed the input fee. */
|
|
1172
|
+
inputContractId?: string;
|
|
1173
|
+
}
|
|
1174
|
+
/** The fee floor and the four components it is built from, all in atomic units. */
|
|
1175
|
+
interface MinFeeBreakdown {
|
|
1176
|
+
/** `maxDaStorageSize * providerStorageRate` — pays whoever submits the result. */
|
|
1177
|
+
resultFee: bigint;
|
|
1178
|
+
/** `usagePrice` of the referenced input contract, or 0 when none is referenced. */
|
|
1179
|
+
inputFee: bigint;
|
|
1180
|
+
/** Flat threshold-decryption fee, split between the contract's guardians. */
|
|
1181
|
+
thresholdDecryptionFee: bigint;
|
|
1182
|
+
/** `computeRate * millisecondsPerBlock` — one block's worth of compute. */
|
|
1183
|
+
offeredComponent: bigint;
|
|
1184
|
+
/** The sum: the smallest `fees` the chain accepts for this contract. */
|
|
1185
|
+
minFee: bigint;
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Reads the four live chain parameters that define the compute fee floor.
|
|
1189
|
+
*
|
|
1190
|
+
* Throws when the connected runtime predates the metered-compute upgrade: older
|
|
1191
|
+
* runtimes expose a `compute` pallet with neither these storage items nor the
|
|
1192
|
+
* `Contract`-shaped `agreement` call, so there is no fee floor to report.
|
|
1193
|
+
*/
|
|
1194
|
+
declare function getFeeParams(): Promise<FeeParams>;
|
|
1195
|
+
/**
|
|
1196
|
+
* Computes the smallest `fees` an `Active` or `Subscription` contract may offer.
|
|
1197
|
+
*
|
|
1198
|
+
* Mirrors `pallet_compute::Pallet::fee_components`, which `CheckCompute` enforces
|
|
1199
|
+
* when validating the extrinsic and which `compute.result` settles against. An
|
|
1200
|
+
* offer below this floor is rejected as `InsufficientFreeBalance` before the
|
|
1201
|
+
* agreement is ever included in a block.
|
|
1202
|
+
*
|
|
1203
|
+
* Clearing this floor is necessary but not sufficient: guardians independently
|
|
1204
|
+
* reject an agreement whose `computeRate` is under their own per-compute-type
|
|
1205
|
+
* threshold. See CHAIN-RULES.md ("Two gates, not one").
|
|
1206
|
+
*
|
|
1207
|
+
* `Dormant` contracts reserve nothing and are exempt — they may offer any `fees`,
|
|
1208
|
+
* including zero.
|
|
1209
|
+
*/
|
|
1210
|
+
declare function estimateMinFee(input: MinFeeInput): Promise<MinFeeBreakdown>;
|
|
1211
|
+
|
|
954
1212
|
interface EncryptedInferenceSubscriptionParams {
|
|
955
1213
|
/** Guardian account addresses that participate in this compute. */
|
|
956
1214
|
guardians: string[];
|
|
@@ -1102,6 +1360,261 @@ declare function simpleCompute(params: SimpleComputeParams, account: KeyringPair
|
|
|
1102
1360
|
agreementId?: string;
|
|
1103
1361
|
}>;
|
|
1104
1362
|
|
|
1363
|
+
interface StoredComputeParams {
|
|
1364
|
+
/** Guardian account IDs that participate in this compute. */
|
|
1365
|
+
guardians: string[];
|
|
1366
|
+
/** Contract ID of the `Dormant` contract registering the program. */
|
|
1367
|
+
programContractId: string;
|
|
1368
|
+
/** Contract ID of the `Dormant` contract registering the input data. */
|
|
1369
|
+
inputContractId: string;
|
|
1370
|
+
/**
|
|
1371
|
+
* Fee offered for the compute step. Must clear the floor returned by
|
|
1372
|
+
* `estimateMinFee({ computeRate, inputContractId })` — referencing a stored
|
|
1373
|
+
* input raises that floor by the input contract's usage price.
|
|
1374
|
+
*/
|
|
1375
|
+
fee: Fee;
|
|
1376
|
+
/** Describes this execution. Unlike the contracts it references, it registers
|
|
1377
|
+
* nothing — so `storeType` is `"Other"` unless the run itself produces a
|
|
1378
|
+
* classifiable artifact. */
|
|
1379
|
+
metadata?: ComputeMetadataInput;
|
|
1380
|
+
/** Block number deadline for the compute step. Defaults to 0 (no deadline). */
|
|
1381
|
+
deadline?: number;
|
|
1382
|
+
/** Trusted guardian index in the guardians list. Defaults to 0. */
|
|
1383
|
+
trustIndex?: number;
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* Submits an `Active` agreement whose program and input both live in contracts
|
|
1387
|
+
* already registered on-chain.
|
|
1388
|
+
*
|
|
1389
|
+
* Where {@link simpleCompute} carries the program as a URL and the input as a
|
|
1390
|
+
* block coordinate, this points at two `Dormant` contracts instead. Each
|
|
1391
|
+
* `{ ContractId: { id } }` resolves to that contract's `compute.input` — the
|
|
1392
|
+
* field {@link dataContract} stores an artifact in — so the program contract
|
|
1393
|
+
* supplies the image and the input contract supplies the data.
|
|
1394
|
+
*
|
|
1395
|
+
* Only the `input` reference is billed: settlement pays the input contract's
|
|
1396
|
+
* owner its `usage_price`, which is why that ID is also what
|
|
1397
|
+
* `estimateMinFee` needs to quote the floor.
|
|
1398
|
+
*/
|
|
1399
|
+
declare function storedCompute(params: StoredComputeParams, account: KeyringPair): Promise<{
|
|
1400
|
+
blockNumber: number;
|
|
1401
|
+
index: number;
|
|
1402
|
+
hash: string;
|
|
1403
|
+
agreementId?: string;
|
|
1404
|
+
}>;
|
|
1405
|
+
|
|
1406
|
+
/** Thrown for any non-2xx response from the cost estimation service. */
|
|
1407
|
+
declare class CostEstimationError extends Error {
|
|
1408
|
+
readonly status: number;
|
|
1409
|
+
constructor(message: string, status: number);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
/** Confidentiality mode a compute contract requires guardians to support. */
|
|
1413
|
+
type ComputeMode = "Trusted" | "TEE" | "MPC" | "FHE" | "ZKP";
|
|
1414
|
+
/** Request body for {@link startEstimate} (`POST /estimate`). */
|
|
1415
|
+
interface ContractParams {
|
|
1416
|
+
/** Confidentiality mode eligible guardians must support. */
|
|
1417
|
+
computeMode: ComputeMode;
|
|
1418
|
+
/** Drives duration prediction. Omit to fall back to the service's default duration. */
|
|
1419
|
+
programRef?: string;
|
|
1420
|
+
/** Existing on-chain contract id. Omit to zero the input-fee component of the estimate. */
|
|
1421
|
+
contractId?: string;
|
|
1422
|
+
}
|
|
1423
|
+
/** A guardian entry as returned in an estimate's eligible set. */
|
|
1424
|
+
interface GuardianEntry {
|
|
1425
|
+
address: string;
|
|
1426
|
+
pubKey: string;
|
|
1427
|
+
/** On-chain reserve rate, in atomic units. */
|
|
1428
|
+
feeThreshold: bigint;
|
|
1429
|
+
}
|
|
1430
|
+
/** Resolved outcome of a `"completed"` estimate. */
|
|
1431
|
+
interface EstimateResult {
|
|
1432
|
+
predictedDurationMs: number;
|
|
1433
|
+
/** Winning auctioned rate, in atomic units. */
|
|
1434
|
+
auctionedRate: bigint;
|
|
1435
|
+
/** `resultFee + inputFee + thresholdDecryptionFee + auctionedRate * predictedDurationMs`. */
|
|
1436
|
+
estimatedCost: bigint;
|
|
1437
|
+
/** Full eligible guardian set at auction start, not just the winner. */
|
|
1438
|
+
guardians: GuardianEntry[];
|
|
1439
|
+
}
|
|
1440
|
+
/** Response from {@link getEstimateResult} (`GET /estimates/:id`). */
|
|
1441
|
+
type EstimateStatusResponse = {
|
|
1442
|
+
status: "pending";
|
|
1443
|
+
auctionId: string;
|
|
1444
|
+
} | {
|
|
1445
|
+
status: "completed";
|
|
1446
|
+
auctionId: string;
|
|
1447
|
+
result: EstimateResult;
|
|
1448
|
+
} | {
|
|
1449
|
+
status: "failed";
|
|
1450
|
+
auctionId: string;
|
|
1451
|
+
error: string;
|
|
1452
|
+
};
|
|
1453
|
+
/** An auction currently open (unresolved), as listed by `GET /auctions` and friends. */
|
|
1454
|
+
interface OpenAuction {
|
|
1455
|
+
auctionId: string;
|
|
1456
|
+
contractId: string;
|
|
1457
|
+
guardians: string[];
|
|
1458
|
+
/** Auction resolution deadline, epoch ms. */
|
|
1459
|
+
deadline: number;
|
|
1460
|
+
}
|
|
1461
|
+
/** The winning bid on a resolved auction. */
|
|
1462
|
+
interface AuctionWinner {
|
|
1463
|
+
guardian: string;
|
|
1464
|
+
/** Winning rate, in atomic units. */
|
|
1465
|
+
rate: bigint;
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* A resolved auction this guardian was eligible for, as returned by
|
|
1469
|
+
* {@link listResolvedGuardianAuctions} (`GET /guardians/:address/auctions?resolved=true`).
|
|
1470
|
+
*/
|
|
1471
|
+
interface ResolvedAuction {
|
|
1472
|
+
auctionId: string;
|
|
1473
|
+
contractId: string;
|
|
1474
|
+
guardians: string[];
|
|
1475
|
+
deadline: number;
|
|
1476
|
+
winner: AuctionWinner;
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* Full detail for a single auction regardless of resolution status, as returned by
|
|
1480
|
+
* {@link getAuction} (`GET /auctions/:id`). A resolved auction is never deleted from
|
|
1481
|
+
* the service's store, only excluded from `GET /auctions` / `GET /guardians/:address/auctions`
|
|
1482
|
+
* — this is the only endpoint that can return its outcome once it has dropped off those lists.
|
|
1483
|
+
*/
|
|
1484
|
+
interface AuctionDetail {
|
|
1485
|
+
auctionId: string;
|
|
1486
|
+
contractId: string;
|
|
1487
|
+
guardians: string[];
|
|
1488
|
+
deadline: number;
|
|
1489
|
+
resolved: boolean;
|
|
1490
|
+
/** Present only once `resolved` is `true`. */
|
|
1491
|
+
winner?: AuctionWinner;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
interface StartedEstimate {
|
|
1495
|
+
estimateId: string;
|
|
1496
|
+
/**
|
|
1497
|
+
* Id of the auction backing this estimate. Usable with {@link getAuction} once a
|
|
1498
|
+
* resolved auction has dropped off `GET /auctions` / `GET /guardians/:address/auctions`
|
|
1499
|
+
* — most callers never need it and can just poll {@link getEstimateResult}.
|
|
1500
|
+
*/
|
|
1501
|
+
auctionId: string;
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Starts a cost estimate via `POST /estimate`.
|
|
1505
|
+
*
|
|
1506
|
+
* Asynchronous: returns as soon as the rate auction is created, well before it
|
|
1507
|
+
* resolves (~`AUCTION_WINDOW_MS`, 5000ms by default). Poll {@link getEstimateResult}
|
|
1508
|
+
* with the returned id for the outcome, or use {@link waitForEstimate} to do both in
|
|
1509
|
+
* one call.
|
|
1510
|
+
*
|
|
1511
|
+
* Not idempotent — every call starts a brand-new auction with a new id, and can
|
|
1512
|
+
* resolve to a different `estimatedCost` even for identical input.
|
|
1513
|
+
*
|
|
1514
|
+
* @throws {CostEstimationError} 400 if `computeMode` is missing/invalid; 422 if no
|
|
1515
|
+
* guardians are eligible for that mode (do not tight-loop retry).
|
|
1516
|
+
*/
|
|
1517
|
+
declare function startEstimate(params: ContractParams): Promise<StartedEstimate>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Fetches the current state of an estimate started via {@link startEstimate}.
|
|
1520
|
+
*
|
|
1521
|
+
* `auctionedRate`, `estimatedCost`, and `feeThreshold` are returned as `bigint` —
|
|
1522
|
+
* never treat them as floating-point numbers.
|
|
1523
|
+
*
|
|
1524
|
+
* @throws {CostEstimationError} 404 if `estimateId` is unrecognized (terminal — a
|
|
1525
|
+
* restart of the service does not invalidate a previously issued id).
|
|
1526
|
+
*/
|
|
1527
|
+
declare function getEstimateResult(estimateId: string): Promise<EstimateStatusResponse>;
|
|
1528
|
+
interface WaitForEstimateOptions {
|
|
1529
|
+
/** Milliseconds between polls. Defaults to 5000ms (the service's default auction window). */
|
|
1530
|
+
intervalMs?: number;
|
|
1531
|
+
/** Upper bound on total wait time in milliseconds. Defaults to 60000ms. */
|
|
1532
|
+
timeoutMs?: number;
|
|
1533
|
+
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Starts an estimate and polls {@link getEstimateResult} until it leaves
|
|
1536
|
+
* `"pending"`, spacing requests `intervalMs` apart rather than tight-looping.
|
|
1537
|
+
*
|
|
1538
|
+
* Resolves with the terminal `"completed"` or `"failed"` status. Rejects if
|
|
1539
|
+
* `timeoutMs` elapses first — the estimate keeps running server-side regardless,
|
|
1540
|
+
* and can still be recovered later via {@link getEstimateResult} with the same id.
|
|
1541
|
+
*/
|
|
1542
|
+
declare function waitForEstimate(params: ContractParams, options?: WaitForEstimateOptions): Promise<{
|
|
1543
|
+
estimateId: string;
|
|
1544
|
+
status: EstimateStatusResponse;
|
|
1545
|
+
}>;
|
|
1546
|
+
|
|
1547
|
+
/**
|
|
1548
|
+
* Lists currently open (unresolved) auctions via `GET /auctions`, so a guardian can
|
|
1549
|
+
* discover an `auctionId` while it is still running in the background after a
|
|
1550
|
+
* {@link startEstimate} call returned. Only relevant when acting on behalf of a
|
|
1551
|
+
* guardian — a plain cost lookup never needs this.
|
|
1552
|
+
*/
|
|
1553
|
+
declare function listOpenAuctions(): Promise<OpenAuction[]>;
|
|
1554
|
+
/**
|
|
1555
|
+
* Same as {@link listOpenAuctions}, pre-filtered server-side (via
|
|
1556
|
+
* `GET /guardians/:address/auctions`) to auctions `guardianAddress` is eligible for.
|
|
1557
|
+
*/
|
|
1558
|
+
declare function listGuardianAuctions(guardianAddress: string): Promise<OpenAuction[]>;
|
|
1559
|
+
/**
|
|
1560
|
+
* Looks up a single auction via `GET /auctions/:id`, regardless of resolution status.
|
|
1561
|
+
* A resolved auction is never deleted from the service's store, only excluded from
|
|
1562
|
+
* {@link listOpenAuctions} / {@link listGuardianAuctions} — this is the only way to
|
|
1563
|
+
* retrieve its outcome (including the winning guardian's address) once resolved.
|
|
1564
|
+
*
|
|
1565
|
+
* @throws {CostEstimationError} 404 if `auctionId` is unrecognized — terminal.
|
|
1566
|
+
*/
|
|
1567
|
+
declare function getAuction(auctionId: string): Promise<AuctionDetail>;
|
|
1568
|
+
/**
|
|
1569
|
+
* Lists auctions `guardianAddress` was eligible for and that have since resolved, via
|
|
1570
|
+
* `GET /guardians/:address/auctions?resolved=true`. Use this instead of
|
|
1571
|
+
* {@link listGuardianAuctions} (which only ever shows currently open auctions) when
|
|
1572
|
+
* fetching a confirmed auction for a guardian you don't already have an `auctionId`
|
|
1573
|
+
* for — no need to guess the guardian's `computeMode` and start a throwaway estimate.
|
|
1574
|
+
*/
|
|
1575
|
+
declare function listResolvedGuardianAuctions(guardianAddress: string): Promise<ResolvedAuction[]>;
|
|
1576
|
+
/**
|
|
1577
|
+
* Submits a signed rate bid into an open auction via `POST /auctions/:id/bid`,
|
|
1578
|
+
* signed with `guardian`'s sr25519 key over the literal string
|
|
1579
|
+
* `${auctionId}:${rate}`, as required by the service.
|
|
1580
|
+
*
|
|
1581
|
+
* Lowest `rate` wins; ties break by earliest submission time, then by
|
|
1582
|
+
* lexicographically smallest address. A guardian that never bids keeps its default
|
|
1583
|
+
* entry — its own on-chain threshold for the compute type this auction was opened
|
|
1584
|
+
* for, which reads as zero when it declared none.
|
|
1585
|
+
*
|
|
1586
|
+
* @param rate - Bid rate as a decimal-integer string, in atomic units.
|
|
1587
|
+
* @throws {CostEstimationError} 422 if the auction is unknown, already closed, or
|
|
1588
|
+
* `guardian` isn't in its eligible set — terminal, do not retry the same bid.
|
|
1589
|
+
*/
|
|
1590
|
+
declare function submitAuctionBid(auctionId: string, rate: string, guardian: KeyringPair): Promise<void>;
|
|
1591
|
+
|
|
1592
|
+
/**
|
|
1593
|
+
* Registers a webhook URL for `guardian` via `POST /guardians/:address/webhook`, so
|
|
1594
|
+
* it gets a best-effort push (`{ auctionId, contractId, deadline }`) whenever it's
|
|
1595
|
+
* placed in a new auction, instead of polling {@link listGuardianAuctions}.
|
|
1596
|
+
*
|
|
1597
|
+
* Signed with `guardian`'s sr25519 key over the literal string `webhook:${url}`, as
|
|
1598
|
+
* required by the service — this binds the registration to the exact URL so it
|
|
1599
|
+
* can't be replayed to redirect notifications elsewhere.
|
|
1600
|
+
*
|
|
1601
|
+
* Replaces any previously registered webhook for this guardian; there is no
|
|
1602
|
+
* list/unregister endpoint. Delivery is best-effort and unawaited by the service —
|
|
1603
|
+
* a failed push is only logged server-side, never retried, so don't rely on this as
|
|
1604
|
+
* a substitute for polling if missing an auction would be costly.
|
|
1605
|
+
*
|
|
1606
|
+
* @throws {CostEstimationError} 400 if `url` isn't an absolute http(s) URL; 404 if
|
|
1607
|
+
* `guardian` has no resolvable on-chain guardian entry; 422 if the signature doesn't
|
|
1608
|
+
* verify.
|
|
1609
|
+
*/
|
|
1610
|
+
declare function registerGuardianWebhook(url: string, guardian: KeyringPair): Promise<void>;
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* Liveness probe via `GET /health`. Does not verify chain connectivity — a healthy
|
|
1614
|
+
* response does not guarantee {@link startEstimate} will succeed.
|
|
1615
|
+
*/
|
|
1616
|
+
declare function healthCheck(): Promise<boolean>;
|
|
1617
|
+
|
|
1105
1618
|
declare const gen_stretched_key: (input: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
1106
1619
|
declare const gen_shared_key: (key: Uint8Array, pk: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
1107
1620
|
declare const encrypt$1: (plaintext: Uint8Array, key: Uint8Array) => {
|
|
@@ -1244,7 +1757,7 @@ interface DataAgreementMetadata {
|
|
|
1244
1757
|
name: string;
|
|
1245
1758
|
description: string;
|
|
1246
1759
|
/** Maps to the on-chain StoreType enum. */
|
|
1247
|
-
storeType:
|
|
1760
|
+
storeType: StoreType;
|
|
1248
1761
|
/** H256 group identifier. */
|
|
1249
1762
|
groupId: string;
|
|
1250
1763
|
}
|
|
@@ -1307,6 +1820,16 @@ declare function uploadData(options: UploadOptions): Promise<void>;
|
|
|
1307
1820
|
declare function uploadDataLegacy(options: Omit<UploadOptions, "opts">): Promise<void>;
|
|
1308
1821
|
|
|
1309
1822
|
declare const getGuardianList: () => Promise<string[]>;
|
|
1823
|
+
interface ActiveGuardian {
|
|
1824
|
+
account: string;
|
|
1825
|
+
guardianPrefs: Record<string, unknown> | null;
|
|
1826
|
+
stakersOverview: Record<string, unknown> | null;
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1829
|
+
* Current-era on-chain guardians with staking prefs and ledger totals.
|
|
1830
|
+
* Does not disconnect the shared API.
|
|
1831
|
+
*/
|
|
1832
|
+
declare function getActiveGuardians(apiInstance?: ApiPromise): Promise<ActiveGuardian[]>;
|
|
1310
1833
|
|
|
1311
1834
|
declare const createGuardianGroup: (account: KeyringPair, selectedGuardians: GuardianAddress[]) => Promise<{
|
|
1312
1835
|
blockNumber: number;
|
|
@@ -1324,10 +1847,43 @@ declare const createGuardianGroup: (account: KeyringPair, selectedGuardians: Gua
|
|
|
1324
1847
|
* @param maxBlocks Give up waiting for the event after this many blocks; 0 = indefinite (default 20)
|
|
1325
1848
|
*/
|
|
1326
1849
|
declare const createGuardianGroupAndWatch: (account: KeyringPair, guardians: GuardianAddress[], maxBlocks?: number) => Promise<GuardianGroupInfo>;
|
|
1850
|
+
/**
|
|
1851
|
+
* Reconstructs a guardian group's full crypto params from the two on-chain
|
|
1852
|
+
* extrinsics that together define it. There is no direct RPC to query group
|
|
1853
|
+
* info by ID, so this reads it back from where it was written:
|
|
1854
|
+
*
|
|
1855
|
+
* - `dataAvailability.daccGuardianGroup(selectedGuardians, tauParams)` — the
|
|
1856
|
+
* creation extrinsic; carries the guardian list.
|
|
1857
|
+
* - `dataAvailability.daccGuardianGroupInfo(groupId, groupPk, tauParams, aggKey)`
|
|
1858
|
+
* — the result extrinsic (submitted separately once the group's crypto
|
|
1859
|
+
* params are computed); carries the actual group_id/group_pk/tau_params/agg_key.
|
|
1860
|
+
*
|
|
1861
|
+
* `groupId` isn't a required input — like {@link createGuardianGroupAndWatch},
|
|
1862
|
+
* it's derived from decoding the result extrinsic, not supplied by the caller.
|
|
1863
|
+
*
|
|
1864
|
+
* @param creationRef Block number + extrinsic index of the group creation extrinsic
|
|
1865
|
+
* @param resultRef Block number + extrinsic index of the group creation result
|
|
1866
|
+
* extrinsic. If omitted, blocks are scanned forward from
|
|
1867
|
+
* `creationRef` to find it (see `maxBlocks`).
|
|
1868
|
+
* @param maxBlocks Only used when `resultRef` is omitted. Give up scanning after
|
|
1869
|
+
* this many blocks; 0 = scan to current chain tip (default 20)
|
|
1870
|
+
*/
|
|
1871
|
+
declare const getGuardianGroupInfo: (creationRef: OnChainRef, resultRef?: OnChainRef, maxBlocks?: number) => Promise<GuardianGroupInfo>;
|
|
1327
1872
|
|
|
1873
|
+
/** Classes of compute a guardian can declare a fee threshold against. */
|
|
1874
|
+
declare const COMPUTE_TYPES: readonly ["trusted", "tee", "mpc", "fhe", "zkp"];
|
|
1875
|
+
type ComputeType = (typeof COMPUTE_TYPES)[number];
|
|
1876
|
+
/** A rate in atomic units, already converted from PALI by the caller. */
|
|
1877
|
+
type FeeThresholdInput = bigint | string | number;
|
|
1328
1878
|
interface GuardianJoinPrefs {
|
|
1329
1879
|
compute?: string;
|
|
1330
|
-
|
|
1880
|
+
/**
|
|
1881
|
+
* Minimum rate to take work on at, in atomic units. A single amount applies to every
|
|
1882
|
+
* compute type named in `compute`; a per-type record prices each one separately.
|
|
1883
|
+
* Compute types left unpriced carry no threshold on chain, which reads as zero — the
|
|
1884
|
+
* guardian accepts any rate for them.
|
|
1885
|
+
*/
|
|
1886
|
+
fee?: FeeThresholdInput | Partial<Record<ComputeType, FeeThresholdInput>>;
|
|
1331
1887
|
standard?: boolean;
|
|
1332
1888
|
verifier?: boolean;
|
|
1333
1889
|
}
|
|
@@ -1347,6 +1903,36 @@ declare function removeStake(account: KeyringPair): Promise<void>;
|
|
|
1347
1903
|
|
|
1348
1904
|
declare function withdrawStake(account: KeyringPair): Promise<void>;
|
|
1349
1905
|
|
|
1906
|
+
interface StorageProvider {
|
|
1907
|
+
/** Unique identifier for the storage backend (e.g., 's3', 'ipfs') */
|
|
1908
|
+
readonly id: string;
|
|
1909
|
+
/** Generates the deterministic URL where the file will be stored */
|
|
1910
|
+
getDeterministicUrl(hash: string): string;
|
|
1911
|
+
/**
|
|
1912
|
+
* Fetches the authorized upload URL (e.g., a Pre-signed URL) from the Auth Service
|
|
1913
|
+
* after the on-chain agreement has been created.
|
|
1914
|
+
*/
|
|
1915
|
+
getUploadUrl(txHash: string, fileHash: string, blockNumber: number, expectedUrl: string): Promise<string>;
|
|
1916
|
+
/** Uploads the raw bytes to the authorized URL */
|
|
1917
|
+
upload(url: string, data: Uint8Array): Promise<void>;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
declare class S3Provider implements StorageProvider {
|
|
1921
|
+
readonly id = "s3";
|
|
1922
|
+
getDeterministicUrl(hash: string): string;
|
|
1923
|
+
getUploadUrl(txHash: string, fileHash: string, blockNumber: number, expectedUrl: string): Promise<string>;
|
|
1924
|
+
upload(url: string, data: Uint8Array): Promise<void>;
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
declare class StorageRouter {
|
|
1928
|
+
private providers;
|
|
1929
|
+
private defaultProvider;
|
|
1930
|
+
constructor();
|
|
1931
|
+
register(provider: StorageProvider): void;
|
|
1932
|
+
getProvider(id?: string): StorageProvider;
|
|
1933
|
+
}
|
|
1934
|
+
declare const storageRouter: StorageRouter;
|
|
1935
|
+
|
|
1350
1936
|
declare function fundAccount(account: KeyringPair, amountBaseUnits: bigint, address?: string): Promise<void>;
|
|
1351
1937
|
|
|
1352
1938
|
declare function transfer(account: KeyringPair, amountBaseUnits: bigint, address: string): Promise<void>;
|
|
@@ -1410,7 +1996,7 @@ declare const base64ToUint8Array: (base64: string) => Uint8Array;
|
|
|
1410
1996
|
declare const decodeField: (field: string, expectedLength?: number) => Uint8Array;
|
|
1411
1997
|
/**
|
|
1412
1998
|
* Conditional debug logging utility.
|
|
1413
|
-
* Only logs when
|
|
1999
|
+
* Only logs when the debug flag is enabled in config.
|
|
1414
2000
|
*
|
|
1415
2001
|
* @param message - The message to log
|
|
1416
2002
|
* @param optionalParams - Additional parameters to log
|
|
@@ -1419,24 +2005,725 @@ declare const debugLog: (message?: any, ...optionalParams: any[]) => void;
|
|
|
1419
2005
|
|
|
1420
2006
|
declare function joinValidator(account: KeyringPair, commission: number): Promise<void>;
|
|
1421
2007
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
2008
|
+
/** Values the host application must supply through {@link init}. */
|
|
2009
|
+
interface PallioraConfig {
|
|
2010
|
+
/** WebSocket endpoint used for the chain API connection. */
|
|
2011
|
+
pallioraWs: string;
|
|
2012
|
+
/** RPC endpoint, when it differs from {@link PallioraConfig.pallioraWs}. */
|
|
2013
|
+
pallioraRpcUrl: string;
|
|
2014
|
+
/** Base URL of the cost-estimation service. */
|
|
2015
|
+
costEstimatorUrl: string;
|
|
2016
|
+
/** Base URL of the auth service that issues S3 pre-signed URLs. */
|
|
2017
|
+
authServiceUrl: string;
|
|
2018
|
+
/** AWS region of the artifact storage bucket. */
|
|
2019
|
+
awsRegion: string;
|
|
2020
|
+
/** Name of the artifact storage bucket. */
|
|
2021
|
+
awsS3Bucket: string;
|
|
2022
|
+
/** Enables debug logging. Defaults to `false`. */
|
|
2023
|
+
debug: boolean;
|
|
2024
|
+
/** Waits for finalization instead of returning once a tx is in-block. Defaults to `false`. */
|
|
2025
|
+
txWaitFinalization: boolean;
|
|
2026
|
+
}
|
|
2027
|
+
/**
|
|
2028
|
+
* Initializes the SDK. Call this once, before any other SDK function.
|
|
2029
|
+
*
|
|
2030
|
+
* @remarks
|
|
2031
|
+
* Repeated calls merge into the existing configuration, so a host can supply
|
|
2032
|
+
* the chain endpoint at startup and storage settings later.
|
|
2033
|
+
*/
|
|
2034
|
+
declare function init(options: Partial<PallioraConfig>): void;
|
|
2035
|
+
/** Whether {@link init} has been called. */
|
|
2036
|
+
declare function isInitialized(): boolean;
|
|
2037
|
+
/** Clears the configuration. Intended for tests. */
|
|
2038
|
+
declare function resetConfig(): void;
|
|
2039
|
+
/** @throws when `pallioraWs` was not supplied to {@link init}. */
|
|
2040
|
+
declare const getPallioraWs: () => string;
|
|
2041
|
+
/** @throws when `pallioraRpcUrl` was not supplied to {@link init}. */
|
|
2042
|
+
declare const getPallioraRpcUrl: () => string;
|
|
2043
|
+
/** @throws when `costEstimatorUrl` was not supplied to {@link init}. */
|
|
2044
|
+
declare const getCostEstimatorUrl: () => string;
|
|
2045
|
+
/** @throws when `authServiceUrl` was not supplied to {@link init}. */
|
|
2046
|
+
declare const getAuthServiceUrl: () => string;
|
|
2047
|
+
/** @throws when `awsRegion` was not supplied to {@link init}. */
|
|
2048
|
+
declare const getAwsRegion: () => string;
|
|
2049
|
+
/** @throws when `awsS3Bucket` was not supplied to {@link init}. */
|
|
2050
|
+
declare const getAwsS3Bucket: () => string;
|
|
2051
|
+
/** Defaults to `false` when not supplied to {@link init}. */
|
|
2052
|
+
declare const isDebug: () => boolean;
|
|
2053
|
+
/** Defaults to `false` when not supplied to {@link init}. */
|
|
2054
|
+
declare const waitsForFinalization: () => boolean;
|
|
2055
|
+
/**
|
|
2056
|
+
* Returns the shared {@link WsProvider}, creating it on first use and replacing
|
|
2057
|
+
* it whenever `pallioraWs` changes.
|
|
2058
|
+
*
|
|
2059
|
+
* @throws when `pallioraWs` was not supplied to {@link init}.
|
|
2060
|
+
*/
|
|
2061
|
+
declare function getProvider(): WsProvider;
|
|
1433
2062
|
|
|
1434
2063
|
interface IdentityFields {
|
|
1435
2064
|
display?: string;
|
|
1436
2065
|
}
|
|
1437
2066
|
declare function setIdentity(account: KeyringPair, { display }: IdentityFields): Promise<void>;
|
|
1438
2067
|
|
|
2068
|
+
interface IndexerClientOptions {
|
|
2069
|
+
/** Base URL of the indexer server (default: `http://localhost:5020`). */
|
|
2070
|
+
baseUrl?: string;
|
|
2071
|
+
/**
|
|
2072
|
+
* Custom fetch implementation. Defaults to the global `fetch`.
|
|
2073
|
+
* Useful for injecting a test double or a polyfill in older Node versions.
|
|
2074
|
+
*/
|
|
2075
|
+
fetch?: typeof globalThis.fetch;
|
|
2076
|
+
}
|
|
2077
|
+
/**
|
|
2078
|
+
* Lightweight wrapper around `fetch` that targets the `@statescan/indexer` REST API.
|
|
2079
|
+
*
|
|
2080
|
+
* Every public method on the domain modules receives an `IndexerClient` instance,
|
|
2081
|
+
* keeping configuration (base URL, custom fetch) in one place.
|
|
2082
|
+
*
|
|
2083
|
+
* @example
|
|
2084
|
+
* ```ts
|
|
2085
|
+
* import { IndexerClient } from "@palliora.org/chainsdk";
|
|
2086
|
+
*
|
|
2087
|
+
* const client = new IndexerClient({ baseUrl: "https://indexer.palliora.org" });
|
|
2088
|
+
* ```
|
|
2089
|
+
*/
|
|
2090
|
+
declare class IndexerClient {
|
|
2091
|
+
readonly baseUrl: string;
|
|
2092
|
+
private readonly _fetch;
|
|
2093
|
+
constructor(options?: IndexerClientOptions);
|
|
2094
|
+
/**
|
|
2095
|
+
* Performs a GET request against the indexer and returns the parsed JSON body.
|
|
2096
|
+
*
|
|
2097
|
+
* @throws {IndexerHttpError} When the response indicates failure (`success: false`)
|
|
2098
|
+
* or the HTTP status is not 2xx.
|
|
2099
|
+
*/
|
|
2100
|
+
get<T>(path: string, params?: Record<string, string | number | boolean | null | undefined>): Promise<T>;
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Error thrown when the indexer returns a non-2xx response or an error envelope.
|
|
2104
|
+
*/
|
|
2105
|
+
declare class IndexerHttpError extends Error {
|
|
2106
|
+
readonly statusCode: number;
|
|
2107
|
+
constructor(statusCode: number, message: string);
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
/** Common `indexer` subdocument present on most indexed documents. */
|
|
2111
|
+
interface IndexerMeta {
|
|
2112
|
+
blockHeight: number;
|
|
2113
|
+
blockHash: string;
|
|
2114
|
+
blockTime: number;
|
|
2115
|
+
extrinsicIndex: number;
|
|
2116
|
+
eventIndex: number;
|
|
2117
|
+
}
|
|
2118
|
+
/** @deprecated Prefer {@link StoreType}. Kept for backward compatibility. */
|
|
2119
|
+
type ArtefactType = StoreType | "Data";
|
|
2120
|
+
interface ArtefactDocument {
|
|
2121
|
+
contractId: string;
|
|
2122
|
+
creator: string;
|
|
2123
|
+
owner: string;
|
|
2124
|
+
storeType: StoreType | string | null;
|
|
2125
|
+
contractType: string;
|
|
2126
|
+
status?: string;
|
|
2127
|
+
groupId: string | null;
|
|
2128
|
+
name?: string | null;
|
|
2129
|
+
description?: string | null;
|
|
2130
|
+
/** @deprecated Prefer `storeType`. May be absent on newer documents. */
|
|
2131
|
+
artefactType?: ArtefactType;
|
|
2132
|
+
blobRefs?: Array<[number, number] | unknown>;
|
|
2133
|
+
indexer: IndexerMeta;
|
|
2134
|
+
[key: string]: unknown;
|
|
2135
|
+
}
|
|
2136
|
+
interface ArtefactsQuery {
|
|
2137
|
+
/** Server-side filter when supported by the indexer. Prefer client helpers for `storeType`. */
|
|
2138
|
+
artefactType?: ArtefactType;
|
|
2139
|
+
storeType?: StoreType;
|
|
2140
|
+
}
|
|
2141
|
+
interface ArtefactAccessQuery {
|
|
2142
|
+
blockHeight?: number;
|
|
2143
|
+
extrinsicIndex?: number;
|
|
2144
|
+
retriver?: string;
|
|
2145
|
+
}
|
|
2146
|
+
interface ArtefactContractsQuery {
|
|
2147
|
+
blockHeight?: number;
|
|
2148
|
+
extrinsicIndex?: number;
|
|
2149
|
+
retriver?: string;
|
|
2150
|
+
}
|
|
2151
|
+
interface ContractResponse {
|
|
2152
|
+
peerId?: string;
|
|
2153
|
+
acceptance?: boolean;
|
|
2154
|
+
creationTime?: number;
|
|
2155
|
+
[key: string]: unknown;
|
|
2156
|
+
}
|
|
2157
|
+
interface ContractDocument {
|
|
2158
|
+
contractId: string;
|
|
2159
|
+
creator?: string;
|
|
2160
|
+
owner?: string;
|
|
2161
|
+
storeType?: string;
|
|
2162
|
+
contractType?: string;
|
|
2163
|
+
status?: string;
|
|
2164
|
+
groupId?: string;
|
|
2165
|
+
artefactType?: string;
|
|
2166
|
+
parties?: string[];
|
|
2167
|
+
responses?: ContractResponse[];
|
|
2168
|
+
fee?: string | number;
|
|
2169
|
+
creationTime?: number;
|
|
2170
|
+
computeTx?: unknown;
|
|
2171
|
+
indexer?: IndexerMeta;
|
|
2172
|
+
[key: string]: unknown;
|
|
2173
|
+
}
|
|
2174
|
+
interface ContractsQuery {
|
|
2175
|
+
page?: number;
|
|
2176
|
+
page_size?: number;
|
|
2177
|
+
}
|
|
2178
|
+
interface ComputeDocument {
|
|
2179
|
+
jobId?: string;
|
|
2180
|
+
contractId?: string;
|
|
2181
|
+
orchestrator?: string;
|
|
2182
|
+
parties?: string[];
|
|
2183
|
+
resultTx?: unknown;
|
|
2184
|
+
computeReward?: string | number;
|
|
2185
|
+
decryptionFee?: unknown;
|
|
2186
|
+
fee?: string | number;
|
|
2187
|
+
indexer?: IndexerMeta;
|
|
2188
|
+
[key: string]: unknown;
|
|
2189
|
+
}
|
|
2190
|
+
interface ResultFeeParty {
|
|
2191
|
+
recipient?: string;
|
|
2192
|
+
amount?: string;
|
|
2193
|
+
kind?: string;
|
|
2194
|
+
[key: string]: unknown;
|
|
2195
|
+
}
|
|
2196
|
+
interface ResultFeeBreakdown {
|
|
2197
|
+
inputFee?: ResultFeeParty | null;
|
|
2198
|
+
programFee?: ResultFeeParty | null;
|
|
2199
|
+
thresholdDecryptionFee?: unknown;
|
|
2200
|
+
computeFee?: ResultFeeParty | null;
|
|
2201
|
+
submitorFee?: ResultFeeParty | null;
|
|
2202
|
+
resultFee?: string;
|
|
2203
|
+
totalCharged?: string;
|
|
2204
|
+
reservedFee?: string;
|
|
2205
|
+
refundedAmount?: string;
|
|
2206
|
+
[key: string]: unknown;
|
|
2207
|
+
}
|
|
2208
|
+
/** One execution stored in `palliora-compute.results`. */
|
|
2209
|
+
interface ResultDocument {
|
|
2210
|
+
resultId: string;
|
|
2211
|
+
contractId: string;
|
|
2212
|
+
contractType?: string;
|
|
2213
|
+
submitor?: string;
|
|
2214
|
+
computeDurationMs?: number;
|
|
2215
|
+
executionOutcome?: unknown;
|
|
2216
|
+
feeBreakdown?: ResultFeeBreakdown;
|
|
2217
|
+
indexer?: IndexerMeta;
|
|
2218
|
+
[key: string]: unknown;
|
|
2219
|
+
}
|
|
2220
|
+
interface ResultsQuery {
|
|
2221
|
+
/** Filter `palliora-compute.results` by parent contract. Required by the indexer. */
|
|
2222
|
+
contractId: string;
|
|
2223
|
+
}
|
|
2224
|
+
type ContractFlowStatus = "PENDING" | "ACCEPTED" | "PROCESSING" | "COMPLETED";
|
|
2225
|
+
interface ContractFlowPhase {
|
|
2226
|
+
id: "phase-1" | "phase-2" | "phase-3" | "phase-4" | "phase-5";
|
|
2227
|
+
title: string;
|
|
2228
|
+
status: string;
|
|
2229
|
+
description: string;
|
|
2230
|
+
json: Record<string, unknown>;
|
|
2231
|
+
active: boolean;
|
|
2232
|
+
complete: boolean;
|
|
2233
|
+
pending: boolean;
|
|
2234
|
+
}
|
|
2235
|
+
/** Combined compute-contract lifecycle assembled from `/api/contract/:id` + `/api/compute/:id` + `/api/results`. */
|
|
2236
|
+
interface ContractFlow {
|
|
2237
|
+
agreement: ContractDocument;
|
|
2238
|
+
/** Latest compute request, if any. Prefer {@link ContractFlow.computes} for session flows. */
|
|
2239
|
+
compute: ComputeDocument | null;
|
|
2240
|
+
/** Every compute request on this agreement, oldest first. */
|
|
2241
|
+
computes: ComputeDocument[];
|
|
2242
|
+
/** Execution rows from `palliora-compute.results` for this contract. */
|
|
2243
|
+
results: ResultDocument[];
|
|
2244
|
+
status: ContractFlowStatus;
|
|
2245
|
+
phases: ContractFlowPhase[];
|
|
2246
|
+
}
|
|
2247
|
+
/** Combined artefact + access + blobs for a dataset/model/agent detail page. */
|
|
2248
|
+
interface ArtefactFlow {
|
|
2249
|
+
artefact: ArtefactDocument;
|
|
2250
|
+
access: unknown[];
|
|
2251
|
+
blobs: BlobDocument[];
|
|
2252
|
+
}
|
|
2253
|
+
interface BlockDocument {
|
|
2254
|
+
height: number;
|
|
2255
|
+
hash: string;
|
|
2256
|
+
time: number;
|
|
2257
|
+
validator?: string;
|
|
2258
|
+
parentHash?: string;
|
|
2259
|
+
stateRoot?: string;
|
|
2260
|
+
extrinsicsRoot?: string;
|
|
2261
|
+
eventsCount?: number;
|
|
2262
|
+
extrinsicsCount?: number;
|
|
2263
|
+
[key: string]: unknown;
|
|
2264
|
+
}
|
|
2265
|
+
/** Payload inside `GET /api/blocks` — `{ data: { blocks, stats } }`. */
|
|
2266
|
+
interface BlocksData {
|
|
2267
|
+
blocks: BlockDocument[];
|
|
2268
|
+
stats?: Record<string, unknown>;
|
|
2269
|
+
[key: string]: unknown;
|
|
2270
|
+
}
|
|
2271
|
+
interface BlocksQuery {
|
|
2272
|
+
page?: number;
|
|
2273
|
+
page_size?: number;
|
|
2274
|
+
}
|
|
2275
|
+
interface Overview {
|
|
2276
|
+
accounts: number;
|
|
2277
|
+
transfers: number;
|
|
2278
|
+
latestHeight: number;
|
|
2279
|
+
avgBlockTime: number;
|
|
2280
|
+
activeValidators: number | null;
|
|
2281
|
+
}
|
|
2282
|
+
interface ChainEvent {
|
|
2283
|
+
indexer: IndexerMeta;
|
|
2284
|
+
section: string;
|
|
2285
|
+
method: string;
|
|
2286
|
+
[key: string]: unknown;
|
|
2287
|
+
}
|
|
2288
|
+
interface EventsData {
|
|
2289
|
+
items: ChainEvent[];
|
|
2290
|
+
page: number;
|
|
2291
|
+
pageSize: number;
|
|
2292
|
+
}
|
|
2293
|
+
interface EventsQuery {
|
|
2294
|
+
page?: number;
|
|
2295
|
+
page_size?: number;
|
|
2296
|
+
}
|
|
2297
|
+
interface CallDocument {
|
|
2298
|
+
[key: string]: unknown;
|
|
2299
|
+
}
|
|
2300
|
+
interface CallQuery {
|
|
2301
|
+
blockHeight: number;
|
|
2302
|
+
extrinsicIndex: number;
|
|
2303
|
+
}
|
|
2304
|
+
interface CallMetadataDocument {
|
|
2305
|
+
[key: string]: unknown;
|
|
2306
|
+
}
|
|
2307
|
+
interface CallMetadataQuery {
|
|
2308
|
+
blockHeight: number;
|
|
2309
|
+
extrinsicIndex: number;
|
|
2310
|
+
}
|
|
2311
|
+
interface CallArgsDocument {
|
|
2312
|
+
[key: string]: unknown;
|
|
2313
|
+
}
|
|
2314
|
+
interface CallArgsQuery {
|
|
2315
|
+
metadataHash: string;
|
|
2316
|
+
}
|
|
2317
|
+
interface TransferDocument {
|
|
2318
|
+
indexer: IndexerMeta;
|
|
2319
|
+
[key: string]: unknown;
|
|
2320
|
+
}
|
|
2321
|
+
interface TransfersQuery {
|
|
2322
|
+
page?: number;
|
|
2323
|
+
page_size?: number;
|
|
2324
|
+
}
|
|
2325
|
+
interface ExtrinsicDocument {
|
|
2326
|
+
indexer: {
|
|
2327
|
+
blockHeight: number;
|
|
2328
|
+
extrinsicIndex: number;
|
|
2329
|
+
blockHash?: string;
|
|
2330
|
+
blockTime?: number;
|
|
2331
|
+
eventIndex?: number;
|
|
2332
|
+
};
|
|
2333
|
+
hash: string;
|
|
2334
|
+
isSigned: boolean;
|
|
2335
|
+
[key: string]: unknown;
|
|
2336
|
+
}
|
|
2337
|
+
interface ExtrinsicsQuery {
|
|
2338
|
+
page?: number;
|
|
2339
|
+
page_size?: number;
|
|
2340
|
+
/** Set to `"true"` to return only signed extrinsics. */
|
|
2341
|
+
signed_only?: "true" | "false" | boolean;
|
|
2342
|
+
}
|
|
2343
|
+
interface AddressDocument {
|
|
2344
|
+
address: string;
|
|
2345
|
+
balance: string | number;
|
|
2346
|
+
[key: string]: unknown;
|
|
2347
|
+
}
|
|
2348
|
+
interface BlobDocument {
|
|
2349
|
+
indexer: IndexerMeta;
|
|
2350
|
+
[key: string]: unknown;
|
|
2351
|
+
}
|
|
2352
|
+
/**
|
|
2353
|
+
* Identity-enriched guardian from `GET /api/guardian-groups`.
|
|
2354
|
+
* `displayName` is the on-chain identity display, or `null` if none is set.
|
|
2355
|
+
*/
|
|
2356
|
+
interface GuardianDocument {
|
|
2357
|
+
account: string;
|
|
2358
|
+
displayName: string | null;
|
|
2359
|
+
}
|
|
2360
|
+
interface GuardianGroupDocument {
|
|
2361
|
+
groupId: string;
|
|
2362
|
+
creator?: string;
|
|
2363
|
+
guardians: string[];
|
|
2364
|
+
/**
|
|
2365
|
+
* Parallel to {@link GuardianGroupDocument.guardians}.
|
|
2366
|
+
* Identity display name for each address, or `null` if unset.
|
|
2367
|
+
*/
|
|
2368
|
+
guardianNames: Array<string | null>;
|
|
2369
|
+
groupPk?: string;
|
|
2370
|
+
tauParams?: string;
|
|
2371
|
+
aggKey?: string;
|
|
2372
|
+
status?: string;
|
|
2373
|
+
success?: boolean;
|
|
2374
|
+
indexer?: IndexerMeta;
|
|
2375
|
+
creationTime?: number;
|
|
2376
|
+
[key: string]: unknown;
|
|
2377
|
+
}
|
|
2378
|
+
interface GuardianGroupsQuery {
|
|
2379
|
+
guardian?: string;
|
|
2380
|
+
}
|
|
2381
|
+
interface AccessDocument {
|
|
2382
|
+
[key: string]: unknown;
|
|
2383
|
+
}
|
|
2384
|
+
interface AccessQuery {
|
|
2385
|
+
blockHeight?: number;
|
|
2386
|
+
extrinsicIndex?: number;
|
|
2387
|
+
retriver?: string;
|
|
2388
|
+
}
|
|
2389
|
+
/** Standard success response: `{ success: true, data: T }`. */
|
|
2390
|
+
interface SuccessResponse<T> {
|
|
2391
|
+
success: true;
|
|
2392
|
+
data: T;
|
|
2393
|
+
}
|
|
2394
|
+
/** Paginated success response: `{ success: true, data: T[], total: number }`. */
|
|
2395
|
+
interface PaginatedResponse<T> {
|
|
2396
|
+
success: true;
|
|
2397
|
+
data: T[];
|
|
2398
|
+
total: number;
|
|
2399
|
+
}
|
|
2400
|
+
/** Access-style success response: `{ success: true, data: T[], message: string }`. */
|
|
2401
|
+
interface AccessResponse<T> {
|
|
2402
|
+
success: true;
|
|
2403
|
+
data: T[];
|
|
2404
|
+
message: string;
|
|
2405
|
+
}
|
|
2406
|
+
/** Address-style response (no `success` flag): `{ data: T }`. */
|
|
2407
|
+
interface DataOnlyResponse<T> {
|
|
2408
|
+
data: T;
|
|
2409
|
+
}
|
|
2410
|
+
/** Error response from the indexer. */
|
|
2411
|
+
interface ErrorResponse {
|
|
2412
|
+
success: false;
|
|
2413
|
+
message: string;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
/**
|
|
2417
|
+
* Fetch all artefacts, optionally filtered by type.
|
|
2418
|
+
*
|
|
2419
|
+
* `GET /api/artefacts`
|
|
2420
|
+
*
|
|
2421
|
+
* For UI categorization by `storeType`, prefer the dedicated helpers:
|
|
2422
|
+
* {@link getDatasets}, {@link getModels}, {@link getAgents}, {@link getExecutables}.
|
|
2423
|
+
*
|
|
2424
|
+
* @param client Configured {@link IndexerClient}
|
|
2425
|
+
* @param query Optional filter — `storeType` / `artefactType`
|
|
2426
|
+
* @returns `{ success: true, data: ArtefactDocument[] }`
|
|
2427
|
+
*/
|
|
2428
|
+
declare function getArtefacts(client: IndexerClient, query?: ArtefactsQuery): Promise<SuccessResponse<ArtefactDocument[]>>;
|
|
2429
|
+
/**
|
|
2430
|
+
* Fetch artefacts filtered by `storeType`.
|
|
2431
|
+
*
|
|
2432
|
+
* Loads `/api/artefacts` and filters client-side so results are reliable even when
|
|
2433
|
+
* the indexer ignores the `storeType` query param.
|
|
2434
|
+
*/
|
|
2435
|
+
declare function getArtefactsByStoreType(client: IndexerClient, storeType: StoreType): Promise<SuccessResponse<ArtefactDocument[]>>;
|
|
2436
|
+
/** Fetch artefacts with `storeType: "Dataset"`. */
|
|
2437
|
+
declare function getDatasets(client: IndexerClient): Promise<SuccessResponse<ArtefactDocument[]>>;
|
|
2438
|
+
/** Fetch artefacts with `storeType: "Model"`. */
|
|
2439
|
+
declare function getModels(client: IndexerClient): Promise<SuccessResponse<ArtefactDocument[]>>;
|
|
2440
|
+
/** Fetch artefacts with `storeType: "Agent"`. */
|
|
2441
|
+
declare function getAgents(client: IndexerClient): Promise<SuccessResponse<ArtefactDocument[]>>;
|
|
2442
|
+
/** Fetch artefacts with `storeType: "Executable"`. */
|
|
2443
|
+
declare function getExecutables(client: IndexerClient): Promise<SuccessResponse<ArtefactDocument[]>>;
|
|
2444
|
+
/**
|
|
2445
|
+
* Fetch a single artefact by its contract ID.
|
|
2446
|
+
*
|
|
2447
|
+
* `GET /api/artefact/:id`
|
|
2448
|
+
*
|
|
2449
|
+
* @param client Configured {@link IndexerClient}
|
|
2450
|
+
* @param id The `contractId` of the artefact
|
|
2451
|
+
*/
|
|
2452
|
+
declare function getArtefact(client: IndexerClient, id: string): Promise<SuccessResponse<ArtefactDocument>>;
|
|
2453
|
+
/**
|
|
2454
|
+
* Fetch access records for a specific artefact.
|
|
2455
|
+
*
|
|
2456
|
+
* `GET /api/artefact/:id/access`
|
|
2457
|
+
*
|
|
2458
|
+
* @param client Configured {@link IndexerClient}
|
|
2459
|
+
* @param id The `contractId` of the artefact
|
|
2460
|
+
* @param query Optional filters — `blockHeight`, `extrinsicIndex`, `retriver`
|
|
2461
|
+
*/
|
|
2462
|
+
declare function getArtefactAccess(client: IndexerClient, id: string, query?: ArtefactAccessQuery): Promise<SuccessResponse<unknown[]>>;
|
|
2463
|
+
/** True when `doc` is a compute contract that references this artefact. */
|
|
2464
|
+
declare function isArtefactUsage(doc: Record<string, unknown> | null | undefined, artefactId: string): boolean;
|
|
2465
|
+
/**
|
|
2466
|
+
* Fetch compute contracts that use this artefact as input or program.
|
|
2467
|
+
*
|
|
2468
|
+
* `GET /api/artefact/:id/contracts`
|
|
2469
|
+
*
|
|
2470
|
+
* Older indexers returned the artefact document itself. In that case this
|
|
2471
|
+
* helper scans `/api/artefacts` and keeps rows that reference the artefact.
|
|
2472
|
+
*
|
|
2473
|
+
* @param client Configured {@link IndexerClient}
|
|
2474
|
+
* @param id The artefact `contractId`
|
|
2475
|
+
* @param query Optional filters — `blockHeight`, `extrinsicIndex`, `retriver`
|
|
2476
|
+
*/
|
|
2477
|
+
declare function getArtefactContracts(client: IndexerClient, id: string, query?: ArtefactContractsQuery): Promise<SuccessResponse<unknown[]>>;
|
|
2478
|
+
|
|
2479
|
+
/**
|
|
2480
|
+
* Fetch a paginated list of contracts.
|
|
2481
|
+
*
|
|
2482
|
+
* `GET /api/contracts`
|
|
2483
|
+
*
|
|
2484
|
+
* @param client Configured {@link IndexerClient}
|
|
2485
|
+
* @param query Pagination — `page` (0-indexed), `page_size` (default 25)
|
|
2486
|
+
* @returns `{ success: true, data: ContractDocument[], total: number }`
|
|
2487
|
+
*/
|
|
2488
|
+
declare function getContracts(client: IndexerClient, query?: ContractsQuery): Promise<PaginatedResponse<ContractDocument>>;
|
|
2489
|
+
/**
|
|
2490
|
+
* Fetch a single contract by its ID.
|
|
2491
|
+
*
|
|
2492
|
+
* `GET /api/contract/:id`
|
|
2493
|
+
*
|
|
2494
|
+
* @param client Configured {@link IndexerClient}
|
|
2495
|
+
* @param id The contract identifier
|
|
2496
|
+
*/
|
|
2497
|
+
declare function getContract(client: IndexerClient, id: string): Promise<SuccessResponse<ContractDocument>>;
|
|
2498
|
+
/**
|
|
2499
|
+
* Fetch compute request data for a specific contract.
|
|
2500
|
+
*
|
|
2501
|
+
* `GET /api/compute/:id`
|
|
2502
|
+
*
|
|
2503
|
+
* @param client Configured {@link IndexerClient}
|
|
2504
|
+
* @param id The contract identifier
|
|
2505
|
+
*/
|
|
2506
|
+
declare function getCompute(client: IndexerClient, id: string): Promise<SuccessResponse<ComputeDocument>>;
|
|
2507
|
+
/**
|
|
2508
|
+
* Fetch compute results for a contract from `palliora-compute.results`.
|
|
2509
|
+
*
|
|
2510
|
+
* `GET /api/results?contractId=`
|
|
2511
|
+
*/
|
|
2512
|
+
declare function getResults(client: IndexerClient, query: ResultsQuery): Promise<SuccessResponse<ResultDocument[]>>;
|
|
2513
|
+
/**
|
|
2514
|
+
* Fetch a single compute result by `resultId`.
|
|
2515
|
+
*
|
|
2516
|
+
* `GET /api/result/:id`
|
|
2517
|
+
*/
|
|
2518
|
+
declare function getResult(client: IndexerClient, id: string): Promise<SuccessResponse<ResultDocument>>;
|
|
2519
|
+
|
|
2520
|
+
type ComputeInput = ComputeDocument | ComputeDocument[] | null | undefined;
|
|
2521
|
+
declare function normalizeComputes(compute: ComputeInput): ComputeDocument[];
|
|
2522
|
+
/**
|
|
2523
|
+
* Map a `palliora-compute.results` row onto the compute-request shape used by
|
|
2524
|
+
* session phases (jobId, orchestrator, resultTx, fees).
|
|
2525
|
+
*/
|
|
2526
|
+
declare function resultToCompute(result: ResultDocument): ComputeDocument;
|
|
2527
|
+
declare function deriveContractStatus(agreement: ContractDocument | null | undefined, compute: ComputeInput): ContractFlowStatus | "—";
|
|
2528
|
+
declare function buildContractPhases(agreement: ContractDocument | null | undefined, compute: ComputeInput): ContractFlowPhase[];
|
|
2529
|
+
/**
|
|
2530
|
+
* Fetch a compute contract, optional `/api/compute/:id` payload, and
|
|
2531
|
+
* `palliora-compute.results` rows, then derive session lifecycle status and
|
|
2532
|
+
* the five UI phases used by the explorer.
|
|
2533
|
+
*
|
|
2534
|
+
* Missing compute (`404`) or results (`404`) is treated as empty.
|
|
2535
|
+
*/
|
|
2536
|
+
declare function getContractFlow(client: IndexerClient, id: string): Promise<SuccessResponse<ContractFlow>>;
|
|
2537
|
+
/**
|
|
2538
|
+
* Fetch an artefact together with its access records and blobs.
|
|
2539
|
+
*
|
|
2540
|
+
* Missing access (`404`) becomes `[]`. Missing blobs are skipped.
|
|
2541
|
+
*/
|
|
2542
|
+
declare function getArtefactFlow(client: IndexerClient, id: string, accessQuery?: ArtefactAccessQuery): Promise<SuccessResponse<ArtefactFlow>>;
|
|
2543
|
+
|
|
2544
|
+
/**
|
|
2545
|
+
* Fetch a paginated list of blocks, including chain stats.
|
|
2546
|
+
*
|
|
2547
|
+
* `GET /api/blocks`
|
|
2548
|
+
*
|
|
2549
|
+
* Response shape: `{ success: true, data: { blocks: BlockDocument[], stats? } }`
|
|
2550
|
+
*
|
|
2551
|
+
* @param client Configured {@link IndexerClient}
|
|
2552
|
+
* @param query Pagination — `page` (0-indexed), `page_size`
|
|
2553
|
+
*/
|
|
2554
|
+
declare function getBlocks(client: IndexerClient, query?: BlocksQuery): Promise<SuccessResponse<BlocksData>>;
|
|
2555
|
+
|
|
2556
|
+
/**
|
|
2557
|
+
* Chain summary used by the explorer home and blocks pages.
|
|
2558
|
+
*
|
|
2559
|
+
* `GET /api/overview`
|
|
2560
|
+
*
|
|
2561
|
+
* @param client Configured {@link IndexerClient}
|
|
2562
|
+
*/
|
|
2563
|
+
declare function getOverview(client: IndexerClient): Promise<SuccessResponse<Overview>>;
|
|
2564
|
+
|
|
2565
|
+
/**
|
|
2566
|
+
* Paginated chain events, newest block first.
|
|
2567
|
+
*
|
|
2568
|
+
* `GET /api/events`
|
|
2569
|
+
*
|
|
2570
|
+
* @param client Configured {@link IndexerClient}
|
|
2571
|
+
* @param query Pagination — `page` (0-indexed), `page_size`
|
|
2572
|
+
*/
|
|
2573
|
+
declare function getEvents(client: IndexerClient, query?: EventsQuery): Promise<SuccessResponse<EventsData>>;
|
|
2574
|
+
|
|
2575
|
+
/**
|
|
2576
|
+
* Fetch a call by block height and extrinsic index.
|
|
2577
|
+
*
|
|
2578
|
+
* `GET /api/call`
|
|
2579
|
+
*
|
|
2580
|
+
* @param client Configured {@link IndexerClient}
|
|
2581
|
+
* @param query **Required** — `blockHeight` and `extrinsicIndex`
|
|
2582
|
+
*/
|
|
2583
|
+
declare function getCall(client: IndexerClient, query: CallQuery): Promise<SuccessResponse<CallDocument>>;
|
|
2584
|
+
/**
|
|
2585
|
+
* Fetch call metadata by block height and extrinsic index.
|
|
2586
|
+
*
|
|
2587
|
+
* `GET /api/call-metadata`
|
|
2588
|
+
*
|
|
2589
|
+
* @param client Configured {@link IndexerClient}
|
|
2590
|
+
* @param query **Required** — `blockHeight` and `extrinsicIndex`
|
|
2591
|
+
*/
|
|
2592
|
+
declare function getCallMetadata(client: IndexerClient, query: CallMetadataQuery): Promise<SuccessResponse<CallMetadataDocument>>;
|
|
2593
|
+
/**
|
|
2594
|
+
* Fetch call arguments by metadata hash.
|
|
2595
|
+
*
|
|
2596
|
+
* `GET /api/call-args`
|
|
2597
|
+
*
|
|
2598
|
+
* @param client Configured {@link IndexerClient}
|
|
2599
|
+
* @param query **Required** — `metadataHash`
|
|
2600
|
+
*/
|
|
2601
|
+
declare function getCallArgs(client: IndexerClient, query: CallArgsQuery): Promise<SuccessResponse<CallArgsDocument>>;
|
|
2602
|
+
|
|
2603
|
+
/**
|
|
2604
|
+
* Fetch a paginated list of transfers, sorted by block height descending.
|
|
2605
|
+
*
|
|
2606
|
+
* `GET /api/transfers`
|
|
2607
|
+
*
|
|
2608
|
+
* @param client Configured {@link IndexerClient}
|
|
2609
|
+
* @param query Pagination — `page` (0-indexed), `page_size`
|
|
2610
|
+
*/
|
|
2611
|
+
declare function getTransfers(client: IndexerClient, query?: TransfersQuery): Promise<SuccessResponse<TransferDocument[]>>;
|
|
2612
|
+
|
|
2613
|
+
/**
|
|
2614
|
+
* Fetch a paginated list of extrinsics, sorted by block height descending.
|
|
2615
|
+
*
|
|
2616
|
+
* `GET /api/extrinsics`
|
|
2617
|
+
*
|
|
2618
|
+
* Fields `nonce`, `_id`, `tip`, and `signature` are excluded by the indexer.
|
|
2619
|
+
*
|
|
2620
|
+
* @param client Configured {@link IndexerClient}
|
|
2621
|
+
* @param query Pagination — `page` (0-indexed, default 0), `page_size` (default 10, max 100);
|
|
2622
|
+
* `signed_only: true` filters to signed extrinsics only
|
|
2623
|
+
* @returns `{ success: true, data: ExtrinsicDocument[], total: number }`
|
|
2624
|
+
*/
|
|
2625
|
+
declare function getExtrinsics(client: IndexerClient, query?: ExtrinsicsQuery): Promise<PaginatedResponse<ExtrinsicDocument>>;
|
|
2626
|
+
/**
|
|
2627
|
+
* Fetch a single extrinsic by block index or transaction hash.
|
|
2628
|
+
*
|
|
2629
|
+
* `GET /api/extrinsic/:indexOrHash`
|
|
2630
|
+
*
|
|
2631
|
+
* Accepts either:
|
|
2632
|
+
* - Block index: `blockHeight-extrinsicIndex` (e.g. `"2528092-2"`)
|
|
2633
|
+
* - Transaction hash: `0x`-prefixed 64-char hex string
|
|
2634
|
+
*
|
|
2635
|
+
* @param client Configured {@link IndexerClient}
|
|
2636
|
+
* @param indexOrHash Block-index pair or extrinsic hash
|
|
2637
|
+
* @throws {IndexerHttpError} `400` for invalid id format, `404` when not found
|
|
2638
|
+
*/
|
|
2639
|
+
declare function getExtrinsic(client: IndexerClient, indexOrHash: string): Promise<SuccessResponse<ExtrinsicDocument>>;
|
|
2640
|
+
|
|
2641
|
+
/**
|
|
2642
|
+
* Fetch the top 50 addresses by balance.
|
|
2643
|
+
*
|
|
2644
|
+
* `GET /api/addresses`
|
|
2645
|
+
*
|
|
2646
|
+
* **Note:** This endpoint returns a raw array, not a `{ success, data }` envelope.
|
|
2647
|
+
*
|
|
2648
|
+
* @param client Configured {@link IndexerClient}
|
|
2649
|
+
*/
|
|
2650
|
+
declare function getAddresses(client: IndexerClient): Promise<AddressDocument[]>;
|
|
2651
|
+
/**
|
|
2652
|
+
* Fetch a single address document.
|
|
2653
|
+
*
|
|
2654
|
+
* `GET /api/address/:address`
|
|
2655
|
+
*
|
|
2656
|
+
* **Note:** This endpoint returns `{ data }` without a `success` field.
|
|
2657
|
+
*
|
|
2658
|
+
* @param client Configured {@link IndexerClient}
|
|
2659
|
+
* @param address The substrate address to look up
|
|
2660
|
+
*/
|
|
2661
|
+
declare function getAddress(client: IndexerClient, address: string): Promise<DataOnlyResponse<AddressDocument>>;
|
|
2662
|
+
|
|
2663
|
+
/**
|
|
2664
|
+
* Fetch a blob by its block-height ID.
|
|
2665
|
+
*
|
|
2666
|
+
* `GET /api/blob/:id`
|
|
2667
|
+
*
|
|
2668
|
+
* @param client Configured {@link IndexerClient}
|
|
2669
|
+
* @param id Block height (integer) identifying the blob
|
|
2670
|
+
*/
|
|
2671
|
+
declare function getBlob(client: IndexerClient, id: number): Promise<SuccessResponse<BlobDocument>>;
|
|
2672
|
+
|
|
2673
|
+
/**
|
|
2674
|
+
* Fetch guardian groups, optionally filtered by guardian address.
|
|
2675
|
+
* Results are deduplicated and enriched with identity names.
|
|
2676
|
+
*
|
|
2677
|
+
* `GET /api/guardian-groups`
|
|
2678
|
+
*
|
|
2679
|
+
* Each group includes `guardians: string[]` and a parallel `guardianNames`
|
|
2680
|
+
* array (`string | null`) from the identity database.
|
|
2681
|
+
*
|
|
2682
|
+
* @param client Configured {@link IndexerClient}
|
|
2683
|
+
* @param query Optional filter — `guardian` address
|
|
2684
|
+
*/
|
|
2685
|
+
declare function getGuardianGroups(client: IndexerClient, query?: GuardianGroupsQuery): Promise<SuccessResponse<GuardianGroupDocument[]>>;
|
|
2686
|
+
/**
|
|
2687
|
+
* Flatten identity-enriched guardian groups into a unique list of guardians.
|
|
2688
|
+
*
|
|
2689
|
+
* Derived from {@link getGuardianGroups}; there is no separate `/api/guardians`
|
|
2690
|
+
* endpoint. A 404 (no groups) returns an empty list.
|
|
2691
|
+
*
|
|
2692
|
+
* @returns `{ success: true, data: GuardianDocument[] }`
|
|
2693
|
+
* where each item is `{ account, displayName }`.
|
|
2694
|
+
*/
|
|
2695
|
+
declare function getGuardians(client: IndexerClient): Promise<SuccessResponse<GuardianDocument[]>>;
|
|
2696
|
+
/**
|
|
2697
|
+
* Fetch identity for a single guardian account.
|
|
2698
|
+
*
|
|
2699
|
+
* Uses `GET /api/guardian-groups?guardian=<account>` and returns
|
|
2700
|
+
* `{ account, displayName }`. `displayName` is `null` when the account has
|
|
2701
|
+
* no identity or is not in any indexed group.
|
|
2702
|
+
*/
|
|
2703
|
+
declare function getGuardian(client: IndexerClient, account: string): Promise<SuccessResponse<GuardianDocument>>;
|
|
2704
|
+
/**
|
|
2705
|
+
* Fetch a single guardian group by its group ID.
|
|
2706
|
+
*
|
|
2707
|
+
* `GET /api/guardian-group/:id`
|
|
2708
|
+
*
|
|
2709
|
+
* @param client Configured {@link IndexerClient}
|
|
2710
|
+
* @param id The `groupId`
|
|
2711
|
+
*/
|
|
2712
|
+
declare function getGuardianGroup(client: IndexerClient, id: string): Promise<SuccessResponse<GuardianGroupDocument>>;
|
|
2713
|
+
|
|
2714
|
+
/**
|
|
2715
|
+
* Fetch access records from the **legacy** statescan-polkadot-data database.
|
|
2716
|
+
*
|
|
2717
|
+
* `GET /api/access`
|
|
2718
|
+
*
|
|
2719
|
+
* > **Deprecated** — superseded by `getArtefactAccess`. Kept for backward compatibility.
|
|
2720
|
+
*
|
|
2721
|
+
* @param client Configured {@link IndexerClient}
|
|
2722
|
+
* @param query Optional filters — `blockHeight`, `extrinsicIndex`, `retriver`
|
|
2723
|
+
*/
|
|
2724
|
+
declare function getAccess(client: IndexerClient, query?: AccessQuery): Promise<AccessResponse<AccessDocument>>;
|
|
2725
|
+
|
|
1439
2726
|
declare function rotateAndSetKeys(account: KeyringPair): Promise<void>;
|
|
1440
2727
|
declare function setWorker(account: KeyringPair): Promise<void>;
|
|
1441
2728
|
|
|
1442
|
-
export { API_EXTENSIONS, API_RPC, API_TYPES, AccountSourceType, type AsymmetricHybridParams, type AsymmetricParams, type AtomicPaliAmount, type BlockScanFilter, type BlockScanResult, type CipherSuite, type ComputeContract, CryptoType, type CurrencyId,
|
|
2729
|
+
export { API_EXTENSIONS, API_RPC, API_TYPES, type AccessDocument, type AccessQuery, type AccessResponse, type AccountInfo, AccountSourceType, type ActiveGuardian, type AddressDocument, type AgreementStatus, type ArtefactAccessQuery, type ArtefactContractsQuery, type ArtefactDocument, type ArtefactFlow, type ArtefactType, type ArtefactsQuery, type AsymmetricHybridParams, type AsymmetricParams, type AtomicPaliAmount, type AuctionDetail, type AuctionWinner, type Balance, type BlobDocument, type BlockDocument, type BlockScanFilter, type BlockScanResult, type BlocksData, type BlocksQuery, COMPUTE_TYPES, type CallArgsDocument, type CallArgsQuery, type CallDocument, type CallMetadataDocument, type CallMetadataQuery, type CallQuery, type ChainEvent, type CipherSuite, type ComputeContract, type ComputeDocument, type ComputeMetadataInput, type ComputeMode, type ComputeType, type ContractDocument, type ContractFlow, type ContractFlowPhase, type ContractFlowStatus, type ContractInfo, type ContractParams, type ContractResponse, type ContractType, type ContractsQuery, CostEstimationError, CryptoType, type CurrencyId, DEFAULT_COMPUTE_PAYLOAD, DEFAULT_EMPTY_PAYLOAD, type DataAgreementMetadata, type DataAgreementParams, type DataContractParams, type DataOnlyResponse, type Ed25519Params, type EncryptedInferenceComputeParams, type EncryptedInferenceSubscriptionInvocationParams, type EncryptedInferenceSubscriptionParams, type ErrorResponse, type EstimateResult, type EstimateStatusResponse, type EventsData, type EventsQuery, type ExtrinsicDocument, type ExtrinsicsQuery, type Fee, type FeeParams, type FeeThresholdInput, FileFromMetadataRef, type GuardianAddress, type GuardianDocument, type GuardianEntry, type GuardianGroupDocument, type GuardianGroupInfo, type GuardianGroupsQuery, type GuardianJoinPrefs, type GuardianParticipants, type IdentityFields, IndexerClient, type IndexerClientOptions, IndexerHttpError, type IndexerMeta, type InferenceComputeParams, type InvokeAgreementInput, type KdfParams, type LatestBlock, type LatestBlocksResult, MCryptFs, MCryptFsReader, MCryptFsWriter, type MinFeeBreakdown, type MinFeeInput, NO_GUARDIAN_GROUP, type OnChainRef, type OpenAuction, type Overview, PALI_DECIMALS, PALI_SYMBOL, type PaginatedResponse, type PaliAmountInput, type PallioraConfig, type ResolvedAuction, type ResultDocument, type ResultFeeBreakdown, type ResultFeeParty, type ResultsQuery, S3Provider, type Secp256k1Params, type SilentThresholdParams, type SimpleComputeParams, type StartedEstimate, type StorageProvider, StorageRouter, type StoreType, type StoredComputeParams, type SubmissionReceipt, type SubmitTEDataResult, type SuccessResponse, type SymmetricParams, type ThresholdHybridParams, type ThresholdParams, type TransferDocument, type TransfersQuery, type UploadOptions, type WaitForEstimateOptions, addStake, base64ToUint8Array, buildComputeMetadata, buildContractPhases, buildFee, clearTokenCache, createAccount, createAccountFromMagicLink, createAgreement, createGuardianGroup, createGuardianGroupAndWatch, createSimpleAgreement, dataContract, debugLog, decodeAggregateKey, decodeField, decodePowersOfTau, decrypt, deriveContractStatus, disconnectApi, encrypt as ecncryptTest, encodeCiphertext, encrypt$1 as encrypt, encryptedInferenceCompute, encryptedInferenceSubscription, encryptedInferenceSubscriptionInvocation, estimateMinFee, fetchAndDecodeExtrinsic, fetchTokenProperties, findEvent, formatBalanceWithTokenProperties, formatPaliAmount, fromAtomicPaliAmount, fundAccount, gen_shared_key, gen_stretched_key, generateRandomBytes, getAccess, getAccountInfo, getActiveGuardians, getAddress, getAddresses, getAgents, getAgreementCreatedRequestId, getApi, getArtefact, getArtefactAccess, getArtefactContracts, getArtefactFlow, getArtefacts, getArtefactsByStoreType, getAuction, getAuthServiceUrl, getAwsRegion, getAwsS3Bucket, getBalance, getBlob, getBlocks, getCachedTokenProperties, getCall, getCallArgs, getCallMetadata, getCompute, getContract, getContractFlow, getContractInfo, getContracts, getCostEstimatorUrl, getDatasets, getEncKeyring, getEstimateResult, getEvents, getExecutables, getExtrinsic, getExtrinsics, getFeeParams, getFileMetadataCall, getGuardian, getGuardianAddress, getGuardianGroup, getGuardianGroupInfo, getGuardianGroups, getGuardianList, getGuardianNwParams, getGuardianParticipants, getGuardians, getKeyring, getLatestBlocks, getModels, getOverview, getPallioraRpcUrl, getPallioraWs, getProvider, getResult, getResults, getTransfers, healthCheck, hexToUint8Array, inferenceCompute, init, invokeAgreement, isArtefactUsage, isDebug, isInitialized, joinGuardian, joinIdleStaker, joinValidator, listGuardianAuctions, listOpenAuctions, listResolvedGuardianAuctions, newStake, normalizeComputes, pairFromPrivateKeyHex, payoutStake, reduceStake, registerDataAgreement, registerGuardianWebhook, removeStake, resetConfig, resultToCompute, retrySignAndSend, rotateAndSetKeys, runAgent, scanForBlockEvent, setIdentity, setWorker, signAndSend, simpleCompute, startEstimate, storageRouter, storedCompute, submitAuctionBid, submitData, submitTEData, submitTEDataWithCipher, testCrypt, toAtomicPaliAmount, tokenToBigint, transfer, uint8ArrayToBase64, uploadData, uploadDataLegacy, waitForEstimate, waitForNextBlock, waitsForFinalization, watchForSubmissionReceipt, withdrawStake, writeMetadata };
|