@opendatalabs/vana-sdk 0.1.0-alpha.82bbb39 → 0.1.0-alpha.899ca9d
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 +42 -0
- package/dist/browser-DY8XDblx.d.ts +241 -0
- package/dist/browser.d.ts +1 -0
- package/dist/browser.js +309 -0
- package/dist/browser.js.map +1 -0
- package/dist/chains.browser.cjs +2 -2
- package/dist/chains.browser.cjs.map +1 -1
- package/dist/chains.browser.js +2 -2
- package/dist/chains.browser.js.map +1 -1
- package/dist/chains.cjs +2 -2
- package/dist/chains.cjs.map +1 -1
- package/dist/chains.js +2 -2
- package/dist/chains.js.map +1 -1
- package/dist/chains.node.cjs +2 -2
- package/dist/chains.node.cjs.map +1 -1
- package/dist/chains.node.js +2 -2
- package/dist/chains.node.js.map +1 -1
- package/dist/index.browser.d.ts +1756 -1479
- package/dist/index.browser.js +37686 -35103
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +38174 -35582
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.cts +1790 -1486
- package/dist/index.node.d.ts +1790 -1486
- package/dist/index.node.js +38402 -35813
- package/dist/index.node.js.map +1 -1
- package/dist/node-D9-F9uEP.d.cts +238 -0
- package/dist/node-D9-F9uEP.d.ts +238 -0
- package/dist/node.cjs +348 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +1 -0
- package/dist/node.d.ts +1 -0
- package/dist/node.js +311 -0
- package/dist/node.js.map +1 -0
- package/dist/platform.browser.d.ts +3 -236
- package/dist/platform.browser.js +31 -8
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.cjs +72 -62
- package/dist/platform.cjs.map +1 -1
- package/dist/platform.d.cts +2 -1
- package/dist/platform.d.ts +2 -1
- package/dist/platform.js +72 -62
- package/dist/platform.js.map +1 -1
- package/dist/platform.node.cjs +72 -62
- package/dist/platform.node.cjs.map +1 -1
- package/dist/platform.node.d.cts +7 -236
- package/dist/platform.node.d.ts +7 -236
- package/dist/platform.node.js +72 -62
- package/dist/platform.node.js.map +1 -1
- package/package.json +17 -12
package/dist/index.browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chain, Address, Hash, WalletClient, Account, Abi, GetContractReturnType, PublicClient } from 'viem';
|
|
1
|
+
import { Chain, Address, Hash, WalletClient, Account, Abi, GetContractReturnType, TransactionReceipt as TransactionReceipt$1, PublicClient } from 'viem';
|
|
2
2
|
export { Abi, Account, Address, Chain, GetContractReturnType, Hash, PublicClient, WalletClient } from 'viem';
|
|
3
3
|
import { Abi as Abi$1 } from 'abitype';
|
|
4
4
|
|
|
@@ -157,6 +157,14 @@ declare class StorageError extends Error {
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Base interface for types that need to be compatible with Record<string, unknown>
|
|
162
|
+
*
|
|
163
|
+
* @category Permissions
|
|
164
|
+
*/
|
|
165
|
+
interface RecordCompatible {
|
|
166
|
+
[key: string]: unknown;
|
|
167
|
+
}
|
|
160
168
|
/**
|
|
161
169
|
* Represents on-chain permission grant data without expensive off-chain resolution.
|
|
162
170
|
*
|
|
@@ -355,7 +363,7 @@ interface PermissionGrantMessage {
|
|
|
355
363
|
*
|
|
356
364
|
* @category Permissions
|
|
357
365
|
*/
|
|
358
|
-
interface PermissionInputMessage {
|
|
366
|
+
interface PermissionInputMessage extends RecordCompatible {
|
|
359
367
|
/** Nonce */
|
|
360
368
|
nonce: bigint;
|
|
361
369
|
/** Grantee ID */
|
|
@@ -370,7 +378,7 @@ interface PermissionInputMessage {
|
|
|
370
378
|
*
|
|
371
379
|
* @category Permissions
|
|
372
380
|
*/
|
|
373
|
-
interface RevokePermissionInput {
|
|
381
|
+
interface RevokePermissionInput extends RecordCompatible {
|
|
374
382
|
/** Nonce */
|
|
375
383
|
nonce: bigint;
|
|
376
384
|
/** Permission ID to revoke */
|
|
@@ -392,8 +400,8 @@ interface PermissionInfo {
|
|
|
392
400
|
granteeId: bigint;
|
|
393
401
|
/** Grant URL */
|
|
394
402
|
grant: string;
|
|
395
|
-
/** Signature bytes */
|
|
396
|
-
signature
|
|
403
|
+
/** Signature bytes (removed in newer contract versions) */
|
|
404
|
+
signature?: `0x${string}`;
|
|
397
405
|
/** Start block */
|
|
398
406
|
startBlock: bigint;
|
|
399
407
|
/** End block */
|
|
@@ -451,9 +459,7 @@ interface GrantFile {
|
|
|
451
459
|
*
|
|
452
460
|
* @category Permissions
|
|
453
461
|
*/
|
|
454
|
-
interface PermissionGrantTypedData {
|
|
455
|
-
/** EIP-712 domain */
|
|
456
|
-
domain: PermissionGrantDomain;
|
|
462
|
+
interface PermissionGrantTypedData extends GenericTypedData {
|
|
457
463
|
/** EIP-712 types */
|
|
458
464
|
types: {
|
|
459
465
|
Permission: Array<{
|
|
@@ -471,7 +477,7 @@ interface PermissionGrantTypedData {
|
|
|
471
477
|
*
|
|
472
478
|
* @category Permissions
|
|
473
479
|
*/
|
|
474
|
-
interface GenericTypedData {
|
|
480
|
+
interface GenericTypedData extends RecordCompatible {
|
|
475
481
|
/** EIP-712 domain */
|
|
476
482
|
domain: PermissionGrantDomain;
|
|
477
483
|
/** EIP-712 types */
|
|
@@ -612,13 +618,28 @@ interface Server {
|
|
|
612
618
|
publicKey: string;
|
|
613
619
|
}
|
|
614
620
|
/**
|
|
615
|
-
*
|
|
621
|
+
* Contract ServerInfo structure returned from the contract
|
|
616
622
|
*
|
|
617
623
|
* @category Permissions
|
|
618
624
|
*/
|
|
619
|
-
interface
|
|
625
|
+
interface ServerInfo {
|
|
626
|
+
/** Server ID */
|
|
627
|
+
id: bigint;
|
|
620
628
|
/** Server owner address */
|
|
621
629
|
owner: Address;
|
|
630
|
+
/** Server address */
|
|
631
|
+
serverAddress: Address;
|
|
632
|
+
/** Server public key */
|
|
633
|
+
publicKey: string;
|
|
634
|
+
/** Server URL */
|
|
635
|
+
url: string;
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Parameters for adding and trusting a server
|
|
639
|
+
*
|
|
640
|
+
* @category Permissions
|
|
641
|
+
*/
|
|
642
|
+
interface AddAndTrustServerParams {
|
|
622
643
|
/** Server address */
|
|
623
644
|
serverAddress: Address;
|
|
624
645
|
/** Server URL */
|
|
@@ -650,11 +671,9 @@ interface UntrustServerParams {
|
|
|
650
671
|
*
|
|
651
672
|
* @category Permissions
|
|
652
673
|
*/
|
|
653
|
-
interface AddAndTrustServerInput {
|
|
674
|
+
interface AddAndTrustServerInput extends RecordCompatible {
|
|
654
675
|
/** User nonce */
|
|
655
676
|
nonce: bigint;
|
|
656
|
-
/** Server owner address */
|
|
657
|
-
owner: Address;
|
|
658
677
|
/** Server address */
|
|
659
678
|
serverAddress: Address;
|
|
660
679
|
/** Server URL */
|
|
@@ -668,7 +687,7 @@ interface AddAndTrustServerInput {
|
|
|
668
687
|
* @category Permissions
|
|
669
688
|
* @deprecated Use AddAndTrustServerInput instead
|
|
670
689
|
*/
|
|
671
|
-
interface TrustServerInput {
|
|
690
|
+
interface TrustServerInput extends RecordCompatible {
|
|
672
691
|
/** User nonce */
|
|
673
692
|
nonce: bigint;
|
|
674
693
|
/** Server ID (numeric) */
|
|
@@ -679,7 +698,7 @@ interface TrustServerInput {
|
|
|
679
698
|
*
|
|
680
699
|
* @category Permissions
|
|
681
700
|
*/
|
|
682
|
-
interface UntrustServerInput {
|
|
701
|
+
interface UntrustServerInput extends RecordCompatible {
|
|
683
702
|
/** User nonce */
|
|
684
703
|
nonce: bigint;
|
|
685
704
|
/** Server ID (numeric) */
|
|
@@ -690,18 +709,16 @@ interface UntrustServerInput {
|
|
|
690
709
|
*
|
|
691
710
|
* @category Permissions
|
|
692
711
|
*/
|
|
693
|
-
interface AddAndTrustServerTypedData {
|
|
694
|
-
/** EIP-712 domain */
|
|
695
|
-
domain: PermissionGrantDomain;
|
|
712
|
+
interface AddAndTrustServerTypedData extends GenericTypedData {
|
|
696
713
|
/** EIP-712 types */
|
|
697
714
|
types: {
|
|
698
|
-
|
|
715
|
+
AddServer: Array<{
|
|
699
716
|
name: string;
|
|
700
717
|
type: string;
|
|
701
718
|
}>;
|
|
702
719
|
};
|
|
703
720
|
/** Primary type */
|
|
704
|
-
primaryType: "
|
|
721
|
+
primaryType: "AddServer";
|
|
705
722
|
/** Message to sign */
|
|
706
723
|
message: AddAndTrustServerInput;
|
|
707
724
|
}
|
|
@@ -711,9 +728,7 @@ interface AddAndTrustServerTypedData {
|
|
|
711
728
|
* @category Permissions
|
|
712
729
|
* @deprecated Use AddAndTrustServerTypedData instead
|
|
713
730
|
*/
|
|
714
|
-
interface TrustServerTypedData {
|
|
715
|
-
/** EIP-712 domain */
|
|
716
|
-
domain: PermissionGrantDomain;
|
|
731
|
+
interface TrustServerTypedData extends GenericTypedData {
|
|
717
732
|
/** EIP-712 types */
|
|
718
733
|
types: {
|
|
719
734
|
TrustServer: Array<{
|
|
@@ -731,9 +746,7 @@ interface TrustServerTypedData {
|
|
|
731
746
|
*
|
|
732
747
|
* @category Permissions
|
|
733
748
|
*/
|
|
734
|
-
interface UntrustServerTypedData {
|
|
735
|
-
/** EIP-712 domain */
|
|
736
|
-
domain: PermissionGrantDomain;
|
|
749
|
+
interface UntrustServerTypedData extends GenericTypedData {
|
|
737
750
|
/** EIP-712 types */
|
|
738
751
|
types: {
|
|
739
752
|
UntrustServer: Array<{
|
|
@@ -769,20 +782,20 @@ interface PermissionEvent {
|
|
|
769
782
|
* @category Permissions
|
|
770
783
|
*/
|
|
771
784
|
interface TrustedServerInfo {
|
|
772
|
-
/** Server ID
|
|
773
|
-
|
|
785
|
+
/** Server ID */
|
|
786
|
+
id: bigint;
|
|
774
787
|
/** Server owner address */
|
|
775
788
|
owner: Address;
|
|
776
|
-
/** Server URL */
|
|
777
|
-
url: string;
|
|
778
789
|
/** Server address */
|
|
779
790
|
serverAddress: Address;
|
|
780
791
|
/** Server public key */
|
|
781
792
|
publicKey: string;
|
|
782
|
-
/**
|
|
783
|
-
|
|
784
|
-
/**
|
|
785
|
-
|
|
793
|
+
/** Server URL */
|
|
794
|
+
url: string;
|
|
795
|
+
/** Start block when trust relationship began */
|
|
796
|
+
startBlock: bigint;
|
|
797
|
+
/** End block when trust relationship ended (0 if still active) */
|
|
798
|
+
endBlock: bigint;
|
|
786
799
|
}
|
|
787
800
|
/**
|
|
788
801
|
* Paginated result for trusted server queries
|
|
@@ -857,6 +870,21 @@ interface Grantee {
|
|
|
857
870
|
/** Permission IDs associated with this grantee */
|
|
858
871
|
permissionIds: number[];
|
|
859
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* Contract GranteeInfo structure returned from the contract
|
|
875
|
+
*
|
|
876
|
+
* @category Permissions
|
|
877
|
+
*/
|
|
878
|
+
interface GranteeInfo {
|
|
879
|
+
/** Grantee owner address */
|
|
880
|
+
owner: Address;
|
|
881
|
+
/** Grantee address */
|
|
882
|
+
granteeAddress: Address;
|
|
883
|
+
/** Grantee public key */
|
|
884
|
+
publicKey: string;
|
|
885
|
+
/** Permission IDs associated with this grantee */
|
|
886
|
+
permissionIds: readonly bigint[];
|
|
887
|
+
}
|
|
860
888
|
/**
|
|
861
889
|
* Parameters for registering a grantee
|
|
862
890
|
*
|
|
@@ -875,7 +903,7 @@ interface RegisterGranteeParams {
|
|
|
875
903
|
*
|
|
876
904
|
* @category Permissions
|
|
877
905
|
*/
|
|
878
|
-
interface RegisterGranteeInput extends
|
|
906
|
+
interface RegisterGranteeInput extends RecordCompatible {
|
|
879
907
|
/** User nonce */
|
|
880
908
|
nonce: bigint;
|
|
881
909
|
/** Grantee owner address */
|
|
@@ -890,9 +918,7 @@ interface RegisterGranteeInput extends Record<string, unknown> {
|
|
|
890
918
|
*
|
|
891
919
|
* @category Permissions
|
|
892
920
|
*/
|
|
893
|
-
interface RegisterGranteeTypedData {
|
|
894
|
-
/** EIP-712 domain */
|
|
895
|
-
domain: PermissionGrantDomain;
|
|
921
|
+
interface RegisterGranteeTypedData extends GenericTypedData {
|
|
896
922
|
/** EIP-712 types */
|
|
897
923
|
types: {
|
|
898
924
|
RegisterGrantee: Array<{
|
|
@@ -935,6 +961,68 @@ interface PaginatedGrantees {
|
|
|
935
961
|
/** Whether there are more grantees beyond this page */
|
|
936
962
|
hasMore: boolean;
|
|
937
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* Contract Permission structure as used in ServerFilesAndPermissionInput
|
|
966
|
+
*
|
|
967
|
+
* @category Permissions
|
|
968
|
+
*/
|
|
969
|
+
interface Permission {
|
|
970
|
+
/** Account address for the permission */
|
|
971
|
+
account: Address;
|
|
972
|
+
/** Permission key */
|
|
973
|
+
key: string;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Parameters for server files and permissions operations
|
|
977
|
+
*
|
|
978
|
+
* @category Permissions
|
|
979
|
+
*/
|
|
980
|
+
interface ServerFilesAndPermissionParams {
|
|
981
|
+
/** Grantee ID */
|
|
982
|
+
granteeId: bigint;
|
|
983
|
+
/** Grant URL or grant data */
|
|
984
|
+
grant: string;
|
|
985
|
+
/** File URLs */
|
|
986
|
+
fileUrls: string[];
|
|
987
|
+
/** Schema IDs for each file - use 0 for files without schema validation */
|
|
988
|
+
schemaIds: number[];
|
|
989
|
+
/** Server address */
|
|
990
|
+
serverAddress: Address;
|
|
991
|
+
/** Server URL */
|
|
992
|
+
serverUrl: string;
|
|
993
|
+
/** Server public key */
|
|
994
|
+
serverPublicKey: string;
|
|
995
|
+
/** File permissions array - permissions for each file */
|
|
996
|
+
filePermissions: Permission[][];
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* EIP-712 typed data for server files and permissions messages
|
|
1000
|
+
*
|
|
1001
|
+
* @category Permissions
|
|
1002
|
+
*/
|
|
1003
|
+
interface ServerFilesAndPermissionTypedData extends GenericTypedData {
|
|
1004
|
+
/** Message data structure */
|
|
1005
|
+
message: {
|
|
1006
|
+
/** User nonce */
|
|
1007
|
+
nonce: bigint;
|
|
1008
|
+
/** Grantee ID */
|
|
1009
|
+
granteeId: bigint;
|
|
1010
|
+
/** Grant URL */
|
|
1011
|
+
grant: string;
|
|
1012
|
+
/** File URLs */
|
|
1013
|
+
fileUrls: string[];
|
|
1014
|
+
/** Schema IDs for each file - use 0 for files without schema validation */
|
|
1015
|
+
schemaIds: bigint[];
|
|
1016
|
+
/** Server address */
|
|
1017
|
+
serverAddress: Address;
|
|
1018
|
+
/** Server URL */
|
|
1019
|
+
serverUrl: string;
|
|
1020
|
+
/** Server public key */
|
|
1021
|
+
serverPublicKey: string;
|
|
1022
|
+
/** File permissions array - permissions for each file */
|
|
1023
|
+
filePermissions: Permission[][];
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
938
1026
|
|
|
939
1027
|
/**
|
|
940
1028
|
* Marker interface to indicate that a Vana instance has storage configured.
|
|
@@ -1045,6 +1133,30 @@ interface RelayerCallbacks {
|
|
|
1045
1133
|
* @returns Promise resolving to the transaction hash
|
|
1046
1134
|
*/
|
|
1047
1135
|
submitUntrustServer?: (typedData: UntrustServerTypedData, signature: Hash) => Promise<Hash>;
|
|
1136
|
+
/**
|
|
1137
|
+
* Submit a signed add and trust server transaction for relay
|
|
1138
|
+
*
|
|
1139
|
+
* @param typedData - The EIP-712 typed data that was signed
|
|
1140
|
+
* @param signature - The user's signature
|
|
1141
|
+
* @returns Promise resolving to the transaction hash
|
|
1142
|
+
*/
|
|
1143
|
+
submitAddAndTrustServer?: (typedData: AddAndTrustServerTypedData, signature: Hash) => Promise<Hash>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Submit a signed permission addition transaction for relay
|
|
1146
|
+
*
|
|
1147
|
+
* @param typedData - The EIP-712 typed data that was signed
|
|
1148
|
+
* @param signature - The user's signature
|
|
1149
|
+
* @returns Promise resolving to the transaction hash
|
|
1150
|
+
*/
|
|
1151
|
+
submitAddPermission?: (typedData: GenericTypedData, signature: Hash) => Promise<Hash>;
|
|
1152
|
+
/**
|
|
1153
|
+
* Submit a signed server files and permissions transaction for relay
|
|
1154
|
+
*
|
|
1155
|
+
* @param typedData - The EIP-712 typed data that was signed
|
|
1156
|
+
* @param signature - The user's signature
|
|
1157
|
+
* @returns Promise resolving to the transaction hash
|
|
1158
|
+
*/
|
|
1159
|
+
submitAddServerFilesAndPermissions?: (typedData: ServerFilesAndPermissionTypedData, signature: Hash) => Promise<Hash>;
|
|
1048
1160
|
/**
|
|
1049
1161
|
* Submit a file addition for relay
|
|
1050
1162
|
*
|
|
@@ -1546,7 +1658,7 @@ interface ConfigValidationResult {
|
|
|
1546
1658
|
/**
|
|
1547
1659
|
* Union type of all canonical Vana contract names
|
|
1548
1660
|
*/
|
|
1549
|
-
type VanaContractName = "
|
|
1661
|
+
type VanaContractName = "DataPortabilityPermissions" | "DataPortabilityServers" | "DataPortabilityGrantees" | "DataRegistry" | "TeePool" | "ComputeEngine" | "TeePoolPhala" | "DataRefinerRegistry" | "QueryEngine" | "ComputeInstructionRegistry" | "TeePoolEphemeralStandard" | "TeePoolPersistentStandard" | "TeePoolPersistentGpu" | "TeePoolDedicatedStandard" | "TeePoolDedicatedGpu" | "VanaEpoch" | "DLPRegistry" | "DLPRegistryTreasury" | "DLPPerformance" | "DLPRewardDeployer" | "DLPRewardDeployerTreasury" | "DLPRewardSwap" | "SwapHelper" | "VanaPoolStaking" | "VanaPoolEntity" | "VanaPoolTreasury" | "DAT" | "DATFactory" | "DATPausable" | "DATVotes" | "DataLiquidityPool" | "DLPRoot";
|
|
1550
1662
|
/**
|
|
1551
1663
|
* Contract information with typed address and ABI
|
|
1552
1664
|
*/
|
|
@@ -2051,33 +2163,84 @@ interface BatchUploadResult {
|
|
|
2051
2163
|
errors?: string[];
|
|
2052
2164
|
}
|
|
2053
2165
|
/**
|
|
2054
|
-
*
|
|
2166
|
+
* Schema metadata from the blockchain (without fetched definition).
|
|
2167
|
+
*
|
|
2168
|
+
* This represents the on-chain schema registration data before the
|
|
2169
|
+
* definition has been fetched from the storage URL.
|
|
2170
|
+
*
|
|
2171
|
+
* @category Data Management
|
|
2172
|
+
*/
|
|
2173
|
+
interface SchemaMetadata {
|
|
2174
|
+
/** Schema ID */
|
|
2175
|
+
id: number;
|
|
2176
|
+
/** Schema name */
|
|
2177
|
+
name: string;
|
|
2178
|
+
/** Schema dialect ('json' or 'sqlite') */
|
|
2179
|
+
dialect: "json" | "sqlite";
|
|
2180
|
+
/** URL containing the schema definition */
|
|
2181
|
+
definitionUrl: string;
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Complete schema with all definition fields populated.
|
|
2185
|
+
* This is what schemas.get() returns - a schema with the definition fetched.
|
|
2186
|
+
*/
|
|
2187
|
+
interface CompleteSchema extends SchemaMetadata {
|
|
2188
|
+
/** Version of the schema */
|
|
2189
|
+
version: string;
|
|
2190
|
+
/** Optional description of the schema */
|
|
2191
|
+
description?: string;
|
|
2192
|
+
/** Optional version of the dialect */
|
|
2193
|
+
dialectVersion?: string;
|
|
2194
|
+
/** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' */
|
|
2195
|
+
schema: object | string;
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* Schema with optional definition fields.
|
|
2055
2199
|
*
|
|
2056
2200
|
* Schemas define the structure and validation rules for user data processed by refiners.
|
|
2057
2201
|
* They ensure data quality and consistency across the Vana network by specifying how
|
|
2058
2202
|
* raw user data should be formatted, validated, and processed.
|
|
2059
2203
|
*
|
|
2204
|
+
* When the definition has been fetched (via schemas.get() or schemas.list() with includeDefinitions),
|
|
2205
|
+
* the version and schema fields will be populated. Otherwise, only the metadata fields are present.
|
|
2206
|
+
*
|
|
2060
2207
|
* @category Data Management
|
|
2061
2208
|
* @example
|
|
2062
2209
|
* ```typescript
|
|
2063
|
-
*
|
|
2210
|
+
* // Complete schema from schemas.get()
|
|
2211
|
+
* const completeSchema: Schema = {
|
|
2212
|
+
* id: 5,
|
|
2213
|
+
* name: 'Social Media Profile',
|
|
2214
|
+
* dialect: 'json',
|
|
2215
|
+
* definitionUrl: 'ipfs://QmSchema...',
|
|
2216
|
+
* version: '1.0.0',
|
|
2217
|
+
* description: 'Schema for validating social media profile data',
|
|
2218
|
+
* schema: { // JSON Schema object
|
|
2219
|
+
* type: 'object',
|
|
2220
|
+
* properties: {
|
|
2221
|
+
* username: { type: 'string' }
|
|
2222
|
+
* }
|
|
2223
|
+
* }
|
|
2224
|
+
* };
|
|
2225
|
+
*
|
|
2226
|
+
* // Metadata-only schema from schemas.list() without includeDefinitions
|
|
2227
|
+
* const metadataSchema: Schema = {
|
|
2064
2228
|
* id: 5,
|
|
2065
2229
|
* name: 'Social Media Profile',
|
|
2066
|
-
*
|
|
2067
|
-
*
|
|
2068
|
-
* description: 'Schema for validating social media profile data'
|
|
2230
|
+
* dialect: 'json',
|
|
2231
|
+
* definitionUrl: 'ipfs://QmSchema...'
|
|
2069
2232
|
* };
|
|
2070
2233
|
* ```
|
|
2071
2234
|
*/
|
|
2072
|
-
interface Schema {
|
|
2073
|
-
/**
|
|
2074
|
-
|
|
2075
|
-
/**
|
|
2076
|
-
|
|
2077
|
-
/**
|
|
2078
|
-
|
|
2079
|
-
/**
|
|
2080
|
-
|
|
2235
|
+
interface Schema extends SchemaMetadata {
|
|
2236
|
+
/** Version of the schema (present when definition is fetched) */
|
|
2237
|
+
version?: string;
|
|
2238
|
+
/** Optional description of the schema */
|
|
2239
|
+
description?: string;
|
|
2240
|
+
/** Optional version of the dialect */
|
|
2241
|
+
dialectVersion?: string;
|
|
2242
|
+
/** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' (present when definition is fetched) */
|
|
2243
|
+
schema?: object | string;
|
|
2081
2244
|
}
|
|
2082
2245
|
/**
|
|
2083
2246
|
* Represents a refiner with schema information
|
|
@@ -2106,8 +2269,8 @@ interface Refiner {
|
|
|
2106
2269
|
interface AddSchemaParams {
|
|
2107
2270
|
/** Schema name */
|
|
2108
2271
|
name: string;
|
|
2109
|
-
/** Schema
|
|
2110
|
-
|
|
2272
|
+
/** Schema dialect */
|
|
2273
|
+
dialect: string;
|
|
2111
2274
|
/** URL containing the schema definition */
|
|
2112
2275
|
definitionUrl: string;
|
|
2113
2276
|
}
|
|
@@ -2182,13 +2345,7 @@ interface UpdateSchemaIdResult {
|
|
|
2182
2345
|
transactionHash: Hash;
|
|
2183
2346
|
}
|
|
2184
2347
|
/**
|
|
2185
|
-
*
|
|
2186
|
-
*
|
|
2187
|
-
* @category Data Management
|
|
2188
|
-
*/
|
|
2189
|
-
type TrustedServerQueryMode = "subgraph" | "rpc" | "auto";
|
|
2190
|
-
/**
|
|
2191
|
-
* Trusted server data structure (unified format for both subgraph and RPC modes)
|
|
2348
|
+
* Trusted server data structure
|
|
2192
2349
|
*
|
|
2193
2350
|
* @category Data Management
|
|
2194
2351
|
*/
|
|
@@ -2207,42 +2364,23 @@ interface TrustedServer {
|
|
|
2207
2364
|
trustIndex?: number;
|
|
2208
2365
|
}
|
|
2209
2366
|
/**
|
|
2210
|
-
* Parameters for getUserTrustedServers
|
|
2367
|
+
* Parameters for getUserTrustedServers method
|
|
2211
2368
|
*
|
|
2212
2369
|
* @category Data Management
|
|
2213
2370
|
*/
|
|
2214
2371
|
interface GetUserTrustedServersParams {
|
|
2215
|
-
/** User address to query */
|
|
2372
|
+
/** User address to query trusted servers for */
|
|
2216
2373
|
user: Address;
|
|
2217
|
-
/**
|
|
2218
|
-
mode?: TrustedServerQueryMode;
|
|
2219
|
-
/** Subgraph URL (required for subgraph mode) */
|
|
2374
|
+
/** Optional subgraph URL to override default */
|
|
2220
2375
|
subgraphUrl?: string;
|
|
2221
|
-
/**
|
|
2376
|
+
/** Maximum number of results */
|
|
2222
2377
|
limit?: number;
|
|
2223
|
-
/**
|
|
2378
|
+
/** Number of results to skip */
|
|
2224
2379
|
offset?: number;
|
|
2225
2380
|
}
|
|
2226
|
-
/**
|
|
2227
|
-
* Result of getUserTrustedServers query
|
|
2228
|
-
*
|
|
2229
|
-
* @category Data Management
|
|
2230
|
-
*/
|
|
2231
|
-
interface GetUserTrustedServersResult {
|
|
2232
|
-
/** Array of trusted servers */
|
|
2233
|
-
servers: TrustedServer[];
|
|
2234
|
-
/** Query mode that was actually used */
|
|
2235
|
-
usedMode: TrustedServerQueryMode;
|
|
2236
|
-
/** Total count (only available in RPC mode) */
|
|
2237
|
-
total?: number;
|
|
2238
|
-
/** Whether there are more servers (pagination info for RPC mode) */
|
|
2239
|
-
hasMore?: boolean;
|
|
2240
|
-
/** Any warnings or fallback information */
|
|
2241
|
-
warnings?: string[];
|
|
2242
|
-
}
|
|
2243
2381
|
|
|
2244
2382
|
declare const contractAbis: {
|
|
2245
|
-
readonly
|
|
2383
|
+
readonly DataPortabilityPermissions: readonly [{
|
|
2246
2384
|
readonly inputs: readonly [];
|
|
2247
2385
|
readonly stateMutability: "nonpayable";
|
|
2248
2386
|
readonly type: "constructor";
|
|
@@ -2346,6 +2484,30 @@ declare const contractAbis: {
|
|
|
2346
2484
|
}];
|
|
2347
2485
|
readonly name: "InvalidNonce";
|
|
2348
2486
|
readonly type: "error";
|
|
2487
|
+
}, {
|
|
2488
|
+
readonly inputs: readonly [{
|
|
2489
|
+
readonly internalType: "uint256";
|
|
2490
|
+
readonly name: "filesLength";
|
|
2491
|
+
readonly type: "uint256";
|
|
2492
|
+
}, {
|
|
2493
|
+
readonly internalType: "uint256";
|
|
2494
|
+
readonly name: "permissionsLength";
|
|
2495
|
+
readonly type: "uint256";
|
|
2496
|
+
}];
|
|
2497
|
+
readonly name: "InvalidPermissionsLength";
|
|
2498
|
+
readonly type: "error";
|
|
2499
|
+
}, {
|
|
2500
|
+
readonly inputs: readonly [{
|
|
2501
|
+
readonly internalType: "uint256";
|
|
2502
|
+
readonly name: "filesLength";
|
|
2503
|
+
readonly type: "uint256";
|
|
2504
|
+
}, {
|
|
2505
|
+
readonly internalType: "uint256";
|
|
2506
|
+
readonly name: "schemaIdsLength";
|
|
2507
|
+
readonly type: "uint256";
|
|
2508
|
+
}];
|
|
2509
|
+
readonly name: "InvalidSchemaIdsLength";
|
|
2510
|
+
readonly type: "error";
|
|
2349
2511
|
}, {
|
|
2350
2512
|
readonly inputs: readonly [];
|
|
2351
2513
|
readonly name: "InvalidSignature";
|
|
@@ -2604,6 +2766,70 @@ declare const contractAbis: {
|
|
|
2604
2766
|
}];
|
|
2605
2767
|
readonly stateMutability: "nonpayable";
|
|
2606
2768
|
readonly type: "function";
|
|
2769
|
+
}, {
|
|
2770
|
+
readonly inputs: readonly [{
|
|
2771
|
+
readonly components: readonly [{
|
|
2772
|
+
readonly internalType: "uint256";
|
|
2773
|
+
readonly name: "nonce";
|
|
2774
|
+
readonly type: "uint256";
|
|
2775
|
+
}, {
|
|
2776
|
+
readonly internalType: "uint256";
|
|
2777
|
+
readonly name: "granteeId";
|
|
2778
|
+
readonly type: "uint256";
|
|
2779
|
+
}, {
|
|
2780
|
+
readonly internalType: "string";
|
|
2781
|
+
readonly name: "grant";
|
|
2782
|
+
readonly type: "string";
|
|
2783
|
+
}, {
|
|
2784
|
+
readonly internalType: "string[]";
|
|
2785
|
+
readonly name: "fileUrls";
|
|
2786
|
+
readonly type: "string[]";
|
|
2787
|
+
}, {
|
|
2788
|
+
readonly internalType: "uint256[]";
|
|
2789
|
+
readonly name: "schemaIds";
|
|
2790
|
+
readonly type: "uint256[]";
|
|
2791
|
+
}, {
|
|
2792
|
+
readonly internalType: "address";
|
|
2793
|
+
readonly name: "serverAddress";
|
|
2794
|
+
readonly type: "address";
|
|
2795
|
+
}, {
|
|
2796
|
+
readonly internalType: "string";
|
|
2797
|
+
readonly name: "serverUrl";
|
|
2798
|
+
readonly type: "string";
|
|
2799
|
+
}, {
|
|
2800
|
+
readonly internalType: "string";
|
|
2801
|
+
readonly name: "serverPublicKey";
|
|
2802
|
+
readonly type: "string";
|
|
2803
|
+
}, {
|
|
2804
|
+
readonly components: readonly [{
|
|
2805
|
+
readonly internalType: "address";
|
|
2806
|
+
readonly name: "account";
|
|
2807
|
+
readonly type: "address";
|
|
2808
|
+
}, {
|
|
2809
|
+
readonly internalType: "string";
|
|
2810
|
+
readonly name: "key";
|
|
2811
|
+
readonly type: "string";
|
|
2812
|
+
}];
|
|
2813
|
+
readonly internalType: "struct IDataRegistry.Permission[][]";
|
|
2814
|
+
readonly name: "filePermissions";
|
|
2815
|
+
readonly type: "tuple[][]";
|
|
2816
|
+
}];
|
|
2817
|
+
readonly internalType: "struct IDataPortabilityPermissions.ServerFilesAndPermissionInput";
|
|
2818
|
+
readonly name: "serverFilesAndPermissionInput";
|
|
2819
|
+
readonly type: "tuple";
|
|
2820
|
+
}, {
|
|
2821
|
+
readonly internalType: "bytes";
|
|
2822
|
+
readonly name: "signature";
|
|
2823
|
+
readonly type: "bytes";
|
|
2824
|
+
}];
|
|
2825
|
+
readonly name: "addServerFilesAndPermissions";
|
|
2826
|
+
readonly outputs: readonly [{
|
|
2827
|
+
readonly internalType: "uint256";
|
|
2828
|
+
readonly name: "";
|
|
2829
|
+
readonly type: "uint256";
|
|
2830
|
+
}];
|
|
2831
|
+
readonly stateMutability: "nonpayable";
|
|
2832
|
+
readonly type: "function";
|
|
2607
2833
|
}, {
|
|
2608
2834
|
readonly inputs: readonly [];
|
|
2609
2835
|
readonly name: "dataPortabilityGrantees";
|
|
@@ -2768,20 +2994,6 @@ declare const contractAbis: {
|
|
|
2768
2994
|
readonly outputs: readonly [];
|
|
2769
2995
|
readonly stateMutability: "nonpayable";
|
|
2770
2996
|
readonly type: "function";
|
|
2771
|
-
}, {
|
|
2772
|
-
readonly inputs: readonly [{
|
|
2773
|
-
readonly internalType: "uint256";
|
|
2774
|
-
readonly name: "permissionId";
|
|
2775
|
-
readonly type: "uint256";
|
|
2776
|
-
}];
|
|
2777
|
-
readonly name: "isActivePermission";
|
|
2778
|
-
readonly outputs: readonly [{
|
|
2779
|
-
readonly internalType: "bool";
|
|
2780
|
-
readonly name: "";
|
|
2781
|
-
readonly type: "bool";
|
|
2782
|
-
}];
|
|
2783
|
-
readonly stateMutability: "view";
|
|
2784
|
-
readonly type: "function";
|
|
2785
2997
|
}, {
|
|
2786
2998
|
readonly inputs: readonly [{
|
|
2787
2999
|
readonly internalType: "address";
|
|
@@ -2868,10 +3080,6 @@ declare const contractAbis: {
|
|
|
2868
3080
|
readonly internalType: "string";
|
|
2869
3081
|
readonly name: "grant";
|
|
2870
3082
|
readonly type: "string";
|
|
2871
|
-
}, {
|
|
2872
|
-
readonly internalType: "bytes";
|
|
2873
|
-
readonly name: "signature";
|
|
2874
|
-
readonly type: "bytes";
|
|
2875
3083
|
}, {
|
|
2876
3084
|
readonly internalType: "uint256";
|
|
2877
3085
|
readonly name: "startBlock";
|
|
@@ -3159,7 +3367,7 @@ declare const contractAbis: {
|
|
|
3159
3367
|
readonly stateMutability: "pure";
|
|
3160
3368
|
readonly type: "function";
|
|
3161
3369
|
}];
|
|
3162
|
-
readonly
|
|
3370
|
+
readonly DataPortabilityServers: readonly [{
|
|
3163
3371
|
readonly inputs: readonly [];
|
|
3164
3372
|
readonly stateMutability: "nonpayable";
|
|
3165
3373
|
readonly type: "constructor";
|
|
@@ -3221,31 +3429,23 @@ declare const contractAbis: {
|
|
|
3221
3429
|
readonly type: "error";
|
|
3222
3430
|
}, {
|
|
3223
3431
|
readonly inputs: readonly [];
|
|
3224
|
-
readonly name: "
|
|
3432
|
+
readonly name: "EmptyPublicKey";
|
|
3225
3433
|
readonly type: "error";
|
|
3226
3434
|
}, {
|
|
3227
3435
|
readonly inputs: readonly [];
|
|
3228
|
-
readonly name: "
|
|
3436
|
+
readonly name: "EmptyUrl";
|
|
3229
3437
|
readonly type: "error";
|
|
3230
3438
|
}, {
|
|
3231
3439
|
readonly inputs: readonly [];
|
|
3232
|
-
readonly name: "
|
|
3440
|
+
readonly name: "EnforcedPause";
|
|
3233
3441
|
readonly type: "error";
|
|
3234
3442
|
}, {
|
|
3235
3443
|
readonly inputs: readonly [];
|
|
3236
|
-
readonly name: "
|
|
3444
|
+
readonly name: "ExpectedPause";
|
|
3237
3445
|
readonly type: "error";
|
|
3238
3446
|
}, {
|
|
3239
3447
|
readonly inputs: readonly [];
|
|
3240
|
-
readonly name: "
|
|
3241
|
-
readonly type: "error";
|
|
3242
|
-
}, {
|
|
3243
|
-
readonly inputs: readonly [{
|
|
3244
|
-
readonly internalType: "uint256";
|
|
3245
|
-
readonly name: "permissionId";
|
|
3246
|
-
readonly type: "uint256";
|
|
3247
|
-
}];
|
|
3248
|
-
readonly name: "InactivePermission";
|
|
3448
|
+
readonly name: "FailedInnerCall";
|
|
3249
3449
|
readonly type: "error";
|
|
3250
3450
|
}, {
|
|
3251
3451
|
readonly inputs: readonly [];
|
|
@@ -3265,960 +3465,51 @@ declare const contractAbis: {
|
|
|
3265
3465
|
readonly type: "error";
|
|
3266
3466
|
}, {
|
|
3267
3467
|
readonly inputs: readonly [];
|
|
3268
|
-
readonly name: "
|
|
3468
|
+
readonly name: "NotInitializing";
|
|
3269
3469
|
readonly type: "error";
|
|
3270
3470
|
}, {
|
|
3271
3471
|
readonly inputs: readonly [{
|
|
3272
3472
|
readonly internalType: "address";
|
|
3273
|
-
readonly name: "
|
|
3473
|
+
readonly name: "serverOwner";
|
|
3274
3474
|
readonly type: "address";
|
|
3275
3475
|
}, {
|
|
3276
3476
|
readonly internalType: "address";
|
|
3277
3477
|
readonly name: "requestor";
|
|
3278
3478
|
readonly type: "address";
|
|
3279
3479
|
}];
|
|
3280
|
-
readonly name: "
|
|
3480
|
+
readonly name: "NotServerOwner";
|
|
3281
3481
|
readonly type: "error";
|
|
3282
3482
|
}, {
|
|
3283
3483
|
readonly inputs: readonly [];
|
|
3284
|
-
readonly name: "
|
|
3484
|
+
readonly name: "ServerAlreadyRegistered";
|
|
3485
|
+
readonly type: "error";
|
|
3486
|
+
}, {
|
|
3487
|
+
readonly inputs: readonly [];
|
|
3488
|
+
readonly name: "ServerAlreadyTrusted";
|
|
3489
|
+
readonly type: "error";
|
|
3490
|
+
}, {
|
|
3491
|
+
readonly inputs: readonly [];
|
|
3492
|
+
readonly name: "ServerAlreadyUntrusted";
|
|
3493
|
+
readonly type: "error";
|
|
3494
|
+
}, {
|
|
3495
|
+
readonly inputs: readonly [];
|
|
3496
|
+
readonly name: "ServerNotFound";
|
|
3497
|
+
readonly type: "error";
|
|
3498
|
+
}, {
|
|
3499
|
+
readonly inputs: readonly [];
|
|
3500
|
+
readonly name: "ServerNotTrusted";
|
|
3285
3501
|
readonly type: "error";
|
|
3286
3502
|
}, {
|
|
3287
3503
|
readonly inputs: readonly [{
|
|
3288
|
-
readonly internalType: "
|
|
3289
|
-
readonly name: "
|
|
3290
|
-
readonly type: "
|
|
3504
|
+
readonly internalType: "string";
|
|
3505
|
+
readonly name: "existingUrl";
|
|
3506
|
+
readonly type: "string";
|
|
3291
3507
|
}, {
|
|
3292
|
-
readonly internalType: "
|
|
3293
|
-
readonly name: "
|
|
3294
|
-
readonly type: "
|
|
3508
|
+
readonly internalType: "string";
|
|
3509
|
+
readonly name: "providedUrl";
|
|
3510
|
+
readonly type: "string";
|
|
3295
3511
|
}];
|
|
3296
|
-
readonly name: "
|
|
3297
|
-
readonly type: "error";
|
|
3298
|
-
}, {
|
|
3299
|
-
readonly inputs: readonly [];
|
|
3300
|
-
readonly name: "UUPSUnauthorizedCallContext";
|
|
3301
|
-
readonly type: "error";
|
|
3302
|
-
}, {
|
|
3303
|
-
readonly inputs: readonly [{
|
|
3304
|
-
readonly internalType: "bytes32";
|
|
3305
|
-
readonly name: "slot";
|
|
3306
|
-
readonly type: "bytes32";
|
|
3307
|
-
}];
|
|
3308
|
-
readonly name: "UUPSUnsupportedProxiableUUID";
|
|
3309
|
-
readonly type: "error";
|
|
3310
|
-
}, {
|
|
3311
|
-
readonly inputs: readonly [];
|
|
3312
|
-
readonly name: "ZeroAddress";
|
|
3313
|
-
readonly type: "error";
|
|
3314
|
-
}, {
|
|
3315
|
-
readonly anonymous: false;
|
|
3316
|
-
readonly inputs: readonly [];
|
|
3317
|
-
readonly name: "EIP712DomainChanged";
|
|
3318
|
-
readonly type: "event";
|
|
3319
|
-
}, {
|
|
3320
|
-
readonly anonymous: false;
|
|
3321
|
-
readonly inputs: readonly [{
|
|
3322
|
-
readonly indexed: false;
|
|
3323
|
-
readonly internalType: "uint64";
|
|
3324
|
-
readonly name: "version";
|
|
3325
|
-
readonly type: "uint64";
|
|
3326
|
-
}];
|
|
3327
|
-
readonly name: "Initialized";
|
|
3328
|
-
readonly type: "event";
|
|
3329
|
-
}, {
|
|
3330
|
-
readonly anonymous: false;
|
|
3331
|
-
readonly inputs: readonly [{
|
|
3332
|
-
readonly indexed: false;
|
|
3333
|
-
readonly internalType: "address";
|
|
3334
|
-
readonly name: "account";
|
|
3335
|
-
readonly type: "address";
|
|
3336
|
-
}];
|
|
3337
|
-
readonly name: "Paused";
|
|
3338
|
-
readonly type: "event";
|
|
3339
|
-
}, {
|
|
3340
|
-
readonly anonymous: false;
|
|
3341
|
-
readonly inputs: readonly [{
|
|
3342
|
-
readonly indexed: true;
|
|
3343
|
-
readonly internalType: "uint256";
|
|
3344
|
-
readonly name: "permissionId";
|
|
3345
|
-
readonly type: "uint256";
|
|
3346
|
-
}, {
|
|
3347
|
-
readonly indexed: true;
|
|
3348
|
-
readonly internalType: "address";
|
|
3349
|
-
readonly name: "user";
|
|
3350
|
-
readonly type: "address";
|
|
3351
|
-
}, {
|
|
3352
|
-
readonly indexed: true;
|
|
3353
|
-
readonly internalType: "uint256";
|
|
3354
|
-
readonly name: "granteeId";
|
|
3355
|
-
readonly type: "uint256";
|
|
3356
|
-
}, {
|
|
3357
|
-
readonly indexed: false;
|
|
3358
|
-
readonly internalType: "string";
|
|
3359
|
-
readonly name: "grant";
|
|
3360
|
-
readonly type: "string";
|
|
3361
|
-
}, {
|
|
3362
|
-
readonly indexed: false;
|
|
3363
|
-
readonly internalType: "uint256[]";
|
|
3364
|
-
readonly name: "fileIds";
|
|
3365
|
-
readonly type: "uint256[]";
|
|
3366
|
-
}];
|
|
3367
|
-
readonly name: "PermissionAdded";
|
|
3368
|
-
readonly type: "event";
|
|
3369
|
-
}, {
|
|
3370
|
-
readonly anonymous: false;
|
|
3371
|
-
readonly inputs: readonly [{
|
|
3372
|
-
readonly indexed: true;
|
|
3373
|
-
readonly internalType: "uint256";
|
|
3374
|
-
readonly name: "permissionId";
|
|
3375
|
-
readonly type: "uint256";
|
|
3376
|
-
}];
|
|
3377
|
-
readonly name: "PermissionRevoked";
|
|
3378
|
-
readonly type: "event";
|
|
3379
|
-
}, {
|
|
3380
|
-
readonly anonymous: false;
|
|
3381
|
-
readonly inputs: readonly [{
|
|
3382
|
-
readonly indexed: true;
|
|
3383
|
-
readonly internalType: "bytes32";
|
|
3384
|
-
readonly name: "role";
|
|
3385
|
-
readonly type: "bytes32";
|
|
3386
|
-
}, {
|
|
3387
|
-
readonly indexed: true;
|
|
3388
|
-
readonly internalType: "bytes32";
|
|
3389
|
-
readonly name: "previousAdminRole";
|
|
3390
|
-
readonly type: "bytes32";
|
|
3391
|
-
}, {
|
|
3392
|
-
readonly indexed: true;
|
|
3393
|
-
readonly internalType: "bytes32";
|
|
3394
|
-
readonly name: "newAdminRole";
|
|
3395
|
-
readonly type: "bytes32";
|
|
3396
|
-
}];
|
|
3397
|
-
readonly name: "RoleAdminChanged";
|
|
3398
|
-
readonly type: "event";
|
|
3399
|
-
}, {
|
|
3400
|
-
readonly anonymous: false;
|
|
3401
|
-
readonly inputs: readonly [{
|
|
3402
|
-
readonly indexed: true;
|
|
3403
|
-
readonly internalType: "bytes32";
|
|
3404
|
-
readonly name: "role";
|
|
3405
|
-
readonly type: "bytes32";
|
|
3406
|
-
}, {
|
|
3407
|
-
readonly indexed: true;
|
|
3408
|
-
readonly internalType: "address";
|
|
3409
|
-
readonly name: "account";
|
|
3410
|
-
readonly type: "address";
|
|
3411
|
-
}, {
|
|
3412
|
-
readonly indexed: true;
|
|
3413
|
-
readonly internalType: "address";
|
|
3414
|
-
readonly name: "sender";
|
|
3415
|
-
readonly type: "address";
|
|
3416
|
-
}];
|
|
3417
|
-
readonly name: "RoleGranted";
|
|
3418
|
-
readonly type: "event";
|
|
3419
|
-
}, {
|
|
3420
|
-
readonly anonymous: false;
|
|
3421
|
-
readonly inputs: readonly [{
|
|
3422
|
-
readonly indexed: true;
|
|
3423
|
-
readonly internalType: "bytes32";
|
|
3424
|
-
readonly name: "role";
|
|
3425
|
-
readonly type: "bytes32";
|
|
3426
|
-
}, {
|
|
3427
|
-
readonly indexed: true;
|
|
3428
|
-
readonly internalType: "address";
|
|
3429
|
-
readonly name: "account";
|
|
3430
|
-
readonly type: "address";
|
|
3431
|
-
}, {
|
|
3432
|
-
readonly indexed: true;
|
|
3433
|
-
readonly internalType: "address";
|
|
3434
|
-
readonly name: "sender";
|
|
3435
|
-
readonly type: "address";
|
|
3436
|
-
}];
|
|
3437
|
-
readonly name: "RoleRevoked";
|
|
3438
|
-
readonly type: "event";
|
|
3439
|
-
}, {
|
|
3440
|
-
readonly anonymous: false;
|
|
3441
|
-
readonly inputs: readonly [{
|
|
3442
|
-
readonly indexed: false;
|
|
3443
|
-
readonly internalType: "address";
|
|
3444
|
-
readonly name: "account";
|
|
3445
|
-
readonly type: "address";
|
|
3446
|
-
}];
|
|
3447
|
-
readonly name: "Unpaused";
|
|
3448
|
-
readonly type: "event";
|
|
3449
|
-
}, {
|
|
3450
|
-
readonly anonymous: false;
|
|
3451
|
-
readonly inputs: readonly [{
|
|
3452
|
-
readonly indexed: true;
|
|
3453
|
-
readonly internalType: "address";
|
|
3454
|
-
readonly name: "implementation";
|
|
3455
|
-
readonly type: "address";
|
|
3456
|
-
}];
|
|
3457
|
-
readonly name: "Upgraded";
|
|
3458
|
-
readonly type: "event";
|
|
3459
|
-
}, {
|
|
3460
|
-
readonly inputs: readonly [];
|
|
3461
|
-
readonly name: "DEFAULT_ADMIN_ROLE";
|
|
3462
|
-
readonly outputs: readonly [{
|
|
3463
|
-
readonly internalType: "bytes32";
|
|
3464
|
-
readonly name: "";
|
|
3465
|
-
readonly type: "bytes32";
|
|
3466
|
-
}];
|
|
3467
|
-
readonly stateMutability: "view";
|
|
3468
|
-
readonly type: "function";
|
|
3469
|
-
}, {
|
|
3470
|
-
readonly inputs: readonly [];
|
|
3471
|
-
readonly name: "MAINTAINER_ROLE";
|
|
3472
|
-
readonly outputs: readonly [{
|
|
3473
|
-
readonly internalType: "bytes32";
|
|
3474
|
-
readonly name: "";
|
|
3475
|
-
readonly type: "bytes32";
|
|
3476
|
-
}];
|
|
3477
|
-
readonly stateMutability: "view";
|
|
3478
|
-
readonly type: "function";
|
|
3479
|
-
}, {
|
|
3480
|
-
readonly inputs: readonly [];
|
|
3481
|
-
readonly name: "UPGRADE_INTERFACE_VERSION";
|
|
3482
|
-
readonly outputs: readonly [{
|
|
3483
|
-
readonly internalType: "string";
|
|
3484
|
-
readonly name: "";
|
|
3485
|
-
readonly type: "string";
|
|
3486
|
-
}];
|
|
3487
|
-
readonly stateMutability: "view";
|
|
3488
|
-
readonly type: "function";
|
|
3489
|
-
}, {
|
|
3490
|
-
readonly inputs: readonly [{
|
|
3491
|
-
readonly components: readonly [{
|
|
3492
|
-
readonly internalType: "uint256";
|
|
3493
|
-
readonly name: "nonce";
|
|
3494
|
-
readonly type: "uint256";
|
|
3495
|
-
}, {
|
|
3496
|
-
readonly internalType: "uint256";
|
|
3497
|
-
readonly name: "granteeId";
|
|
3498
|
-
readonly type: "uint256";
|
|
3499
|
-
}, {
|
|
3500
|
-
readonly internalType: "string";
|
|
3501
|
-
readonly name: "grant";
|
|
3502
|
-
readonly type: "string";
|
|
3503
|
-
}, {
|
|
3504
|
-
readonly internalType: "uint256[]";
|
|
3505
|
-
readonly name: "fileIds";
|
|
3506
|
-
readonly type: "uint256[]";
|
|
3507
|
-
}];
|
|
3508
|
-
readonly internalType: "struct IDataPortabilityPermissions.PermissionInput";
|
|
3509
|
-
readonly name: "permissionInput";
|
|
3510
|
-
readonly type: "tuple";
|
|
3511
|
-
}, {
|
|
3512
|
-
readonly internalType: "bytes";
|
|
3513
|
-
readonly name: "signature";
|
|
3514
|
-
readonly type: "bytes";
|
|
3515
|
-
}];
|
|
3516
|
-
readonly name: "addPermission";
|
|
3517
|
-
readonly outputs: readonly [{
|
|
3518
|
-
readonly internalType: "uint256";
|
|
3519
|
-
readonly name: "";
|
|
3520
|
-
readonly type: "uint256";
|
|
3521
|
-
}];
|
|
3522
|
-
readonly stateMutability: "nonpayable";
|
|
3523
|
-
readonly type: "function";
|
|
3524
|
-
}, {
|
|
3525
|
-
readonly inputs: readonly [];
|
|
3526
|
-
readonly name: "dataPortabilityGrantees";
|
|
3527
|
-
readonly outputs: readonly [{
|
|
3528
|
-
readonly internalType: "contract IDataPortabilityGrantees";
|
|
3529
|
-
readonly name: "";
|
|
3530
|
-
readonly type: "address";
|
|
3531
|
-
}];
|
|
3532
|
-
readonly stateMutability: "view";
|
|
3533
|
-
readonly type: "function";
|
|
3534
|
-
}, {
|
|
3535
|
-
readonly inputs: readonly [];
|
|
3536
|
-
readonly name: "dataPortabilityServers";
|
|
3537
|
-
readonly outputs: readonly [{
|
|
3538
|
-
readonly internalType: "contract IDataPortabilityServers";
|
|
3539
|
-
readonly name: "";
|
|
3540
|
-
readonly type: "address";
|
|
3541
|
-
}];
|
|
3542
|
-
readonly stateMutability: "view";
|
|
3543
|
-
readonly type: "function";
|
|
3544
|
-
}, {
|
|
3545
|
-
readonly inputs: readonly [];
|
|
3546
|
-
readonly name: "dataRegistry";
|
|
3547
|
-
readonly outputs: readonly [{
|
|
3548
|
-
readonly internalType: "contract IDataRegistry";
|
|
3549
|
-
readonly name: "";
|
|
3550
|
-
readonly type: "address";
|
|
3551
|
-
}];
|
|
3552
|
-
readonly stateMutability: "view";
|
|
3553
|
-
readonly type: "function";
|
|
3554
|
-
}, {
|
|
3555
|
-
readonly inputs: readonly [];
|
|
3556
|
-
readonly name: "eip712Domain";
|
|
3557
|
-
readonly outputs: readonly [{
|
|
3558
|
-
readonly internalType: "bytes1";
|
|
3559
|
-
readonly name: "fields";
|
|
3560
|
-
readonly type: "bytes1";
|
|
3561
|
-
}, {
|
|
3562
|
-
readonly internalType: "string";
|
|
3563
|
-
readonly name: "name";
|
|
3564
|
-
readonly type: "string";
|
|
3565
|
-
}, {
|
|
3566
|
-
readonly internalType: "string";
|
|
3567
|
-
readonly name: "version";
|
|
3568
|
-
readonly type: "string";
|
|
3569
|
-
}, {
|
|
3570
|
-
readonly internalType: "uint256";
|
|
3571
|
-
readonly name: "chainId";
|
|
3572
|
-
readonly type: "uint256";
|
|
3573
|
-
}, {
|
|
3574
|
-
readonly internalType: "address";
|
|
3575
|
-
readonly name: "verifyingContract";
|
|
3576
|
-
readonly type: "address";
|
|
3577
|
-
}, {
|
|
3578
|
-
readonly internalType: "bytes32";
|
|
3579
|
-
readonly name: "salt";
|
|
3580
|
-
readonly type: "bytes32";
|
|
3581
|
-
}, {
|
|
3582
|
-
readonly internalType: "uint256[]";
|
|
3583
|
-
readonly name: "extensions";
|
|
3584
|
-
readonly type: "uint256[]";
|
|
3585
|
-
}];
|
|
3586
|
-
readonly stateMutability: "view";
|
|
3587
|
-
readonly type: "function";
|
|
3588
|
-
}, {
|
|
3589
|
-
readonly inputs: readonly [{
|
|
3590
|
-
readonly internalType: "uint256";
|
|
3591
|
-
readonly name: "fileId";
|
|
3592
|
-
readonly type: "uint256";
|
|
3593
|
-
}];
|
|
3594
|
-
readonly name: "filePermissionIds";
|
|
3595
|
-
readonly outputs: readonly [{
|
|
3596
|
-
readonly internalType: "uint256[]";
|
|
3597
|
-
readonly name: "";
|
|
3598
|
-
readonly type: "uint256[]";
|
|
3599
|
-
}];
|
|
3600
|
-
readonly stateMutability: "view";
|
|
3601
|
-
readonly type: "function";
|
|
3602
|
-
}, {
|
|
3603
|
-
readonly inputs: readonly [{
|
|
3604
|
-
readonly internalType: "uint256";
|
|
3605
|
-
readonly name: "fileId";
|
|
3606
|
-
readonly type: "uint256";
|
|
3607
|
-
}];
|
|
3608
|
-
readonly name: "filePermissions";
|
|
3609
|
-
readonly outputs: readonly [{
|
|
3610
|
-
readonly internalType: "uint256[]";
|
|
3611
|
-
readonly name: "";
|
|
3612
|
-
readonly type: "uint256[]";
|
|
3613
|
-
}];
|
|
3614
|
-
readonly stateMutability: "view";
|
|
3615
|
-
readonly type: "function";
|
|
3616
|
-
}, {
|
|
3617
|
-
readonly inputs: readonly [{
|
|
3618
|
-
readonly internalType: "bytes32";
|
|
3619
|
-
readonly name: "role";
|
|
3620
|
-
readonly type: "bytes32";
|
|
3621
|
-
}];
|
|
3622
|
-
readonly name: "getRoleAdmin";
|
|
3623
|
-
readonly outputs: readonly [{
|
|
3624
|
-
readonly internalType: "bytes32";
|
|
3625
|
-
readonly name: "";
|
|
3626
|
-
readonly type: "bytes32";
|
|
3627
|
-
}];
|
|
3628
|
-
readonly stateMutability: "view";
|
|
3629
|
-
readonly type: "function";
|
|
3630
|
-
}, {
|
|
3631
|
-
readonly inputs: readonly [{
|
|
3632
|
-
readonly internalType: "bytes32";
|
|
3633
|
-
readonly name: "role";
|
|
3634
|
-
readonly type: "bytes32";
|
|
3635
|
-
}, {
|
|
3636
|
-
readonly internalType: "address";
|
|
3637
|
-
readonly name: "account";
|
|
3638
|
-
readonly type: "address";
|
|
3639
|
-
}];
|
|
3640
|
-
readonly name: "grantRole";
|
|
3641
|
-
readonly outputs: readonly [];
|
|
3642
|
-
readonly stateMutability: "nonpayable";
|
|
3643
|
-
readonly type: "function";
|
|
3644
|
-
}, {
|
|
3645
|
-
readonly inputs: readonly [{
|
|
3646
|
-
readonly internalType: "bytes32";
|
|
3647
|
-
readonly name: "role";
|
|
3648
|
-
readonly type: "bytes32";
|
|
3649
|
-
}, {
|
|
3650
|
-
readonly internalType: "address";
|
|
3651
|
-
readonly name: "account";
|
|
3652
|
-
readonly type: "address";
|
|
3653
|
-
}];
|
|
3654
|
-
readonly name: "hasRole";
|
|
3655
|
-
readonly outputs: readonly [{
|
|
3656
|
-
readonly internalType: "bool";
|
|
3657
|
-
readonly name: "";
|
|
3658
|
-
readonly type: "bool";
|
|
3659
|
-
}];
|
|
3660
|
-
readonly stateMutability: "view";
|
|
3661
|
-
readonly type: "function";
|
|
3662
|
-
}, {
|
|
3663
|
-
readonly inputs: readonly [{
|
|
3664
|
-
readonly internalType: "address";
|
|
3665
|
-
readonly name: "trustedForwarderAddress";
|
|
3666
|
-
readonly type: "address";
|
|
3667
|
-
}, {
|
|
3668
|
-
readonly internalType: "address";
|
|
3669
|
-
readonly name: "ownerAddress";
|
|
3670
|
-
readonly type: "address";
|
|
3671
|
-
}, {
|
|
3672
|
-
readonly internalType: "contract IDataRegistry";
|
|
3673
|
-
readonly name: "dataRegistryAddress";
|
|
3674
|
-
readonly type: "address";
|
|
3675
|
-
}, {
|
|
3676
|
-
readonly internalType: "contract IDataPortabilityServers";
|
|
3677
|
-
readonly name: "serversContractAddr";
|
|
3678
|
-
readonly type: "address";
|
|
3679
|
-
}, {
|
|
3680
|
-
readonly internalType: "contract IDataPortabilityGrantees";
|
|
3681
|
-
readonly name: "granteesContractAddr";
|
|
3682
|
-
readonly type: "address";
|
|
3683
|
-
}];
|
|
3684
|
-
readonly name: "initialize";
|
|
3685
|
-
readonly outputs: readonly [];
|
|
3686
|
-
readonly stateMutability: "nonpayable";
|
|
3687
|
-
readonly type: "function";
|
|
3688
|
-
}, {
|
|
3689
|
-
readonly inputs: readonly [{
|
|
3690
|
-
readonly internalType: "uint256";
|
|
3691
|
-
readonly name: "permissionId";
|
|
3692
|
-
readonly type: "uint256";
|
|
3693
|
-
}];
|
|
3694
|
-
readonly name: "isActivePermission";
|
|
3695
|
-
readonly outputs: readonly [{
|
|
3696
|
-
readonly internalType: "bool";
|
|
3697
|
-
readonly name: "";
|
|
3698
|
-
readonly type: "bool";
|
|
3699
|
-
}];
|
|
3700
|
-
readonly stateMutability: "view";
|
|
3701
|
-
readonly type: "function";
|
|
3702
|
-
}, {
|
|
3703
|
-
readonly inputs: readonly [{
|
|
3704
|
-
readonly internalType: "address";
|
|
3705
|
-
readonly name: "forwarder";
|
|
3706
|
-
readonly type: "address";
|
|
3707
|
-
}];
|
|
3708
|
-
readonly name: "isTrustedForwarder";
|
|
3709
|
-
readonly outputs: readonly [{
|
|
3710
|
-
readonly internalType: "bool";
|
|
3711
|
-
readonly name: "";
|
|
3712
|
-
readonly type: "bool";
|
|
3713
|
-
}];
|
|
3714
|
-
readonly stateMutability: "view";
|
|
3715
|
-
readonly type: "function";
|
|
3716
|
-
}, {
|
|
3717
|
-
readonly inputs: readonly [{
|
|
3718
|
-
readonly internalType: "bytes[]";
|
|
3719
|
-
readonly name: "data";
|
|
3720
|
-
readonly type: "bytes[]";
|
|
3721
|
-
}];
|
|
3722
|
-
readonly name: "multicall";
|
|
3723
|
-
readonly outputs: readonly [{
|
|
3724
|
-
readonly internalType: "bytes[]";
|
|
3725
|
-
readonly name: "results";
|
|
3726
|
-
readonly type: "bytes[]";
|
|
3727
|
-
}];
|
|
3728
|
-
readonly stateMutability: "nonpayable";
|
|
3729
|
-
readonly type: "function";
|
|
3730
|
-
}, {
|
|
3731
|
-
readonly inputs: readonly [];
|
|
3732
|
-
readonly name: "pause";
|
|
3733
|
-
readonly outputs: readonly [];
|
|
3734
|
-
readonly stateMutability: "nonpayable";
|
|
3735
|
-
readonly type: "function";
|
|
3736
|
-
}, {
|
|
3737
|
-
readonly inputs: readonly [];
|
|
3738
|
-
readonly name: "paused";
|
|
3739
|
-
readonly outputs: readonly [{
|
|
3740
|
-
readonly internalType: "bool";
|
|
3741
|
-
readonly name: "";
|
|
3742
|
-
readonly type: "bool";
|
|
3743
|
-
}];
|
|
3744
|
-
readonly stateMutability: "view";
|
|
3745
|
-
readonly type: "function";
|
|
3746
|
-
}, {
|
|
3747
|
-
readonly inputs: readonly [{
|
|
3748
|
-
readonly internalType: "uint256";
|
|
3749
|
-
readonly name: "permissionId";
|
|
3750
|
-
readonly type: "uint256";
|
|
3751
|
-
}];
|
|
3752
|
-
readonly name: "permissionFileIds";
|
|
3753
|
-
readonly outputs: readonly [{
|
|
3754
|
-
readonly internalType: "uint256[]";
|
|
3755
|
-
readonly name: "";
|
|
3756
|
-
readonly type: "uint256[]";
|
|
3757
|
-
}];
|
|
3758
|
-
readonly stateMutability: "view";
|
|
3759
|
-
readonly type: "function";
|
|
3760
|
-
}, {
|
|
3761
|
-
readonly inputs: readonly [{
|
|
3762
|
-
readonly internalType: "uint256";
|
|
3763
|
-
readonly name: "permissionId";
|
|
3764
|
-
readonly type: "uint256";
|
|
3765
|
-
}];
|
|
3766
|
-
readonly name: "permissions";
|
|
3767
|
-
readonly outputs: readonly [{
|
|
3768
|
-
readonly components: readonly [{
|
|
3769
|
-
readonly internalType: "uint256";
|
|
3770
|
-
readonly name: "id";
|
|
3771
|
-
readonly type: "uint256";
|
|
3772
|
-
}, {
|
|
3773
|
-
readonly internalType: "address";
|
|
3774
|
-
readonly name: "grantor";
|
|
3775
|
-
readonly type: "address";
|
|
3776
|
-
}, {
|
|
3777
|
-
readonly internalType: "uint256";
|
|
3778
|
-
readonly name: "nonce";
|
|
3779
|
-
readonly type: "uint256";
|
|
3780
|
-
}, {
|
|
3781
|
-
readonly internalType: "uint256";
|
|
3782
|
-
readonly name: "granteeId";
|
|
3783
|
-
readonly type: "uint256";
|
|
3784
|
-
}, {
|
|
3785
|
-
readonly internalType: "string";
|
|
3786
|
-
readonly name: "grant";
|
|
3787
|
-
readonly type: "string";
|
|
3788
|
-
}, {
|
|
3789
|
-
readonly internalType: "bytes";
|
|
3790
|
-
readonly name: "signature";
|
|
3791
|
-
readonly type: "bytes";
|
|
3792
|
-
}, {
|
|
3793
|
-
readonly internalType: "uint256";
|
|
3794
|
-
readonly name: "startBlock";
|
|
3795
|
-
readonly type: "uint256";
|
|
3796
|
-
}, {
|
|
3797
|
-
readonly internalType: "uint256";
|
|
3798
|
-
readonly name: "endBlock";
|
|
3799
|
-
readonly type: "uint256";
|
|
3800
|
-
}, {
|
|
3801
|
-
readonly internalType: "uint256[]";
|
|
3802
|
-
readonly name: "fileIds";
|
|
3803
|
-
readonly type: "uint256[]";
|
|
3804
|
-
}];
|
|
3805
|
-
readonly internalType: "struct IDataPortabilityPermissions.PermissionInfo";
|
|
3806
|
-
readonly name: "";
|
|
3807
|
-
readonly type: "tuple";
|
|
3808
|
-
}];
|
|
3809
|
-
readonly stateMutability: "view";
|
|
3810
|
-
readonly type: "function";
|
|
3811
|
-
}, {
|
|
3812
|
-
readonly inputs: readonly [];
|
|
3813
|
-
readonly name: "permissionsCount";
|
|
3814
|
-
readonly outputs: readonly [{
|
|
3815
|
-
readonly internalType: "uint256";
|
|
3816
|
-
readonly name: "";
|
|
3817
|
-
readonly type: "uint256";
|
|
3818
|
-
}];
|
|
3819
|
-
readonly stateMutability: "view";
|
|
3820
|
-
readonly type: "function";
|
|
3821
|
-
}, {
|
|
3822
|
-
readonly inputs: readonly [];
|
|
3823
|
-
readonly name: "proxiableUUID";
|
|
3824
|
-
readonly outputs: readonly [{
|
|
3825
|
-
readonly internalType: "bytes32";
|
|
3826
|
-
readonly name: "";
|
|
3827
|
-
readonly type: "bytes32";
|
|
3828
|
-
}];
|
|
3829
|
-
readonly stateMutability: "view";
|
|
3830
|
-
readonly type: "function";
|
|
3831
|
-
}, {
|
|
3832
|
-
readonly inputs: readonly [{
|
|
3833
|
-
readonly internalType: "bytes32";
|
|
3834
|
-
readonly name: "role";
|
|
3835
|
-
readonly type: "bytes32";
|
|
3836
|
-
}, {
|
|
3837
|
-
readonly internalType: "address";
|
|
3838
|
-
readonly name: "callerConfirmation";
|
|
3839
|
-
readonly type: "address";
|
|
3840
|
-
}];
|
|
3841
|
-
readonly name: "renounceRole";
|
|
3842
|
-
readonly outputs: readonly [];
|
|
3843
|
-
readonly stateMutability: "nonpayable";
|
|
3844
|
-
readonly type: "function";
|
|
3845
|
-
}, {
|
|
3846
|
-
readonly inputs: readonly [{
|
|
3847
|
-
readonly internalType: "uint256";
|
|
3848
|
-
readonly name: "permissionId";
|
|
3849
|
-
readonly type: "uint256";
|
|
3850
|
-
}];
|
|
3851
|
-
readonly name: "revokePermission";
|
|
3852
|
-
readonly outputs: readonly [];
|
|
3853
|
-
readonly stateMutability: "nonpayable";
|
|
3854
|
-
readonly type: "function";
|
|
3855
|
-
}, {
|
|
3856
|
-
readonly inputs: readonly [{
|
|
3857
|
-
readonly components: readonly [{
|
|
3858
|
-
readonly internalType: "uint256";
|
|
3859
|
-
readonly name: "nonce";
|
|
3860
|
-
readonly type: "uint256";
|
|
3861
|
-
}, {
|
|
3862
|
-
readonly internalType: "uint256";
|
|
3863
|
-
readonly name: "permissionId";
|
|
3864
|
-
readonly type: "uint256";
|
|
3865
|
-
}];
|
|
3866
|
-
readonly internalType: "struct IDataPortabilityPermissions.RevokePermissionInput";
|
|
3867
|
-
readonly name: "revokePermissionInput";
|
|
3868
|
-
readonly type: "tuple";
|
|
3869
|
-
}, {
|
|
3870
|
-
readonly internalType: "bytes";
|
|
3871
|
-
readonly name: "signature";
|
|
3872
|
-
readonly type: "bytes";
|
|
3873
|
-
}];
|
|
3874
|
-
readonly name: "revokePermissionWithSignature";
|
|
3875
|
-
readonly outputs: readonly [];
|
|
3876
|
-
readonly stateMutability: "nonpayable";
|
|
3877
|
-
readonly type: "function";
|
|
3878
|
-
}, {
|
|
3879
|
-
readonly inputs: readonly [{
|
|
3880
|
-
readonly internalType: "bytes32";
|
|
3881
|
-
readonly name: "role";
|
|
3882
|
-
readonly type: "bytes32";
|
|
3883
|
-
}, {
|
|
3884
|
-
readonly internalType: "address";
|
|
3885
|
-
readonly name: "account";
|
|
3886
|
-
readonly type: "address";
|
|
3887
|
-
}];
|
|
3888
|
-
readonly name: "revokeRole";
|
|
3889
|
-
readonly outputs: readonly [];
|
|
3890
|
-
readonly stateMutability: "nonpayable";
|
|
3891
|
-
readonly type: "function";
|
|
3892
|
-
}, {
|
|
3893
|
-
readonly inputs: readonly [{
|
|
3894
|
-
readonly internalType: "bytes32";
|
|
3895
|
-
readonly name: "role";
|
|
3896
|
-
readonly type: "bytes32";
|
|
3897
|
-
}, {
|
|
3898
|
-
readonly internalType: "bytes32";
|
|
3899
|
-
readonly name: "adminRole";
|
|
3900
|
-
readonly type: "bytes32";
|
|
3901
|
-
}];
|
|
3902
|
-
readonly name: "setRoleAdmin";
|
|
3903
|
-
readonly outputs: readonly [];
|
|
3904
|
-
readonly stateMutability: "nonpayable";
|
|
3905
|
-
readonly type: "function";
|
|
3906
|
-
}, {
|
|
3907
|
-
readonly inputs: readonly [{
|
|
3908
|
-
readonly internalType: "bytes4";
|
|
3909
|
-
readonly name: "interfaceId";
|
|
3910
|
-
readonly type: "bytes4";
|
|
3911
|
-
}];
|
|
3912
|
-
readonly name: "supportsInterface";
|
|
3913
|
-
readonly outputs: readonly [{
|
|
3914
|
-
readonly internalType: "bool";
|
|
3915
|
-
readonly name: "";
|
|
3916
|
-
readonly type: "bool";
|
|
3917
|
-
}];
|
|
3918
|
-
readonly stateMutability: "view";
|
|
3919
|
-
readonly type: "function";
|
|
3920
|
-
}, {
|
|
3921
|
-
readonly inputs: readonly [];
|
|
3922
|
-
readonly name: "trustedForwarder";
|
|
3923
|
-
readonly outputs: readonly [{
|
|
3924
|
-
readonly internalType: "address";
|
|
3925
|
-
readonly name: "";
|
|
3926
|
-
readonly type: "address";
|
|
3927
|
-
}];
|
|
3928
|
-
readonly stateMutability: "view";
|
|
3929
|
-
readonly type: "function";
|
|
3930
|
-
}, {
|
|
3931
|
-
readonly inputs: readonly [];
|
|
3932
|
-
readonly name: "unpause";
|
|
3933
|
-
readonly outputs: readonly [];
|
|
3934
|
-
readonly stateMutability: "nonpayable";
|
|
3935
|
-
readonly type: "function";
|
|
3936
|
-
}, {
|
|
3937
|
-
readonly inputs: readonly [{
|
|
3938
|
-
readonly internalType: "contract IDataRegistry";
|
|
3939
|
-
readonly name: "newDataRegistry";
|
|
3940
|
-
readonly type: "address";
|
|
3941
|
-
}];
|
|
3942
|
-
readonly name: "updateDataRegistry";
|
|
3943
|
-
readonly outputs: readonly [];
|
|
3944
|
-
readonly stateMutability: "nonpayable";
|
|
3945
|
-
readonly type: "function";
|
|
3946
|
-
}, {
|
|
3947
|
-
readonly inputs: readonly [{
|
|
3948
|
-
readonly internalType: "contract IDataPortabilityGrantees";
|
|
3949
|
-
readonly name: "newGranteesContract";
|
|
3950
|
-
readonly type: "address";
|
|
3951
|
-
}];
|
|
3952
|
-
readonly name: "updateGranteesContract";
|
|
3953
|
-
readonly outputs: readonly [];
|
|
3954
|
-
readonly stateMutability: "nonpayable";
|
|
3955
|
-
readonly type: "function";
|
|
3956
|
-
}, {
|
|
3957
|
-
readonly inputs: readonly [{
|
|
3958
|
-
readonly internalType: "contract IDataPortabilityServers";
|
|
3959
|
-
readonly name: "newServersContract";
|
|
3960
|
-
readonly type: "address";
|
|
3961
|
-
}];
|
|
3962
|
-
readonly name: "updateServersContract";
|
|
3963
|
-
readonly outputs: readonly [];
|
|
3964
|
-
readonly stateMutability: "nonpayable";
|
|
3965
|
-
readonly type: "function";
|
|
3966
|
-
}, {
|
|
3967
|
-
readonly inputs: readonly [{
|
|
3968
|
-
readonly internalType: "address";
|
|
3969
|
-
readonly name: "trustedForwarderAddress";
|
|
3970
|
-
readonly type: "address";
|
|
3971
|
-
}];
|
|
3972
|
-
readonly name: "updateTrustedForwarder";
|
|
3973
|
-
readonly outputs: readonly [];
|
|
3974
|
-
readonly stateMutability: "nonpayable";
|
|
3975
|
-
readonly type: "function";
|
|
3976
|
-
}, {
|
|
3977
|
-
readonly inputs: readonly [{
|
|
3978
|
-
readonly internalType: "address";
|
|
3979
|
-
readonly name: "newImplementation";
|
|
3980
|
-
readonly type: "address";
|
|
3981
|
-
}, {
|
|
3982
|
-
readonly internalType: "bytes";
|
|
3983
|
-
readonly name: "data";
|
|
3984
|
-
readonly type: "bytes";
|
|
3985
|
-
}];
|
|
3986
|
-
readonly name: "upgradeToAndCall";
|
|
3987
|
-
readonly outputs: readonly [];
|
|
3988
|
-
readonly stateMutability: "payable";
|
|
3989
|
-
readonly type: "function";
|
|
3990
|
-
}, {
|
|
3991
|
-
readonly inputs: readonly [{
|
|
3992
|
-
readonly internalType: "address";
|
|
3993
|
-
readonly name: "userAddress";
|
|
3994
|
-
readonly type: "address";
|
|
3995
|
-
}];
|
|
3996
|
-
readonly name: "userNonce";
|
|
3997
|
-
readonly outputs: readonly [{
|
|
3998
|
-
readonly internalType: "uint256";
|
|
3999
|
-
readonly name: "";
|
|
4000
|
-
readonly type: "uint256";
|
|
4001
|
-
}];
|
|
4002
|
-
readonly stateMutability: "view";
|
|
4003
|
-
readonly type: "function";
|
|
4004
|
-
}, {
|
|
4005
|
-
readonly inputs: readonly [{
|
|
4006
|
-
readonly internalType: "address";
|
|
4007
|
-
readonly name: "userAddress";
|
|
4008
|
-
readonly type: "address";
|
|
4009
|
-
}, {
|
|
4010
|
-
readonly internalType: "uint256";
|
|
4011
|
-
readonly name: "permissionIndex";
|
|
4012
|
-
readonly type: "uint256";
|
|
4013
|
-
}];
|
|
4014
|
-
readonly name: "userPermissionIdsAt";
|
|
4015
|
-
readonly outputs: readonly [{
|
|
4016
|
-
readonly internalType: "uint256";
|
|
4017
|
-
readonly name: "";
|
|
4018
|
-
readonly type: "uint256";
|
|
4019
|
-
}];
|
|
4020
|
-
readonly stateMutability: "view";
|
|
4021
|
-
readonly type: "function";
|
|
4022
|
-
}, {
|
|
4023
|
-
readonly inputs: readonly [{
|
|
4024
|
-
readonly internalType: "address";
|
|
4025
|
-
readonly name: "userAddress";
|
|
4026
|
-
readonly type: "address";
|
|
4027
|
-
}];
|
|
4028
|
-
readonly name: "userPermissionIdsLength";
|
|
4029
|
-
readonly outputs: readonly [{
|
|
4030
|
-
readonly internalType: "uint256";
|
|
4031
|
-
readonly name: "";
|
|
4032
|
-
readonly type: "uint256";
|
|
4033
|
-
}];
|
|
4034
|
-
readonly stateMutability: "view";
|
|
4035
|
-
readonly type: "function";
|
|
4036
|
-
}, {
|
|
4037
|
-
readonly inputs: readonly [{
|
|
4038
|
-
readonly internalType: "address";
|
|
4039
|
-
readonly name: "userAddress";
|
|
4040
|
-
readonly type: "address";
|
|
4041
|
-
}];
|
|
4042
|
-
readonly name: "userPermissionIdsValues";
|
|
4043
|
-
readonly outputs: readonly [{
|
|
4044
|
-
readonly internalType: "uint256[]";
|
|
4045
|
-
readonly name: "";
|
|
4046
|
-
readonly type: "uint256[]";
|
|
4047
|
-
}];
|
|
4048
|
-
readonly stateMutability: "view";
|
|
4049
|
-
readonly type: "function";
|
|
4050
|
-
}, {
|
|
4051
|
-
readonly inputs: readonly [{
|
|
4052
|
-
readonly internalType: "address";
|
|
4053
|
-
readonly name: "userAddress";
|
|
4054
|
-
readonly type: "address";
|
|
4055
|
-
}];
|
|
4056
|
-
readonly name: "users";
|
|
4057
|
-
readonly outputs: readonly [{
|
|
4058
|
-
readonly internalType: "uint256";
|
|
4059
|
-
readonly name: "nonce";
|
|
4060
|
-
readonly type: "uint256";
|
|
4061
|
-
}, {
|
|
4062
|
-
readonly internalType: "uint256[]";
|
|
4063
|
-
readonly name: "permissionIds";
|
|
4064
|
-
readonly type: "uint256[]";
|
|
4065
|
-
}];
|
|
4066
|
-
readonly stateMutability: "view";
|
|
4067
|
-
readonly type: "function";
|
|
4068
|
-
}, {
|
|
4069
|
-
readonly inputs: readonly [];
|
|
4070
|
-
readonly name: "version";
|
|
4071
|
-
readonly outputs: readonly [{
|
|
4072
|
-
readonly internalType: "uint256";
|
|
4073
|
-
readonly name: "";
|
|
4074
|
-
readonly type: "uint256";
|
|
4075
|
-
}];
|
|
4076
|
-
readonly stateMutability: "pure";
|
|
4077
|
-
readonly type: "function";
|
|
4078
|
-
}];
|
|
4079
|
-
readonly DataPortabilityServers: readonly [{
|
|
4080
|
-
readonly inputs: readonly [];
|
|
4081
|
-
readonly stateMutability: "nonpayable";
|
|
4082
|
-
readonly type: "constructor";
|
|
4083
|
-
}, {
|
|
4084
|
-
readonly inputs: readonly [];
|
|
4085
|
-
readonly name: "AccessControlBadConfirmation";
|
|
4086
|
-
readonly type: "error";
|
|
4087
|
-
}, {
|
|
4088
|
-
readonly inputs: readonly [{
|
|
4089
|
-
readonly internalType: "address";
|
|
4090
|
-
readonly name: "account";
|
|
4091
|
-
readonly type: "address";
|
|
4092
|
-
}, {
|
|
4093
|
-
readonly internalType: "bytes32";
|
|
4094
|
-
readonly name: "neededRole";
|
|
4095
|
-
readonly type: "bytes32";
|
|
4096
|
-
}];
|
|
4097
|
-
readonly name: "AccessControlUnauthorizedAccount";
|
|
4098
|
-
readonly type: "error";
|
|
4099
|
-
}, {
|
|
4100
|
-
readonly inputs: readonly [{
|
|
4101
|
-
readonly internalType: "address";
|
|
4102
|
-
readonly name: "target";
|
|
4103
|
-
readonly type: "address";
|
|
4104
|
-
}];
|
|
4105
|
-
readonly name: "AddressEmptyCode";
|
|
4106
|
-
readonly type: "error";
|
|
4107
|
-
}, {
|
|
4108
|
-
readonly inputs: readonly [];
|
|
4109
|
-
readonly name: "ECDSAInvalidSignature";
|
|
4110
|
-
readonly type: "error";
|
|
4111
|
-
}, {
|
|
4112
|
-
readonly inputs: readonly [{
|
|
4113
|
-
readonly internalType: "uint256";
|
|
4114
|
-
readonly name: "length";
|
|
4115
|
-
readonly type: "uint256";
|
|
4116
|
-
}];
|
|
4117
|
-
readonly name: "ECDSAInvalidSignatureLength";
|
|
4118
|
-
readonly type: "error";
|
|
4119
|
-
}, {
|
|
4120
|
-
readonly inputs: readonly [{
|
|
4121
|
-
readonly internalType: "bytes32";
|
|
4122
|
-
readonly name: "s";
|
|
4123
|
-
readonly type: "bytes32";
|
|
4124
|
-
}];
|
|
4125
|
-
readonly name: "ECDSAInvalidSignatureS";
|
|
4126
|
-
readonly type: "error";
|
|
4127
|
-
}, {
|
|
4128
|
-
readonly inputs: readonly [{
|
|
4129
|
-
readonly internalType: "address";
|
|
4130
|
-
readonly name: "implementation";
|
|
4131
|
-
readonly type: "address";
|
|
4132
|
-
}];
|
|
4133
|
-
readonly name: "ERC1967InvalidImplementation";
|
|
4134
|
-
readonly type: "error";
|
|
4135
|
-
}, {
|
|
4136
|
-
readonly inputs: readonly [];
|
|
4137
|
-
readonly name: "ERC1967NonPayable";
|
|
4138
|
-
readonly type: "error";
|
|
4139
|
-
}, {
|
|
4140
|
-
readonly inputs: readonly [];
|
|
4141
|
-
readonly name: "EmptyPublicKey";
|
|
4142
|
-
readonly type: "error";
|
|
4143
|
-
}, {
|
|
4144
|
-
readonly inputs: readonly [];
|
|
4145
|
-
readonly name: "EmptyUrl";
|
|
4146
|
-
readonly type: "error";
|
|
4147
|
-
}, {
|
|
4148
|
-
readonly inputs: readonly [];
|
|
4149
|
-
readonly name: "EnforcedPause";
|
|
4150
|
-
readonly type: "error";
|
|
4151
|
-
}, {
|
|
4152
|
-
readonly inputs: readonly [];
|
|
4153
|
-
readonly name: "ExpectedPause";
|
|
4154
|
-
readonly type: "error";
|
|
4155
|
-
}, {
|
|
4156
|
-
readonly inputs: readonly [];
|
|
4157
|
-
readonly name: "FailedInnerCall";
|
|
4158
|
-
readonly type: "error";
|
|
4159
|
-
}, {
|
|
4160
|
-
readonly inputs: readonly [];
|
|
4161
|
-
readonly name: "InvalidInitialization";
|
|
4162
|
-
readonly type: "error";
|
|
4163
|
-
}, {
|
|
4164
|
-
readonly inputs: readonly [{
|
|
4165
|
-
readonly internalType: "uint256";
|
|
4166
|
-
readonly name: "expectedNonce";
|
|
4167
|
-
readonly type: "uint256";
|
|
4168
|
-
}, {
|
|
4169
|
-
readonly internalType: "uint256";
|
|
4170
|
-
readonly name: "providedNonce";
|
|
4171
|
-
readonly type: "uint256";
|
|
4172
|
-
}];
|
|
4173
|
-
readonly name: "InvalidNonce";
|
|
4174
|
-
readonly type: "error";
|
|
4175
|
-
}, {
|
|
4176
|
-
readonly inputs: readonly [];
|
|
4177
|
-
readonly name: "NotInitializing";
|
|
4178
|
-
readonly type: "error";
|
|
4179
|
-
}, {
|
|
4180
|
-
readonly inputs: readonly [{
|
|
4181
|
-
readonly internalType: "address";
|
|
4182
|
-
readonly name: "serverOwner";
|
|
4183
|
-
readonly type: "address";
|
|
4184
|
-
}, {
|
|
4185
|
-
readonly internalType: "address";
|
|
4186
|
-
readonly name: "requestor";
|
|
4187
|
-
readonly type: "address";
|
|
4188
|
-
}];
|
|
4189
|
-
readonly name: "NotServerOwner";
|
|
4190
|
-
readonly type: "error";
|
|
4191
|
-
}, {
|
|
4192
|
-
readonly inputs: readonly [];
|
|
4193
|
-
readonly name: "ServerAlreadyRegistered";
|
|
4194
|
-
readonly type: "error";
|
|
4195
|
-
}, {
|
|
4196
|
-
readonly inputs: readonly [];
|
|
4197
|
-
readonly name: "ServerAlreadyTrusted";
|
|
4198
|
-
readonly type: "error";
|
|
4199
|
-
}, {
|
|
4200
|
-
readonly inputs: readonly [];
|
|
4201
|
-
readonly name: "ServerAlreadyUntrusted";
|
|
4202
|
-
readonly type: "error";
|
|
4203
|
-
}, {
|
|
4204
|
-
readonly inputs: readonly [];
|
|
4205
|
-
readonly name: "ServerNotFound";
|
|
4206
|
-
readonly type: "error";
|
|
4207
|
-
}, {
|
|
4208
|
-
readonly inputs: readonly [];
|
|
4209
|
-
readonly name: "ServerNotTrusted";
|
|
4210
|
-
readonly type: "error";
|
|
4211
|
-
}, {
|
|
4212
|
-
readonly inputs: readonly [{
|
|
4213
|
-
readonly internalType: "string";
|
|
4214
|
-
readonly name: "existingUrl";
|
|
4215
|
-
readonly type: "string";
|
|
4216
|
-
}, {
|
|
4217
|
-
readonly internalType: "string";
|
|
4218
|
-
readonly name: "providedUrl";
|
|
4219
|
-
readonly type: "string";
|
|
4220
|
-
}];
|
|
4221
|
-
readonly name: "ServerUrlMismatch";
|
|
3512
|
+
readonly name: "ServerUrlMismatch";
|
|
4222
3513
|
readonly type: "error";
|
|
4223
3514
|
}, {
|
|
4224
3515
|
readonly inputs: readonly [];
|
|
@@ -4340,9 +3631,9 @@ declare const contractAbis: {
|
|
|
4340
3631
|
readonly type: "address";
|
|
4341
3632
|
}, {
|
|
4342
3633
|
readonly indexed: false;
|
|
4343
|
-
readonly internalType: "
|
|
3634
|
+
readonly internalType: "string";
|
|
4344
3635
|
readonly name: "publicKey";
|
|
4345
|
-
readonly type: "
|
|
3636
|
+
readonly type: "string";
|
|
4346
3637
|
}, {
|
|
4347
3638
|
readonly indexed: false;
|
|
4348
3639
|
readonly internalType: "string";
|
|
@@ -4436,6 +3727,16 @@ declare const contractAbis: {
|
|
|
4436
3727
|
}];
|
|
4437
3728
|
readonly stateMutability: "view";
|
|
4438
3729
|
readonly type: "function";
|
|
3730
|
+
}, {
|
|
3731
|
+
readonly inputs: readonly [];
|
|
3732
|
+
readonly name: "PERMISSION_MANAGER_ROLE";
|
|
3733
|
+
readonly outputs: readonly [{
|
|
3734
|
+
readonly internalType: "bytes32";
|
|
3735
|
+
readonly name: "";
|
|
3736
|
+
readonly type: "bytes32";
|
|
3737
|
+
}];
|
|
3738
|
+
readonly stateMutability: "view";
|
|
3739
|
+
readonly type: "function";
|
|
4439
3740
|
}, {
|
|
4440
3741
|
readonly inputs: readonly [];
|
|
4441
3742
|
readonly name: "UPGRADE_INTERFACE_VERSION";
|
|
@@ -4448,28 +3749,28 @@ declare const contractAbis: {
|
|
|
4448
3749
|
readonly type: "function";
|
|
4449
3750
|
}, {
|
|
4450
3751
|
readonly inputs: readonly [{
|
|
3752
|
+
readonly internalType: "address";
|
|
3753
|
+
readonly name: "ownerAddress";
|
|
3754
|
+
readonly type: "address";
|
|
3755
|
+
}, {
|
|
4451
3756
|
readonly components: readonly [{
|
|
4452
|
-
readonly internalType: "address";
|
|
4453
|
-
readonly name: "owner";
|
|
4454
|
-
readonly type: "address";
|
|
4455
|
-
}, {
|
|
4456
3757
|
readonly internalType: "address";
|
|
4457
3758
|
readonly name: "serverAddress";
|
|
4458
3759
|
readonly type: "address";
|
|
4459
3760
|
}, {
|
|
4460
|
-
readonly internalType: "
|
|
3761
|
+
readonly internalType: "string";
|
|
4461
3762
|
readonly name: "publicKey";
|
|
4462
|
-
readonly type: "
|
|
3763
|
+
readonly type: "string";
|
|
4463
3764
|
}, {
|
|
4464
3765
|
readonly internalType: "string";
|
|
4465
3766
|
readonly name: "serverUrl";
|
|
4466
3767
|
readonly type: "string";
|
|
4467
3768
|
}];
|
|
4468
3769
|
readonly internalType: "struct IDataPortabilityServers.AddServerInput";
|
|
4469
|
-
readonly name: "
|
|
3770
|
+
readonly name: "addServerInput";
|
|
4470
3771
|
readonly type: "tuple";
|
|
4471
3772
|
}];
|
|
4472
|
-
readonly name: "
|
|
3773
|
+
readonly name: "addAndTrustServerByManager";
|
|
4473
3774
|
readonly outputs: readonly [];
|
|
4474
3775
|
readonly stateMutability: "nonpayable";
|
|
4475
3776
|
readonly type: "function";
|
|
@@ -4479,25 +3780,21 @@ declare const contractAbis: {
|
|
|
4479
3780
|
readonly internalType: "uint256";
|
|
4480
3781
|
readonly name: "nonce";
|
|
4481
3782
|
readonly type: "uint256";
|
|
4482
|
-
}, {
|
|
4483
|
-
readonly internalType: "address";
|
|
4484
|
-
readonly name: "owner";
|
|
4485
|
-
readonly type: "address";
|
|
4486
3783
|
}, {
|
|
4487
3784
|
readonly internalType: "address";
|
|
4488
3785
|
readonly name: "serverAddress";
|
|
4489
3786
|
readonly type: "address";
|
|
4490
3787
|
}, {
|
|
4491
|
-
readonly internalType: "
|
|
3788
|
+
readonly internalType: "string";
|
|
4492
3789
|
readonly name: "publicKey";
|
|
4493
|
-
readonly type: "
|
|
3790
|
+
readonly type: "string";
|
|
4494
3791
|
}, {
|
|
4495
3792
|
readonly internalType: "string";
|
|
4496
3793
|
readonly name: "serverUrl";
|
|
4497
3794
|
readonly type: "string";
|
|
4498
3795
|
}];
|
|
4499
|
-
readonly internalType: "struct IDataPortabilityServers.
|
|
4500
|
-
readonly name: "
|
|
3796
|
+
readonly internalType: "struct IDataPortabilityServers.AddServerWithSignatureInput";
|
|
3797
|
+
readonly name: "addServerInput";
|
|
4501
3798
|
readonly type: "tuple";
|
|
4502
3799
|
}, {
|
|
4503
3800
|
readonly internalType: "bytes";
|
|
@@ -4511,27 +3808,31 @@ declare const contractAbis: {
|
|
|
4511
3808
|
}, {
|
|
4512
3809
|
readonly inputs: readonly [{
|
|
4513
3810
|
readonly components: readonly [{
|
|
4514
|
-
readonly internalType: "
|
|
4515
|
-
readonly name: "
|
|
4516
|
-
readonly type: "
|
|
3811
|
+
readonly internalType: "uint256";
|
|
3812
|
+
readonly name: "nonce";
|
|
3813
|
+
readonly type: "uint256";
|
|
4517
3814
|
}, {
|
|
4518
3815
|
readonly internalType: "address";
|
|
4519
3816
|
readonly name: "serverAddress";
|
|
4520
3817
|
readonly type: "address";
|
|
4521
3818
|
}, {
|
|
4522
|
-
readonly internalType: "
|
|
3819
|
+
readonly internalType: "string";
|
|
4523
3820
|
readonly name: "publicKey";
|
|
4524
|
-
readonly type: "
|
|
3821
|
+
readonly type: "string";
|
|
4525
3822
|
}, {
|
|
4526
3823
|
readonly internalType: "string";
|
|
4527
3824
|
readonly name: "serverUrl";
|
|
4528
3825
|
readonly type: "string";
|
|
4529
3826
|
}];
|
|
4530
|
-
readonly internalType: "struct IDataPortabilityServers.
|
|
3827
|
+
readonly internalType: "struct IDataPortabilityServers.AddServerWithSignatureInput";
|
|
4531
3828
|
readonly name: "addServerInput";
|
|
4532
3829
|
readonly type: "tuple";
|
|
3830
|
+
}, {
|
|
3831
|
+
readonly internalType: "bytes";
|
|
3832
|
+
readonly name: "signature";
|
|
3833
|
+
readonly type: "bytes";
|
|
4533
3834
|
}];
|
|
4534
|
-
readonly name: "
|
|
3835
|
+
readonly name: "addServerWithSignature";
|
|
4535
3836
|
readonly outputs: readonly [];
|
|
4536
3837
|
readonly stateMutability: "nonpayable";
|
|
4537
3838
|
readonly type: "function";
|
|
@@ -4629,38 +3930,6 @@ declare const contractAbis: {
|
|
|
4629
3930
|
readonly outputs: readonly [];
|
|
4630
3931
|
readonly stateMutability: "nonpayable";
|
|
4631
3932
|
readonly type: "function";
|
|
4632
|
-
}, {
|
|
4633
|
-
readonly inputs: readonly [{
|
|
4634
|
-
readonly internalType: "uint256";
|
|
4635
|
-
readonly name: "serverId";
|
|
4636
|
-
readonly type: "uint256";
|
|
4637
|
-
}];
|
|
4638
|
-
readonly name: "isActiveServer";
|
|
4639
|
-
readonly outputs: readonly [{
|
|
4640
|
-
readonly internalType: "bool";
|
|
4641
|
-
readonly name: "";
|
|
4642
|
-
readonly type: "bool";
|
|
4643
|
-
}];
|
|
4644
|
-
readonly stateMutability: "view";
|
|
4645
|
-
readonly type: "function";
|
|
4646
|
-
}, {
|
|
4647
|
-
readonly inputs: readonly [{
|
|
4648
|
-
readonly internalType: "address";
|
|
4649
|
-
readonly name: "userAddress";
|
|
4650
|
-
readonly type: "address";
|
|
4651
|
-
}, {
|
|
4652
|
-
readonly internalType: "uint256";
|
|
4653
|
-
readonly name: "serverId";
|
|
4654
|
-
readonly type: "uint256";
|
|
4655
|
-
}];
|
|
4656
|
-
readonly name: "isActiveServerForUser";
|
|
4657
|
-
readonly outputs: readonly [{
|
|
4658
|
-
readonly internalType: "bool";
|
|
4659
|
-
readonly name: "";
|
|
4660
|
-
readonly type: "bool";
|
|
4661
|
-
}];
|
|
4662
|
-
readonly stateMutability: "view";
|
|
4663
|
-
readonly type: "function";
|
|
4664
3933
|
}, {
|
|
4665
3934
|
readonly inputs: readonly [{
|
|
4666
3935
|
readonly internalType: "address";
|
|
@@ -4778,9 +4047,9 @@ declare const contractAbis: {
|
|
|
4778
4047
|
readonly name: "serverAddress";
|
|
4779
4048
|
readonly type: "address";
|
|
4780
4049
|
}, {
|
|
4781
|
-
readonly internalType: "
|
|
4050
|
+
readonly internalType: "string";
|
|
4782
4051
|
readonly name: "publicKey";
|
|
4783
|
-
readonly type: "
|
|
4052
|
+
readonly type: "string";
|
|
4784
4053
|
}, {
|
|
4785
4054
|
readonly internalType: "string";
|
|
4786
4055
|
readonly name: "url";
|
|
@@ -4813,9 +4082,9 @@ declare const contractAbis: {
|
|
|
4813
4082
|
readonly name: "serverAddress";
|
|
4814
4083
|
readonly type: "address";
|
|
4815
4084
|
}, {
|
|
4816
|
-
readonly internalType: "
|
|
4085
|
+
readonly internalType: "string";
|
|
4817
4086
|
readonly name: "publicKey";
|
|
4818
|
-
readonly type: "
|
|
4087
|
+
readonly type: "string";
|
|
4819
4088
|
}, {
|
|
4820
4089
|
readonly internalType: "string";
|
|
4821
4090
|
readonly name: "url";
|
|
@@ -4889,6 +4158,20 @@ declare const contractAbis: {
|
|
|
4889
4158
|
readonly outputs: readonly [];
|
|
4890
4159
|
readonly stateMutability: "nonpayable";
|
|
4891
4160
|
readonly type: "function";
|
|
4161
|
+
}, {
|
|
4162
|
+
readonly inputs: readonly [{
|
|
4163
|
+
readonly internalType: "address";
|
|
4164
|
+
readonly name: "userAddress";
|
|
4165
|
+
readonly type: "address";
|
|
4166
|
+
}, {
|
|
4167
|
+
readonly internalType: "uint256";
|
|
4168
|
+
readonly name: "serverId";
|
|
4169
|
+
readonly type: "uint256";
|
|
4170
|
+
}];
|
|
4171
|
+
readonly name: "trustServerByManager";
|
|
4172
|
+
readonly outputs: readonly [];
|
|
4173
|
+
readonly stateMutability: "nonpayable";
|
|
4174
|
+
readonly type: "function";
|
|
4892
4175
|
}, {
|
|
4893
4176
|
readonly inputs: readonly [{
|
|
4894
4177
|
readonly components: readonly [{
|
|
@@ -5059,6 +4342,96 @@ declare const contractAbis: {
|
|
|
5059
4342
|
}];
|
|
5060
4343
|
readonly stateMutability: "view";
|
|
5061
4344
|
readonly type: "function";
|
|
4345
|
+
}, {
|
|
4346
|
+
readonly inputs: readonly [{
|
|
4347
|
+
readonly internalType: "address";
|
|
4348
|
+
readonly name: "userAddress";
|
|
4349
|
+
readonly type: "address";
|
|
4350
|
+
}];
|
|
4351
|
+
readonly name: "userServerValues";
|
|
4352
|
+
readonly outputs: readonly [{
|
|
4353
|
+
readonly components: readonly [{
|
|
4354
|
+
readonly internalType: "uint256";
|
|
4355
|
+
readonly name: "id";
|
|
4356
|
+
readonly type: "uint256";
|
|
4357
|
+
}, {
|
|
4358
|
+
readonly internalType: "address";
|
|
4359
|
+
readonly name: "owner";
|
|
4360
|
+
readonly type: "address";
|
|
4361
|
+
}, {
|
|
4362
|
+
readonly internalType: "address";
|
|
4363
|
+
readonly name: "serverAddress";
|
|
4364
|
+
readonly type: "address";
|
|
4365
|
+
}, {
|
|
4366
|
+
readonly internalType: "string";
|
|
4367
|
+
readonly name: "publicKey";
|
|
4368
|
+
readonly type: "string";
|
|
4369
|
+
}, {
|
|
4370
|
+
readonly internalType: "string";
|
|
4371
|
+
readonly name: "url";
|
|
4372
|
+
readonly type: "string";
|
|
4373
|
+
}, {
|
|
4374
|
+
readonly internalType: "uint256";
|
|
4375
|
+
readonly name: "startBlock";
|
|
4376
|
+
readonly type: "uint256";
|
|
4377
|
+
}, {
|
|
4378
|
+
readonly internalType: "uint256";
|
|
4379
|
+
readonly name: "endBlock";
|
|
4380
|
+
readonly type: "uint256";
|
|
4381
|
+
}];
|
|
4382
|
+
readonly internalType: "struct IDataPortabilityServers.TrustedServerInfo[]";
|
|
4383
|
+
readonly name: "serversInfo";
|
|
4384
|
+
readonly type: "tuple[]";
|
|
4385
|
+
}];
|
|
4386
|
+
readonly stateMutability: "view";
|
|
4387
|
+
readonly type: "function";
|
|
4388
|
+
}, {
|
|
4389
|
+
readonly inputs: readonly [{
|
|
4390
|
+
readonly internalType: "address";
|
|
4391
|
+
readonly name: "userAddress";
|
|
4392
|
+
readonly type: "address";
|
|
4393
|
+
}, {
|
|
4394
|
+
readonly internalType: "uint256";
|
|
4395
|
+
readonly name: "serverId";
|
|
4396
|
+
readonly type: "uint256";
|
|
4397
|
+
}];
|
|
4398
|
+
readonly name: "userServers";
|
|
4399
|
+
readonly outputs: readonly [{
|
|
4400
|
+
readonly components: readonly [{
|
|
4401
|
+
readonly internalType: "uint256";
|
|
4402
|
+
readonly name: "id";
|
|
4403
|
+
readonly type: "uint256";
|
|
4404
|
+
}, {
|
|
4405
|
+
readonly internalType: "address";
|
|
4406
|
+
readonly name: "owner";
|
|
4407
|
+
readonly type: "address";
|
|
4408
|
+
}, {
|
|
4409
|
+
readonly internalType: "address";
|
|
4410
|
+
readonly name: "serverAddress";
|
|
4411
|
+
readonly type: "address";
|
|
4412
|
+
}, {
|
|
4413
|
+
readonly internalType: "string";
|
|
4414
|
+
readonly name: "publicKey";
|
|
4415
|
+
readonly type: "string";
|
|
4416
|
+
}, {
|
|
4417
|
+
readonly internalType: "string";
|
|
4418
|
+
readonly name: "url";
|
|
4419
|
+
readonly type: "string";
|
|
4420
|
+
}, {
|
|
4421
|
+
readonly internalType: "uint256";
|
|
4422
|
+
readonly name: "startBlock";
|
|
4423
|
+
readonly type: "uint256";
|
|
4424
|
+
}, {
|
|
4425
|
+
readonly internalType: "uint256";
|
|
4426
|
+
readonly name: "endBlock";
|
|
4427
|
+
readonly type: "uint256";
|
|
4428
|
+
}];
|
|
4429
|
+
readonly internalType: "struct IDataPortabilityServers.TrustedServerInfo";
|
|
4430
|
+
readonly name: "";
|
|
4431
|
+
readonly type: "tuple";
|
|
4432
|
+
}];
|
|
4433
|
+
readonly stateMutability: "view";
|
|
4434
|
+
readonly type: "function";
|
|
5062
4435
|
}, {
|
|
5063
4436
|
readonly inputs: readonly [{
|
|
5064
4437
|
readonly internalType: "address";
|
|
@@ -29422,6 +28795,95 @@ type VanaContract = keyof ContractAbis;
|
|
|
29422
28795
|
*/
|
|
29423
28796
|
declare function getAbi<T extends VanaContract>(contract: T): ContractAbis[T];
|
|
29424
28797
|
|
|
28798
|
+
/**
|
|
28799
|
+
* Comprehensive mapping of SDK transaction operations to blockchain events.
|
|
28800
|
+
* Used by the generic transaction parser to know which contract and event
|
|
28801
|
+
* to look for when parsing transaction results.
|
|
28802
|
+
*/
|
|
28803
|
+
declare const EVENT_MAPPINGS: {
|
|
28804
|
+
readonly grant: {
|
|
28805
|
+
readonly contract: "DataPortabilityPermissions";
|
|
28806
|
+
readonly event: "PermissionAdded";
|
|
28807
|
+
};
|
|
28808
|
+
readonly revoke: {
|
|
28809
|
+
readonly contract: "DataPortabilityPermissions";
|
|
28810
|
+
readonly event: "PermissionRevoked";
|
|
28811
|
+
};
|
|
28812
|
+
readonly revokePermission: {
|
|
28813
|
+
readonly contract: "DataPortabilityPermissions";
|
|
28814
|
+
readonly event: "PermissionRevoked";
|
|
28815
|
+
};
|
|
28816
|
+
readonly addServerFilesAndPermissions: {
|
|
28817
|
+
readonly contract: "DataPortabilityPermissions";
|
|
28818
|
+
readonly event: "PermissionAdded";
|
|
28819
|
+
};
|
|
28820
|
+
readonly trustServer: {
|
|
28821
|
+
readonly contract: "DataPortabilityServers";
|
|
28822
|
+
readonly event: "ServerTrusted";
|
|
28823
|
+
};
|
|
28824
|
+
readonly untrustServer: {
|
|
28825
|
+
readonly contract: "DataPortabilityServers";
|
|
28826
|
+
readonly event: "ServerUntrusted";
|
|
28827
|
+
};
|
|
28828
|
+
readonly registerServer: {
|
|
28829
|
+
readonly contract: "DataPortabilityServers";
|
|
28830
|
+
readonly event: "ServerRegistered";
|
|
28831
|
+
};
|
|
28832
|
+
readonly updateServer: {
|
|
28833
|
+
readonly contract: "DataPortabilityServers";
|
|
28834
|
+
readonly event: "ServerUpdated";
|
|
28835
|
+
};
|
|
28836
|
+
readonly addAndTrustServer: {
|
|
28837
|
+
readonly contract: "DataPortabilityServers";
|
|
28838
|
+
readonly event: "ServerTrusted";
|
|
28839
|
+
};
|
|
28840
|
+
readonly addFile: {
|
|
28841
|
+
readonly contract: "DataRegistry";
|
|
28842
|
+
readonly event: "FileAdded";
|
|
28843
|
+
};
|
|
28844
|
+
readonly addFileWithPermissionsAndSchema: {
|
|
28845
|
+
readonly contract: "DataRegistry";
|
|
28846
|
+
readonly event: "FileAdded";
|
|
28847
|
+
};
|
|
28848
|
+
readonly addFileWithSchema: {
|
|
28849
|
+
readonly contract: "DataRegistry";
|
|
28850
|
+
readonly event: "FileAdded";
|
|
28851
|
+
};
|
|
28852
|
+
readonly addFileWithPermissions: {
|
|
28853
|
+
readonly contract: "DataRegistry";
|
|
28854
|
+
readonly event: "FileAdded";
|
|
28855
|
+
};
|
|
28856
|
+
readonly addRefinement: {
|
|
28857
|
+
readonly contract: "DataRegistry";
|
|
28858
|
+
readonly event: "RefinementAdded";
|
|
28859
|
+
};
|
|
28860
|
+
readonly addRefiner: {
|
|
28861
|
+
readonly contract: "DataRefinerRegistry";
|
|
28862
|
+
readonly event: "RefinerAdded";
|
|
28863
|
+
};
|
|
28864
|
+
readonly updateSchemaId: {
|
|
28865
|
+
readonly contract: "DataRefinerRegistry";
|
|
28866
|
+
readonly event: "SchemaAdded";
|
|
28867
|
+
};
|
|
28868
|
+
readonly addSchema: {
|
|
28869
|
+
readonly contract: "DataRefinerRegistry";
|
|
28870
|
+
readonly event: "SchemaAdded";
|
|
28871
|
+
};
|
|
28872
|
+
readonly updateRefinement: {
|
|
28873
|
+
readonly contract: "DataRegistry";
|
|
28874
|
+
readonly event: "RefinementUpdated";
|
|
28875
|
+
};
|
|
28876
|
+
readonly addFilePermission: {
|
|
28877
|
+
readonly contract: "DataRegistry";
|
|
28878
|
+
readonly event: "PermissionGranted";
|
|
28879
|
+
};
|
|
28880
|
+
readonly registerGrantee: {
|
|
28881
|
+
readonly contract: "DataPortabilityGrantees";
|
|
28882
|
+
readonly event: "GranteeRegistered";
|
|
28883
|
+
};
|
|
28884
|
+
};
|
|
28885
|
+
type TransactionOperation = keyof typeof EVENT_MAPPINGS;
|
|
28886
|
+
|
|
29425
28887
|
/**
|
|
29426
28888
|
* Base interface for all transaction results.
|
|
29427
28889
|
* Contains the event data plus transaction metadata.
|
|
@@ -29459,6 +28921,50 @@ interface PermissionRevokeResult extends BaseTransactionResult {
|
|
|
29459
28921
|
/** ID of the permission that was revoked */
|
|
29460
28922
|
permissionId: bigint;
|
|
29461
28923
|
}
|
|
28924
|
+
/**
|
|
28925
|
+
* Result of a successful server trust operation.
|
|
28926
|
+
* Contains data from the ServerTrusted blockchain event.
|
|
28927
|
+
*/
|
|
28928
|
+
interface ServerTrustResult extends BaseTransactionResult {
|
|
28929
|
+
/** Address of the user who trusted the server */
|
|
28930
|
+
user: Address;
|
|
28931
|
+
/** Address/ID of the trusted server */
|
|
28932
|
+
serverId: Address;
|
|
28933
|
+
/** URL of the trusted server */
|
|
28934
|
+
serverUrl: string;
|
|
28935
|
+
}
|
|
28936
|
+
/**
|
|
28937
|
+
* Result of a successful server untrust operation.
|
|
28938
|
+
* Contains data from the ServerUntrusted blockchain event.
|
|
28939
|
+
*/
|
|
28940
|
+
interface ServerUntrustResult extends BaseTransactionResult {
|
|
28941
|
+
/** Address of the user who untrusted the server */
|
|
28942
|
+
user: Address;
|
|
28943
|
+
/** Address/ID of the untrusted server */
|
|
28944
|
+
serverId: Address;
|
|
28945
|
+
}
|
|
28946
|
+
/**
|
|
28947
|
+
* Result of a successful server update operation.
|
|
28948
|
+
* Contains data from the ServerUpdated blockchain event.
|
|
28949
|
+
*/
|
|
28950
|
+
interface ServerUpdateResult extends BaseTransactionResult {
|
|
28951
|
+
/** ID of the server that was updated */
|
|
28952
|
+
serverId: bigint;
|
|
28953
|
+
/** New URL of the server */
|
|
28954
|
+
url: string;
|
|
28955
|
+
}
|
|
28956
|
+
/**
|
|
28957
|
+
* Result of a successful grantee registration operation.
|
|
28958
|
+
* Contains data from the GranteeRegistered blockchain event.
|
|
28959
|
+
*/
|
|
28960
|
+
interface GranteeRegisterResult extends BaseTransactionResult {
|
|
28961
|
+
/** Unique grantee ID assigned by the registry */
|
|
28962
|
+
granteeId: bigint;
|
|
28963
|
+
/** Address of the registered grantee */
|
|
28964
|
+
granteeAddress: Address;
|
|
28965
|
+
/** Display name of the grantee */
|
|
28966
|
+
name: string;
|
|
28967
|
+
}
|
|
29462
28968
|
/**
|
|
29463
28969
|
* Result of a successful file permission addition operation.
|
|
29464
28970
|
* Contains data from the FilePermissionAdded blockchain event.
|
|
@@ -29472,6 +28978,80 @@ interface FilePermissionResult extends BaseTransactionResult {
|
|
|
29472
28978
|
encryptedKey: string;
|
|
29473
28979
|
}
|
|
29474
28980
|
|
|
28981
|
+
/**
|
|
28982
|
+
* Provides a unified interface for blockchain transaction results with lazy-loaded event parsing.
|
|
28983
|
+
*
|
|
28984
|
+
* @remarks
|
|
28985
|
+
* TransactionHandle enables immediate access to transaction hashes while providing optional
|
|
28986
|
+
* lazy-loaded access to receipts and parsed event data. All transaction-submitting methods
|
|
28987
|
+
* in the SDK return this handle, allowing developers to choose between immediate hash access
|
|
28988
|
+
* or waiting for event data. Results are memoized to prevent redundant network calls.
|
|
28989
|
+
*
|
|
28990
|
+
* @category Transactions
|
|
28991
|
+
* @example
|
|
28992
|
+
* ```typescript
|
|
28993
|
+
* // Immediate hash access
|
|
28994
|
+
* const tx = await sdk.permissions.submitSignedGrant(typedData, signature);
|
|
28995
|
+
* console.log(`Transaction submitted: ${tx.hash}`);
|
|
28996
|
+
*
|
|
28997
|
+
* // Wait for and parse events
|
|
28998
|
+
* const eventData = await tx.waitForEvents();
|
|
28999
|
+
* console.log(`Permission ID: ${eventData.permissionId}`);
|
|
29000
|
+
*
|
|
29001
|
+
* // Check receipt for gas usage
|
|
29002
|
+
* const receipt = await tx.waitForReceipt();
|
|
29003
|
+
* console.log(`Gas used: ${receipt.gasUsed}`);
|
|
29004
|
+
* ```
|
|
29005
|
+
*/
|
|
29006
|
+
declare class TransactionHandle<TEventData = unknown> {
|
|
29007
|
+
private readonly context;
|
|
29008
|
+
readonly hash: Hash;
|
|
29009
|
+
private readonly operation?;
|
|
29010
|
+
private _receipt?;
|
|
29011
|
+
private _eventData?;
|
|
29012
|
+
private _receiptPromise?;
|
|
29013
|
+
private _eventPromise?;
|
|
29014
|
+
constructor(context: ControllerContext$1, hash: Hash, operation?: TransactionOperation | undefined);
|
|
29015
|
+
/**
|
|
29016
|
+
* Waits for transaction confirmation and returns the receipt.
|
|
29017
|
+
* Results are memoized - multiple calls return the same promise.
|
|
29018
|
+
*
|
|
29019
|
+
* @param options Optional timeout configuration
|
|
29020
|
+
* @param options.timeout Timeout in milliseconds (default: 30000)
|
|
29021
|
+
* @returns Transaction receipt with gas usage, logs, and status
|
|
29022
|
+
*/
|
|
29023
|
+
waitForReceipt(options?: {
|
|
29024
|
+
timeout?: number;
|
|
29025
|
+
}): Promise<TransactionReceipt$1>;
|
|
29026
|
+
/**
|
|
29027
|
+
* Waits for transaction confirmation and parses emitted events.
|
|
29028
|
+
* Results are memoized - multiple calls return the same promise.
|
|
29029
|
+
*
|
|
29030
|
+
* @returns Parsed event data with transaction metadata
|
|
29031
|
+
* @throws {Error} If no operation was specified for event parsing
|
|
29032
|
+
*/
|
|
29033
|
+
waitForEvents(): Promise<TEventData>;
|
|
29034
|
+
/**
|
|
29035
|
+
* Enables string coercion for backwards compatibility.
|
|
29036
|
+
* Allows TransactionHandle to be used anywhere a Hash is expected.
|
|
29037
|
+
*
|
|
29038
|
+
* @example
|
|
29039
|
+
* ```typescript
|
|
29040
|
+
* const hash: Hash = tx; // Works via toString()
|
|
29041
|
+
* console.log(`Transaction: ${tx}`); // Prints hash
|
|
29042
|
+
* ```
|
|
29043
|
+
* @returns The transaction hash as a string
|
|
29044
|
+
*/
|
|
29045
|
+
toString(): string;
|
|
29046
|
+
/**
|
|
29047
|
+
* JSON serialization support.
|
|
29048
|
+
* Returns the hash when serialized to JSON.
|
|
29049
|
+
*
|
|
29050
|
+
* @returns The transaction hash for JSON serialization
|
|
29051
|
+
*/
|
|
29052
|
+
toJSON(): string;
|
|
29053
|
+
}
|
|
29054
|
+
|
|
29475
29055
|
/**
|
|
29476
29056
|
* Google Drive Storage Provider for Vana SDK
|
|
29477
29057
|
*
|
|
@@ -30510,30 +30090,31 @@ declare class PermissionsController {
|
|
|
30510
30090
|
*/
|
|
30511
30091
|
grant(params: GrantPermissionParams$1): Promise<PermissionGrantResult>;
|
|
30512
30092
|
/**
|
|
30513
|
-
* Submits a permission grant transaction and returns
|
|
30093
|
+
* Submits a permission grant transaction and returns a handle for flexible result access.
|
|
30514
30094
|
*
|
|
30515
|
-
*
|
|
30516
|
-
*
|
|
30517
|
-
*
|
|
30095
|
+
* @remarks
|
|
30096
|
+
* This lower-level method provides maximum control over transaction timing.
|
|
30097
|
+
* Returns a TransactionHandle that allows immediate hash access or optional event parsing.
|
|
30098
|
+
* Use this when handling multiple transactions or when you need granular control.
|
|
30518
30099
|
*
|
|
30519
30100
|
* @param params - The permission grant configuration object
|
|
30520
|
-
* @returns Promise
|
|
30101
|
+
* @returns Promise resolving to TransactionHandle with hash and event parsing capabilities
|
|
30521
30102
|
* @throws {RelayerError} When gasless transaction submission fails
|
|
30522
30103
|
* @throws {SignatureError} When user rejects the signature request
|
|
30523
30104
|
* @throws {SerializationError} When grant data cannot be serialized
|
|
30524
30105
|
* @throws {BlockchainError} When permission grant preparation fails
|
|
30525
30106
|
* @example
|
|
30526
30107
|
* ```typescript
|
|
30527
|
-
* // Submit transaction and
|
|
30528
|
-
* const
|
|
30529
|
-
* console.log(`Transaction submitted: ${
|
|
30108
|
+
* // Submit transaction and get immediate hash access
|
|
30109
|
+
* const tx = await vana.permissions.submitPermissionGrant(params);
|
|
30110
|
+
* console.log(`Transaction submitted: ${tx.hash}`);
|
|
30530
30111
|
*
|
|
30531
|
-
* //
|
|
30532
|
-
* const
|
|
30533
|
-
* console.log(`Permission ID: ${
|
|
30112
|
+
* // Optionally wait for and parse events
|
|
30113
|
+
* const eventData = await tx.waitForEvents();
|
|
30114
|
+
* console.log(`Permission ID: ${eventData.permissionId}`);
|
|
30534
30115
|
* ```
|
|
30535
30116
|
*/
|
|
30536
|
-
submitPermissionGrant(params: GrantPermissionParams$1): Promise<
|
|
30117
|
+
submitPermissionGrant(params: GrantPermissionParams$1): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
30537
30118
|
/**
|
|
30538
30119
|
* Prepares a permission grant with preview before signing.
|
|
30539
30120
|
*
|
|
@@ -30561,15 +30142,21 @@ declare class PermissionsController {
|
|
|
30561
30142
|
*/
|
|
30562
30143
|
prepareGrant(params: GrantPermissionParams$1): Promise<{
|
|
30563
30144
|
preview: GrantFile;
|
|
30564
|
-
confirm: () => Promise<
|
|
30145
|
+
confirm: () => Promise<TransactionHandle<PermissionGrantResult>>;
|
|
30565
30146
|
}>;
|
|
30566
30147
|
/**
|
|
30567
|
-
*
|
|
30568
|
-
*
|
|
30148
|
+
* Completes the grant process after user confirmation.
|
|
30149
|
+
*
|
|
30150
|
+
* @remarks
|
|
30151
|
+
* This internal method is called by the confirm() function returned from prepareGrant().
|
|
30152
|
+
* It handles IPFS upload, signature creation, and transaction submission.
|
|
30569
30153
|
*
|
|
30570
30154
|
* @param params - The permission grant parameters containing user and operation details
|
|
30571
30155
|
* @param grantFile - The prepared grant file with permissions and metadata
|
|
30572
|
-
* @returns Promise resolving to
|
|
30156
|
+
* @returns Promise resolving to TransactionHandle for flexible result access
|
|
30157
|
+
* @throws {BlockchainError} When permission grant confirmation fails
|
|
30158
|
+
* @throws {NetworkError} When IPFS upload fails
|
|
30159
|
+
* @throws {SignatureError} When user rejects the signature
|
|
30573
30160
|
*/
|
|
30574
30161
|
private confirmGrantInternal;
|
|
30575
30162
|
/**
|
|
@@ -30625,40 +30212,106 @@ declare class PermissionsController {
|
|
|
30625
30212
|
* );
|
|
30626
30213
|
* ```
|
|
30627
30214
|
*/
|
|
30628
|
-
submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<
|
|
30215
|
+
submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
30629
30216
|
/**
|
|
30630
30217
|
* Submits an already-signed trust server transaction to the blockchain.
|
|
30218
|
+
*
|
|
30219
|
+
* @remarks
|
|
30631
30220
|
* This method extracts the trust server input from typed data and submits it directly.
|
|
30221
|
+
* Used internally by trust server methods after signature collection.
|
|
30632
30222
|
*
|
|
30633
30223
|
* @param typedData - The EIP-712 typed data for TrustServer
|
|
30634
|
-
* @param signature - The user's signature
|
|
30635
|
-
* @returns Promise resolving to
|
|
30224
|
+
* @param signature - The user's signature obtained via `signTypedData()`
|
|
30225
|
+
* @returns Promise resolving to TransactionHandle for transaction tracking
|
|
30226
|
+
* @throws {BlockchainError} When contract submission fails
|
|
30227
|
+
* @throws {NetworkError} When blockchain communication fails
|
|
30228
|
+
* @example
|
|
30229
|
+
* ```typescript
|
|
30230
|
+
* const txHandle = await vana.permissions.submitSignedTrustServer(
|
|
30231
|
+
* typedData,
|
|
30232
|
+
* "0x1234..."
|
|
30233
|
+
* );
|
|
30234
|
+
* const result = await txHandle.waitForEvents();
|
|
30235
|
+
* ```
|
|
30636
30236
|
*/
|
|
30637
|
-
submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<
|
|
30237
|
+
submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30238
|
+
/**
|
|
30239
|
+
* Submits an already-signed add and trust server transaction to the blockchain.
|
|
30240
|
+
*
|
|
30241
|
+
* @remarks
|
|
30242
|
+
* This method extracts the add and trust server input from typed data and submits it directly.
|
|
30243
|
+
* Combines server registration and trust operations in a single transaction.
|
|
30244
|
+
*
|
|
30245
|
+
* @param typedData - The EIP-712 typed data for AddAndTrustServer
|
|
30246
|
+
* @param signature - The user's signature obtained via `signTypedData()`
|
|
30247
|
+
* @returns Promise resolving to TransactionHandle for transaction tracking
|
|
30248
|
+
* @throws {BlockchainError} When contract submission fails
|
|
30249
|
+
* @throws {NetworkError} When blockchain communication fails
|
|
30250
|
+
* @example
|
|
30251
|
+
* ```typescript
|
|
30252
|
+
* const txHandle = await vana.permissions.submitSignedAddAndTrustServer(
|
|
30253
|
+
* typedData,
|
|
30254
|
+
* "0x1234..."
|
|
30255
|
+
* );
|
|
30256
|
+
* const result = await txHandle.waitForEvents();
|
|
30257
|
+
* ```
|
|
30258
|
+
*/
|
|
30259
|
+
submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30638
30260
|
/**
|
|
30639
30261
|
* Submits an already-signed permission revoke transaction to the blockchain.
|
|
30262
|
+
*
|
|
30263
|
+
* @remarks
|
|
30640
30264
|
* This method handles the revocation of previously granted permissions.
|
|
30265
|
+
* Used internally by revocation methods after signature collection.
|
|
30641
30266
|
*
|
|
30642
30267
|
* @param typedData - The EIP-712 typed data for PermissionRevoke
|
|
30643
|
-
* @param signature - The user's signature
|
|
30644
|
-
* @returns Promise resolving to
|
|
30268
|
+
* @param signature - The user's signature obtained via `signTypedData()`
|
|
30269
|
+
* @returns Promise resolving to TransactionHandle for transaction tracking
|
|
30270
|
+
* @throws {BlockchainError} When contract submission fails
|
|
30271
|
+
* @throws {NetworkError} When blockchain communication fails
|
|
30272
|
+
* @example
|
|
30273
|
+
* ```typescript
|
|
30274
|
+
* const txHandle = await vana.permissions.submitSignedRevoke(
|
|
30275
|
+
* typedData,
|
|
30276
|
+
* "0x1234..."
|
|
30277
|
+
* );
|
|
30278
|
+
* const result = await txHandle.waitForEvents();
|
|
30279
|
+
* ```
|
|
30645
30280
|
*/
|
|
30646
|
-
submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<
|
|
30281
|
+
submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionRevokeResult>>;
|
|
30647
30282
|
/**
|
|
30648
30283
|
* Submits an already-signed untrust server transaction to the blockchain.
|
|
30284
|
+
*
|
|
30285
|
+
* @remarks
|
|
30649
30286
|
* This method handles the removal of trusted servers.
|
|
30287
|
+
* Used internally by untrust server methods after signature collection.
|
|
30650
30288
|
*
|
|
30651
30289
|
* @param typedData - The EIP-712 typed data for UntrustServer
|
|
30652
|
-
* @param signature - The user's signature
|
|
30653
|
-
* @returns Promise resolving to
|
|
30290
|
+
* @param signature - The user's signature obtained via `signTypedData()`
|
|
30291
|
+
* @returns Promise resolving to TransactionHandle for transaction tracking
|
|
30292
|
+
* @throws {BlockchainError} When contract submission fails
|
|
30293
|
+
* @throws {NetworkError} When blockchain communication fails
|
|
30294
|
+
* @example
|
|
30295
|
+
* ```typescript
|
|
30296
|
+
* const txHandle = await vana.permissions.submitSignedUntrustServer(
|
|
30297
|
+
* typedData,
|
|
30298
|
+
* "0x1234..."
|
|
30299
|
+
* );
|
|
30300
|
+
* const result = await txHandle.waitForEvents();
|
|
30301
|
+
* ```
|
|
30654
30302
|
*/
|
|
30655
|
-
submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<
|
|
30303
|
+
submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<ServerUntrustResult>>;
|
|
30656
30304
|
/**
|
|
30657
30305
|
* Submits a signed transaction directly to the blockchain.
|
|
30658
30306
|
*
|
|
30307
|
+
* @remarks
|
|
30308
|
+
* Internal method used when relayer callbacks are not available. Formats the signature
|
|
30309
|
+
* and submits the permission grant directly to the smart contract.
|
|
30310
|
+
*
|
|
30659
30311
|
* @param typedData - The typed data structure for the permission grant
|
|
30660
30312
|
* @param signature - The cryptographic signature authorizing the transaction
|
|
30661
30313
|
* @returns Promise resolving to the transaction hash
|
|
30314
|
+
* @throws {BlockchainError} When contract submission fails
|
|
30662
30315
|
*/
|
|
30663
30316
|
private submitDirectTransaction;
|
|
30664
30317
|
/**
|
|
@@ -30705,21 +30358,38 @@ declare class PermissionsController {
|
|
|
30705
30358
|
* console.log(`Revocation submitted: ${txHash}`);
|
|
30706
30359
|
* ```
|
|
30707
30360
|
*/
|
|
30708
|
-
submitPermissionRevoke(params: RevokePermissionParams): Promise<
|
|
30361
|
+
submitPermissionRevoke(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
|
|
30709
30362
|
/**
|
|
30710
|
-
* Revokes a permission with a signature
|
|
30363
|
+
* Revokes a permission with a signature for gasless transactions.
|
|
30364
|
+
*
|
|
30365
|
+
* @remarks
|
|
30366
|
+
* This method creates an EIP-712 signature for permission revocation and submits
|
|
30367
|
+
* it either through relayer callbacks or directly to the blockchain. Provides
|
|
30368
|
+
* gasless revocation when relayer is configured.
|
|
30711
30369
|
*
|
|
30712
30370
|
* @param params - Parameters for revoking the permission
|
|
30713
|
-
* @
|
|
30371
|
+
* @param params.permissionId - Permission identifier to revoke (accepts bigint, number, or string)
|
|
30372
|
+
* @returns Promise resolving to TransactionHandle for transaction tracking
|
|
30714
30373
|
* @throws {BlockchainError} When chain ID is not available
|
|
30715
30374
|
* @throws {NonceError} When retrieving user nonce fails
|
|
30716
30375
|
* @throws {SignatureError} When user rejects the signature request
|
|
30717
30376
|
* @throws {RelayerError} When gasless submission fails
|
|
30718
30377
|
* @throws {PermissionError} When revocation fails for any other reason
|
|
30378
|
+
* @example
|
|
30379
|
+
* ```typescript
|
|
30380
|
+
* const txHandle = await vana.permissions.submitRevokeWithSignature({
|
|
30381
|
+
* permissionId: 123n
|
|
30382
|
+
* });
|
|
30383
|
+
* const result = await txHandle.waitForEvents();
|
|
30384
|
+
* console.log(`Permission ${result.permissionId} revoked`);
|
|
30385
|
+
* ```
|
|
30719
30386
|
*/
|
|
30720
|
-
|
|
30387
|
+
submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
|
|
30721
30388
|
/**
|
|
30389
|
+
* @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
|
|
30390
|
+
*
|
|
30722
30391
|
* Retrieves the user's current nonce from the DataPortabilityServers contract.
|
|
30392
|
+
* This method is deprecated in favor of more specific nonce methods.
|
|
30723
30393
|
*
|
|
30724
30394
|
* The nonce is used to prevent replay attacks in signed transactions and must
|
|
30725
30395
|
* be incremented with each transaction to maintain security.
|
|
@@ -30731,11 +30401,77 @@ declare class PermissionsController {
|
|
|
30731
30401
|
* @private
|
|
30732
30402
|
* @example
|
|
30733
30403
|
* ```typescript
|
|
30404
|
+
* // Deprecated - use specific methods instead
|
|
30734
30405
|
* const nonce = await this.getUserNonce();
|
|
30735
|
-
*
|
|
30406
|
+
*
|
|
30407
|
+
* // Use these instead:
|
|
30408
|
+
* const permissionsNonce = await this.getPermissionsUserNonce();
|
|
30409
|
+
* const serversNonce = await this.getServersUserNonce();
|
|
30736
30410
|
* ```
|
|
30737
30411
|
*/
|
|
30412
|
+
/**
|
|
30413
|
+
* @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
|
|
30414
|
+
*
|
|
30415
|
+
* Retrieves the user's current nonce from the DataPortabilityServers contract.
|
|
30416
|
+
*
|
|
30417
|
+
* @remarks
|
|
30418
|
+
* This method is deprecated in favor of more specific nonce methods that target
|
|
30419
|
+
* the appropriate contract for the operation being performed.
|
|
30420
|
+
*
|
|
30421
|
+
* @returns Promise resolving to the user's current nonce as a bigint
|
|
30422
|
+
* @throws {NonceError} When retrieving the nonce fails
|
|
30423
|
+
*/
|
|
30738
30424
|
private getUserNonce;
|
|
30425
|
+
/**
|
|
30426
|
+
* Retrieves the user's current nonce from the DataPortabilityServers contract.
|
|
30427
|
+
* This nonce is used for server-related operations (AddAndTrustServer, TrustServer, UntrustServer).
|
|
30428
|
+
*
|
|
30429
|
+
* @returns Promise resolving to the current servers nonce
|
|
30430
|
+
* @throws {NonceError} When reading nonce from contract fails
|
|
30431
|
+
* @private
|
|
30432
|
+
*
|
|
30433
|
+
* @example
|
|
30434
|
+
* ```typescript
|
|
30435
|
+
* const nonce = await this.getServersUserNonce();
|
|
30436
|
+
* console.log(`Current servers nonce: ${nonce}`);
|
|
30437
|
+
* ```
|
|
30438
|
+
*/
|
|
30439
|
+
/**
|
|
30440
|
+
* Retrieves the user's current nonce from the DataPortabilityServers contract.
|
|
30441
|
+
*
|
|
30442
|
+
* @remarks
|
|
30443
|
+
* Used for server-related operations (trust/untrust) to prevent replay attacks.
|
|
30444
|
+
* The nonce must be incremented with each server operation.
|
|
30445
|
+
*
|
|
30446
|
+
* @returns Promise resolving to the user's current nonce as a bigint
|
|
30447
|
+
* @throws {NonceError} When retrieving the nonce fails
|
|
30448
|
+
*/
|
|
30449
|
+
private getServersUserNonce;
|
|
30450
|
+
/**
|
|
30451
|
+
* Retrieves the user's current nonce from the DataPortabilityPermissions contract.
|
|
30452
|
+
* This nonce is used for permission-related operations (addPermission, addServerFilesAndPermissions).
|
|
30453
|
+
*
|
|
30454
|
+
* @returns Promise resolving to the current permissions nonce
|
|
30455
|
+
* @throws {NonceError} When reading nonce from contract fails
|
|
30456
|
+
* @private
|
|
30457
|
+
*
|
|
30458
|
+
* @example
|
|
30459
|
+
* ```typescript
|
|
30460
|
+
* const nonce = await this.getPermissionsUserNonce();
|
|
30461
|
+
* console.log(`Current permissions nonce: ${nonce}`);
|
|
30462
|
+
* ```
|
|
30463
|
+
*/
|
|
30464
|
+
/**
|
|
30465
|
+
* Retrieves the user's current nonce from the DataPortabilityPermissions contract.
|
|
30466
|
+
*
|
|
30467
|
+
* @remarks
|
|
30468
|
+
* Used for permission-related operations (grant/revoke) to prevent replay attacks.
|
|
30469
|
+
* The nonce must be incremented with each permission operation.
|
|
30470
|
+
*
|
|
30471
|
+
* @returns Promise resolving to the user's current nonce as a bigint
|
|
30472
|
+
* @throws {NonceError} When retrieving the nonce fails
|
|
30473
|
+
*/
|
|
30474
|
+
private getPermissionsUserNonce;
|
|
30739
30475
|
/**
|
|
30740
30476
|
* Composes the EIP-712 typed data for PermissionGrant (new simplified format).
|
|
30741
30477
|
*
|
|
@@ -30749,6 +30485,22 @@ declare class PermissionsController {
|
|
|
30749
30485
|
* @returns Promise resolving to the typed data structure
|
|
30750
30486
|
*/
|
|
30751
30487
|
private composePermissionGrantMessage;
|
|
30488
|
+
/**
|
|
30489
|
+
* Creates EIP-712 typed data structure for server files and permissions.
|
|
30490
|
+
*
|
|
30491
|
+
* @param params - Parameters for the server files and permissions message
|
|
30492
|
+
* @param params.granteeId - Grantee ID
|
|
30493
|
+
* @param params.grant - Grant URL or grant data
|
|
30494
|
+
* @param params.fileUrls - Array of file URLs
|
|
30495
|
+
* @param params.schemaIds - Schema IDs for each file
|
|
30496
|
+
* @param params.serverAddress - Server address
|
|
30497
|
+
* @param params.serverUrl - Server URL
|
|
30498
|
+
* @param params.serverPublicKey - Server public key
|
|
30499
|
+
* @param params.filePermissions - File permissions array
|
|
30500
|
+
* @param params.nonce - Unique number to prevent replay attacks
|
|
30501
|
+
* @returns Promise resolving to the typed data structure
|
|
30502
|
+
*/
|
|
30503
|
+
private composeServerFilesAndPermissionMessage;
|
|
30752
30504
|
/**
|
|
30753
30505
|
* Gets the EIP-712 domain for PermissionGrant signatures.
|
|
30754
30506
|
*
|
|
@@ -30804,38 +30556,6 @@ declare class PermissionsController {
|
|
|
30804
30556
|
* ```
|
|
30805
30557
|
*/
|
|
30806
30558
|
getUserPermissionGrantsOnChain(options?: GetUserPermissionsOptions): Promise<OnChainPermissionGrant[]>;
|
|
30807
|
-
/**
|
|
30808
|
-
* Gets all permission IDs for a specific file.
|
|
30809
|
-
*
|
|
30810
|
-
* @param fileId - The file ID to query permissions for
|
|
30811
|
-
* @returns Promise resolving to array of permission IDs
|
|
30812
|
-
* @throws {BlockchainError} When reading from contract fails or chain is unavailable
|
|
30813
|
-
*/
|
|
30814
|
-
getFilePermissionIds(fileId: bigint): Promise<bigint[]>;
|
|
30815
|
-
/**
|
|
30816
|
-
* Gets all file IDs associated with a permission.
|
|
30817
|
-
*
|
|
30818
|
-
* @param permissionId - The permission ID to query files for
|
|
30819
|
-
* @returns Promise resolving to array of file IDs
|
|
30820
|
-
* @throws {BlockchainError} When reading from contract fails or chain is unavailable
|
|
30821
|
-
*/
|
|
30822
|
-
getPermissionFileIds(permissionId: bigint): Promise<bigint[]>;
|
|
30823
|
-
/**
|
|
30824
|
-
* Checks if a permission is active.
|
|
30825
|
-
*
|
|
30826
|
-
* @param permissionId - The permission ID to check
|
|
30827
|
-
* @returns Promise resolving to boolean indicating if permission is active
|
|
30828
|
-
* @throws {BlockchainError} When reading from contract fails or chain is unavailable
|
|
30829
|
-
*/
|
|
30830
|
-
isActivePermission(permissionId: bigint): Promise<boolean>;
|
|
30831
|
-
/**
|
|
30832
|
-
* Gets permission details from the contract.
|
|
30833
|
-
*
|
|
30834
|
-
* @param permissionId - The permission ID to query
|
|
30835
|
-
* @returns Promise resolving to permission info
|
|
30836
|
-
* @throws {BlockchainError} When reading from contract fails or chain is unavailable
|
|
30837
|
-
*/
|
|
30838
|
-
getPermissionInfo(permissionId: bigint): Promise<PermissionInfo>;
|
|
30839
30559
|
/**
|
|
30840
30560
|
* Normalizes grant ID to hex format.
|
|
30841
30561
|
* Handles conversion from permission ID (bigint/number/string) to proper hex hash format.
|
|
@@ -30878,7 +30598,7 @@ declare class PermissionsController {
|
|
|
30878
30598
|
* console.log('Now trusting servers:', trustedServers);
|
|
30879
30599
|
* ```
|
|
30880
30600
|
*/
|
|
30881
|
-
addAndTrustServer(params: AddAndTrustServerParams): Promise<
|
|
30601
|
+
addAndTrustServer(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30882
30602
|
/**
|
|
30883
30603
|
* Trusts a server for data processing (legacy method).
|
|
30884
30604
|
*
|
|
@@ -30886,14 +30606,14 @@ declare class PermissionsController {
|
|
|
30886
30606
|
* @returns Promise resolving to transaction hash
|
|
30887
30607
|
* @deprecated Use addAndTrustServer instead
|
|
30888
30608
|
*/
|
|
30889
|
-
|
|
30609
|
+
submitTrustServer(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30890
30610
|
/**
|
|
30891
30611
|
* Adds and trusts a server using a signature (gasless transaction).
|
|
30892
30612
|
*
|
|
30893
30613
|
* @param params - Parameters for adding and trusting the server
|
|
30894
|
-
* @returns Promise resolving to
|
|
30614
|
+
* @returns Promise resolving to TransactionHandle with ServerTrustResult event data
|
|
30895
30615
|
*/
|
|
30896
|
-
|
|
30616
|
+
submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30897
30617
|
/**
|
|
30898
30618
|
* Trusts a server using a signature (gasless transaction - legacy method).
|
|
30899
30619
|
*
|
|
@@ -30907,13 +30627,24 @@ declare class PermissionsController {
|
|
|
30907
30627
|
* @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
|
|
30908
30628
|
* @throws {BlockchainError} When trust operation fails for any other reason
|
|
30909
30629
|
*/
|
|
30910
|
-
|
|
30630
|
+
submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30911
30631
|
/**
|
|
30912
30632
|
* Submits a direct untrust server transaction (without signature).
|
|
30913
30633
|
*
|
|
30914
30634
|
* @param params - The untrust server parameters containing server details
|
|
30915
30635
|
* @returns Promise resolving to the transaction hash
|
|
30916
30636
|
*/
|
|
30637
|
+
/**
|
|
30638
|
+
* Submits an untrust server transaction directly to the blockchain.
|
|
30639
|
+
*
|
|
30640
|
+
* @remarks
|
|
30641
|
+
* Internal method used for direct blockchain submission of untrust server operations
|
|
30642
|
+
* when relayer callbacks are not available.
|
|
30643
|
+
*
|
|
30644
|
+
* @param params - The untrust server parameters
|
|
30645
|
+
* @returns Promise resolving to TransactionHandle for transaction tracking
|
|
30646
|
+
* @throws {BlockchainError} When contract submission fails
|
|
30647
|
+
*/
|
|
30917
30648
|
private submitDirectUntrustTransaction;
|
|
30918
30649
|
/**
|
|
30919
30650
|
* Removes a server from the user's trusted servers list in the DataPortabilityServers contract.
|
|
@@ -30943,7 +30674,7 @@ declare class PermissionsController {
|
|
|
30943
30674
|
* console.log('Still trusting servers:', trustedServers);
|
|
30944
30675
|
* ```
|
|
30945
30676
|
*/
|
|
30946
|
-
|
|
30677
|
+
submitUntrustServer(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
|
|
30947
30678
|
/**
|
|
30948
30679
|
* Untrusts a server using a signature (gasless transaction).
|
|
30949
30680
|
*
|
|
@@ -30956,7 +30687,7 @@ declare class PermissionsController {
|
|
|
30956
30687
|
* @throws {RelayerError} When gasless submission fails
|
|
30957
30688
|
* @throws {BlockchainError} When untrust transaction fails
|
|
30958
30689
|
*/
|
|
30959
|
-
|
|
30690
|
+
submitUntrustServerWithSignature(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
|
|
30960
30691
|
/**
|
|
30961
30692
|
* Retrieves all servers trusted by a user from the DataPortabilityServers contract.
|
|
30962
30693
|
*
|
|
@@ -30980,61 +30711,6 @@ declare class PermissionsController {
|
|
|
30980
30711
|
* ```
|
|
30981
30712
|
*/
|
|
30982
30713
|
getTrustedServers(userAddress?: Address): Promise<number[]>;
|
|
30983
|
-
/**
|
|
30984
|
-
* Retrieves detailed information about a specific server from the DataPortabilityServers contract.
|
|
30985
|
-
*
|
|
30986
|
-
* Returns complete server information including owner, address, public key, and URL.
|
|
30987
|
-
* This information is used to establish secure connections and verify server identity.
|
|
30988
|
-
*
|
|
30989
|
-
* @param serverId - The unique numeric ID of the server to query
|
|
30990
|
-
* @returns Promise resolving to complete server information
|
|
30991
|
-
* @throws {BlockchainError} When reading from contract fails or chain is unavailable
|
|
30992
|
-
* @throws {NetworkError} When unable to connect to the blockchain network
|
|
30993
|
-
* @throws {ServerNotFoundError} When the server ID does not exist
|
|
30994
|
-
*
|
|
30995
|
-
* @example
|
|
30996
|
-
* ```typescript
|
|
30997
|
-
* const server = await vana.permissions.getServerInfo(1);
|
|
30998
|
-
*
|
|
30999
|
-
* console.log(`Server ${server.id}:`);
|
|
31000
|
-
* console.log(` Owner: ${server.owner}`);
|
|
31001
|
-
* console.log(` Address: ${server.serverAddress}`);
|
|
31002
|
-
* console.log(` URL: ${server.url}`);
|
|
31003
|
-
* console.log(` Public Key: ${server.publicKey}`);
|
|
31004
|
-
* ```
|
|
31005
|
-
*/
|
|
31006
|
-
getServerInfo(serverId: number): Promise<Server>;
|
|
31007
|
-
/**
|
|
31008
|
-
* Checks if a specific server is active in the DataPortabilityServers contract.
|
|
31009
|
-
*
|
|
31010
|
-
* An active server is one that is properly registered and operational, meaning
|
|
31011
|
-
* it can receive and process data portability requests from users.
|
|
31012
|
-
*
|
|
31013
|
-
* @param serverId - The unique numeric ID of the server to check
|
|
31014
|
-
* @returns Promise resolving to true if server is active, false otherwise
|
|
31015
|
-
* @throws {BlockchainError} When reading from contract fails or chain is unavailable
|
|
31016
|
-
* @throws {NetworkError} When unable to connect to the blockchain network
|
|
31017
|
-
*
|
|
31018
|
-
* @example
|
|
31019
|
-
* ```typescript
|
|
31020
|
-
* const isActive = await vana.permissions.isActiveServer(1);
|
|
31021
|
-
*
|
|
31022
|
-
* if (isActive) {
|
|
31023
|
-
* console.log('Server 1 is active and ready to process requests');
|
|
31024
|
-
* } else {
|
|
31025
|
-
* console.log('Server 1 is inactive or not found');
|
|
31026
|
-
* }
|
|
31027
|
-
* ```
|
|
31028
|
-
*/
|
|
31029
|
-
isActiveServer(serverId: number): Promise<boolean>;
|
|
31030
|
-
/**
|
|
31031
|
-
* Checks if a server is active for a specific user.
|
|
31032
|
-
*
|
|
31033
|
-
* @param serverId - Server ID (numeric)
|
|
31034
|
-
* @param userAddress - Optional user address (defaults to current user)
|
|
31035
|
-
* @returns Promise resolving to boolean indicating if server is active for the user
|
|
31036
|
-
*/
|
|
31037
|
-
isActiveServerForUser(serverId: number, userAddress?: Address): Promise<boolean>;
|
|
31038
30714
|
/**
|
|
31039
30715
|
* Gets the total count of trusted servers for a user.
|
|
31040
30716
|
*
|
|
@@ -31062,22 +30738,60 @@ declare class PermissionsController {
|
|
|
31062
30738
|
/**
|
|
31063
30739
|
* Gets server information for multiple servers efficiently.
|
|
31064
30740
|
*
|
|
31065
|
-
* @
|
|
31066
|
-
*
|
|
30741
|
+
* @remarks
|
|
30742
|
+
* This method uses multicall to fetch information for multiple servers in a single
|
|
30743
|
+
* blockchain call, improving performance when querying many servers. Failed lookups
|
|
30744
|
+
* are returned separately for error handling.
|
|
30745
|
+
*
|
|
30746
|
+
* @param serverIds - Array of numeric server IDs to query
|
|
30747
|
+
* @returns Promise resolving to batch result containing successful lookups and failed IDs
|
|
31067
30748
|
* @throws {BlockchainError} When reading from contract fails or chain is unavailable
|
|
30749
|
+
* @example
|
|
30750
|
+
* ```typescript
|
|
30751
|
+
* const result = await vana.permissions.getServerInfoBatch([1, 2, 3, 999]);
|
|
30752
|
+
*
|
|
30753
|
+
* // Process successful lookups
|
|
30754
|
+
* result.servers.forEach((server, id) => {
|
|
30755
|
+
* console.log(`Server ${id}: ${server.url}`);
|
|
30756
|
+
* });
|
|
30757
|
+
*
|
|
30758
|
+
* // Handle failed lookups
|
|
30759
|
+
* if (result.failed.length > 0) {
|
|
30760
|
+
* console.log(`Failed to fetch: ${result.failed.join(', ')}`);
|
|
30761
|
+
* }
|
|
30762
|
+
* ```
|
|
31068
30763
|
*/
|
|
31069
30764
|
getServerInfoBatch(serverIds: number[]): Promise<BatchServerInfoResult>;
|
|
31070
30765
|
/**
|
|
31071
30766
|
* Checks whether a specific server is trusted by a user.
|
|
31072
30767
|
*
|
|
31073
|
-
* @
|
|
30768
|
+
* @remarks
|
|
30769
|
+
* This method queries the user's trusted server list and checks if the specified
|
|
30770
|
+
* server is present. Returns both the trust status and the index in the trust list
|
|
30771
|
+
* if trusted.
|
|
30772
|
+
*
|
|
30773
|
+
* @param serverId - Numeric server ID to check
|
|
31074
30774
|
* @param userAddress - Optional user address (defaults to current user)
|
|
31075
|
-
* @returns Promise resolving to server trust status
|
|
30775
|
+
* @returns Promise resolving to server trust status with trust index if applicable
|
|
30776
|
+
* @throws {BlockchainError} When reading from contract fails
|
|
30777
|
+
* @example
|
|
30778
|
+
* ```typescript
|
|
30779
|
+
* const status = await vana.permissions.checkServerTrustStatus(1);
|
|
30780
|
+
* if (status.isTrusted) {
|
|
30781
|
+
* console.log(`Server is trusted at index ${status.trustIndex}`);
|
|
30782
|
+
* } else {
|
|
30783
|
+
* console.log('Server is not trusted');
|
|
30784
|
+
* }
|
|
30785
|
+
* ```
|
|
31076
30786
|
*/
|
|
31077
30787
|
checkServerTrustStatus(serverId: number, userAddress?: Address): Promise<ServerTrustStatus>;
|
|
31078
30788
|
/**
|
|
31079
30789
|
* Composes EIP-712 typed data for AddAndTrustServer.
|
|
31080
30790
|
*
|
|
30791
|
+
* @remarks
|
|
30792
|
+
* Creates the complete typed data structure required for EIP-712 signature generation
|
|
30793
|
+
* when adding and trusting a new server in a single transaction.
|
|
30794
|
+
*
|
|
31081
30795
|
* @param input - The add and trust server input data containing server details
|
|
31082
30796
|
* @returns Promise resolving to the typed data structure for server add and trust
|
|
31083
30797
|
*/
|
|
@@ -31159,7 +30873,7 @@ declare class PermissionsController {
|
|
|
31159
30873
|
* console.log(`Grantee registered in transaction: ${txHash}`);
|
|
31160
30874
|
* ```
|
|
31161
30875
|
*/
|
|
31162
|
-
|
|
30876
|
+
submitRegisterGrantee(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
|
|
31163
30877
|
/**
|
|
31164
30878
|
* Registers a grantee with a signature (gasless transaction)
|
|
31165
30879
|
*
|
|
@@ -31175,7 +30889,7 @@ declare class PermissionsController {
|
|
|
31175
30889
|
* });
|
|
31176
30890
|
* ```
|
|
31177
30891
|
*/
|
|
31178
|
-
|
|
30892
|
+
submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
|
|
31179
30893
|
/**
|
|
31180
30894
|
* Submits a signed register grantee transaction via relayer
|
|
31181
30895
|
*
|
|
@@ -31188,7 +30902,7 @@ declare class PermissionsController {
|
|
|
31188
30902
|
* const result = await vana.permissions.submitSignedRegisterGrantee(typedData, signature);
|
|
31189
30903
|
* ```
|
|
31190
30904
|
*/
|
|
31191
|
-
submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<
|
|
30905
|
+
submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<TransactionHandle<GranteeRegisterResult>>;
|
|
31192
30906
|
/**
|
|
31193
30907
|
* Retrieves all registered grantees from the DataPortabilityGrantees contract.
|
|
31194
30908
|
*
|
|
@@ -31292,6 +31006,345 @@ declare class PermissionsController {
|
|
|
31292
31006
|
* @private
|
|
31293
31007
|
*/
|
|
31294
31008
|
private submitSignedRegisterGranteeTransaction;
|
|
31009
|
+
/**
|
|
31010
|
+
* Get all trusted server IDs for a user
|
|
31011
|
+
*
|
|
31012
|
+
* @param userAddress - User address to query (defaults to current user)
|
|
31013
|
+
* @returns Promise resolving to array of server IDs
|
|
31014
|
+
*/
|
|
31015
|
+
getUserServerIds(userAddress?: Address): Promise<bigint[]>;
|
|
31016
|
+
/**
|
|
31017
|
+
* Get server ID at specific index for a user
|
|
31018
|
+
*
|
|
31019
|
+
* @param userAddress - User address to query
|
|
31020
|
+
* @param serverIndex - Index in the user's server list
|
|
31021
|
+
* @returns Promise resolving to server ID
|
|
31022
|
+
*/
|
|
31023
|
+
getUserServerIdAt(userAddress: Address, serverIndex: bigint): Promise<bigint>;
|
|
31024
|
+
/**
|
|
31025
|
+
* Get the number of trusted servers for a user
|
|
31026
|
+
*
|
|
31027
|
+
* @param userAddress - User address to query (defaults to current user)
|
|
31028
|
+
* @returns Promise resolving to number of trusted servers
|
|
31029
|
+
*/
|
|
31030
|
+
getUserServerCount(userAddress?: Address): Promise<bigint>;
|
|
31031
|
+
/**
|
|
31032
|
+
* Get detailed information about trusted servers for a user
|
|
31033
|
+
*
|
|
31034
|
+
* @param userAddress - User address to query (defaults to current user)
|
|
31035
|
+
* @returns Promise resolving to array of trusted server info
|
|
31036
|
+
*/
|
|
31037
|
+
getUserTrustedServers(userAddress?: Address): Promise<TrustedServerInfo[]>;
|
|
31038
|
+
/**
|
|
31039
|
+
* Get trusted server info for a specific server ID and user
|
|
31040
|
+
*
|
|
31041
|
+
* @param userAddress - User address to query
|
|
31042
|
+
* @param serverId - Server ID to get info for
|
|
31043
|
+
* @returns Promise resolving to trusted server info
|
|
31044
|
+
*/
|
|
31045
|
+
getUserTrustedServer(userAddress: Address, serverId: bigint): Promise<TrustedServerInfo>;
|
|
31046
|
+
/**
|
|
31047
|
+
* Get server information by server ID
|
|
31048
|
+
*
|
|
31049
|
+
* @param serverId - Server ID to get info for
|
|
31050
|
+
* @returns Promise resolving to server info
|
|
31051
|
+
*/
|
|
31052
|
+
getServerInfo(serverId: bigint): Promise<ServerInfo>;
|
|
31053
|
+
/**
|
|
31054
|
+
* Get server information by server address
|
|
31055
|
+
*
|
|
31056
|
+
* @param serverAddress - Server address to get info for
|
|
31057
|
+
* @returns Promise resolving to server info
|
|
31058
|
+
*/
|
|
31059
|
+
getServerInfoByAddress(serverAddress: Address): Promise<ServerInfo>;
|
|
31060
|
+
/**
|
|
31061
|
+
* Get all permission IDs for a user
|
|
31062
|
+
*
|
|
31063
|
+
* @param userAddress - User address to query (defaults to current user)
|
|
31064
|
+
* @returns Promise resolving to array of permission IDs
|
|
31065
|
+
*/
|
|
31066
|
+
getUserPermissionIds(userAddress?: Address): Promise<bigint[]>;
|
|
31067
|
+
/**
|
|
31068
|
+
* Get permission ID at specific index for a user
|
|
31069
|
+
*
|
|
31070
|
+
* @param userAddress - User address to query
|
|
31071
|
+
* @param permissionIndex - Index in the user's permission list
|
|
31072
|
+
* @returns Promise resolving to permission ID
|
|
31073
|
+
*/
|
|
31074
|
+
getUserPermissionIdAt(userAddress: Address, permissionIndex: bigint): Promise<bigint>;
|
|
31075
|
+
/**
|
|
31076
|
+
* Get the number of permissions for a user
|
|
31077
|
+
*
|
|
31078
|
+
* @param userAddress - User address to query (defaults to current user)
|
|
31079
|
+
* @returns Promise resolving to number of permissions
|
|
31080
|
+
*/
|
|
31081
|
+
getUserPermissionCount(userAddress?: Address): Promise<bigint>;
|
|
31082
|
+
/**
|
|
31083
|
+
* Get detailed permission information by permission ID
|
|
31084
|
+
*
|
|
31085
|
+
* @param permissionId - Permission ID to get info for
|
|
31086
|
+
* @returns Promise resolving to permission info
|
|
31087
|
+
*/
|
|
31088
|
+
getPermissionInfo(permissionId: bigint): Promise<PermissionInfo>;
|
|
31089
|
+
/**
|
|
31090
|
+
* Get all permission IDs for a specific file
|
|
31091
|
+
*
|
|
31092
|
+
* @param fileId - File ID to get permissions for
|
|
31093
|
+
* @returns Promise resolving to array of permission IDs
|
|
31094
|
+
*/
|
|
31095
|
+
getFilePermissionIds(fileId: bigint): Promise<bigint[]>;
|
|
31096
|
+
/**
|
|
31097
|
+
* Get all file IDs for a specific permission
|
|
31098
|
+
*
|
|
31099
|
+
* @param permissionId - Permission ID to get files for
|
|
31100
|
+
* @returns Promise resolving to array of file IDs
|
|
31101
|
+
*/
|
|
31102
|
+
getPermissionFileIds(permissionId: bigint): Promise<bigint[]>;
|
|
31103
|
+
/**
|
|
31104
|
+
* Get all permissions for a specific file (alias for getFilePermissionIds)
|
|
31105
|
+
*
|
|
31106
|
+
* @param fileId - File ID to get permissions for
|
|
31107
|
+
* @returns Promise resolving to array of permission IDs
|
|
31108
|
+
*/
|
|
31109
|
+
getFilePermissions(fileId: bigint): Promise<bigint[]>;
|
|
31110
|
+
/**
|
|
31111
|
+
* Get grantee information by grantee ID
|
|
31112
|
+
*
|
|
31113
|
+
* @param granteeId - Grantee ID to get info for
|
|
31114
|
+
* @returns Promise resolving to grantee info
|
|
31115
|
+
*/
|
|
31116
|
+
getGranteeInfo(granteeId: bigint): Promise<GranteeInfo>;
|
|
31117
|
+
/**
|
|
31118
|
+
* Get grantee information by grantee address
|
|
31119
|
+
*
|
|
31120
|
+
* @param granteeAddress - Grantee address to get info for
|
|
31121
|
+
* @returns Promise resolving to grantee info
|
|
31122
|
+
*/
|
|
31123
|
+
getGranteeInfoByAddress(granteeAddress: Address): Promise<GranteeInfo>;
|
|
31124
|
+
/**
|
|
31125
|
+
* Get all permission IDs for a specific grantee
|
|
31126
|
+
*
|
|
31127
|
+
* @param granteeId - Grantee ID to get permissions for
|
|
31128
|
+
* @returns Promise resolving to array of permission IDs
|
|
31129
|
+
*/
|
|
31130
|
+
getGranteePermissionIds(granteeId: bigint): Promise<bigint[]>;
|
|
31131
|
+
/**
|
|
31132
|
+
* Get all permissions for a specific grantee (alias for getGranteePermissionIds)
|
|
31133
|
+
*
|
|
31134
|
+
* @param granteeId - Grantee ID to get permissions for
|
|
31135
|
+
* @returns Promise resolving to array of permission IDs
|
|
31136
|
+
*/
|
|
31137
|
+
getGranteePermissions(granteeId: bigint): Promise<bigint[]>;
|
|
31138
|
+
/**
|
|
31139
|
+
* Get all server IDs for a user
|
|
31140
|
+
*
|
|
31141
|
+
* @param userAddress - User address to get server IDs for
|
|
31142
|
+
* @returns Promise resolving to array of server IDs
|
|
31143
|
+
*/
|
|
31144
|
+
getUserServerIdsValues(userAddress: Address): Promise<bigint[]>;
|
|
31145
|
+
/**
|
|
31146
|
+
* Get server ID at specific index for a user
|
|
31147
|
+
*
|
|
31148
|
+
* @param userAddress - User address
|
|
31149
|
+
* @param serverIndex - Index of the server ID
|
|
31150
|
+
* @returns Promise resolving to server ID
|
|
31151
|
+
*/
|
|
31152
|
+
getUserServerIdsAt(userAddress: Address, serverIndex: bigint): Promise<bigint>;
|
|
31153
|
+
/**
|
|
31154
|
+
* Get the number of servers a user has
|
|
31155
|
+
*
|
|
31156
|
+
* @param userAddress - User address
|
|
31157
|
+
* @returns Promise resolving to number of servers
|
|
31158
|
+
*/
|
|
31159
|
+
getUserServerIdsLength(userAddress: Address): Promise<bigint>;
|
|
31160
|
+
/**
|
|
31161
|
+
* Get trusted server info for a specific user and server ID
|
|
31162
|
+
*
|
|
31163
|
+
* @param userAddress - User address
|
|
31164
|
+
* @param serverId - Server ID
|
|
31165
|
+
* @returns Promise resolving to trusted server info
|
|
31166
|
+
*/
|
|
31167
|
+
getUserServers(userAddress: Address, serverId: bigint): Promise<TrustedServerInfo>;
|
|
31168
|
+
/**
|
|
31169
|
+
* Get server info by server ID
|
|
31170
|
+
*
|
|
31171
|
+
* @param serverId - Server ID
|
|
31172
|
+
* @returns Promise resolving to server info
|
|
31173
|
+
*/
|
|
31174
|
+
getServers(serverId: bigint): Promise<ServerInfo>;
|
|
31175
|
+
/**
|
|
31176
|
+
* Get user info including nonce and trusted server IDs
|
|
31177
|
+
*
|
|
31178
|
+
* @param userAddress - User address
|
|
31179
|
+
* @returns Promise resolving to user info
|
|
31180
|
+
*/
|
|
31181
|
+
getUsers(userAddress: Address): Promise<{
|
|
31182
|
+
nonce: bigint;
|
|
31183
|
+
trustedServerIds: bigint[];
|
|
31184
|
+
}>;
|
|
31185
|
+
/**
|
|
31186
|
+
* Update server URL
|
|
31187
|
+
*
|
|
31188
|
+
* @param serverId - Server ID to update
|
|
31189
|
+
* @param url - New URL for the server
|
|
31190
|
+
* @returns Promise resolving to transaction hash
|
|
31191
|
+
*/
|
|
31192
|
+
submitUpdateServer(serverId: bigint, url: string): Promise<TransactionHandle<ServerUpdateResult>>;
|
|
31193
|
+
/**
|
|
31194
|
+
* Get all permission IDs for a user
|
|
31195
|
+
*
|
|
31196
|
+
* @param userAddress - User address to get permission IDs for
|
|
31197
|
+
* @returns Promise resolving to array of permission IDs
|
|
31198
|
+
*/
|
|
31199
|
+
getUserPermissionIdsValues(userAddress: Address): Promise<bigint[]>;
|
|
31200
|
+
/**
|
|
31201
|
+
* Get permission ID at specific index for a user
|
|
31202
|
+
*
|
|
31203
|
+
* @param userAddress - User address
|
|
31204
|
+
* @param permissionIndex - Index of the permission ID
|
|
31205
|
+
* @returns Promise resolving to permission ID
|
|
31206
|
+
*/
|
|
31207
|
+
getUserPermissionIdsAt(userAddress: Address, permissionIndex: bigint): Promise<bigint>;
|
|
31208
|
+
/**
|
|
31209
|
+
* Get the number of permissions a user has
|
|
31210
|
+
*
|
|
31211
|
+
* @param userAddress - User address
|
|
31212
|
+
* @returns Promise resolving to number of permissions
|
|
31213
|
+
*/
|
|
31214
|
+
getUserPermissionIdsLength(userAddress: Address): Promise<bigint>;
|
|
31215
|
+
/**
|
|
31216
|
+
* Get permission info by permission ID
|
|
31217
|
+
*
|
|
31218
|
+
* @param permissionId - Permission ID
|
|
31219
|
+
* @returns Promise resolving to permission info
|
|
31220
|
+
*/
|
|
31221
|
+
getPermissions(permissionId: bigint): Promise<PermissionInfo>;
|
|
31222
|
+
/**
|
|
31223
|
+
* Submit permission with signature to the blockchain (supports gasless transactions)
|
|
31224
|
+
*
|
|
31225
|
+
* @param params - Parameters for adding permission
|
|
31226
|
+
* @returns Promise resolving to transaction hash
|
|
31227
|
+
* @throws {RelayerError} When gasless transaction submission fails
|
|
31228
|
+
* @throws {SignatureError} When user rejects the signature request
|
|
31229
|
+
* @throws {BlockchainError} When permission addition fails
|
|
31230
|
+
* @throws {NetworkError} When network communication fails
|
|
31231
|
+
*/
|
|
31232
|
+
submitAddPermission(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
31233
|
+
/**
|
|
31234
|
+
* Submits an already-signed add permission transaction to the blockchain.
|
|
31235
|
+
* This method supports both relayer-based gasless transactions and direct transactions.
|
|
31236
|
+
*
|
|
31237
|
+
* @param typedData - The EIP-712 typed data for AddPermission
|
|
31238
|
+
* @param signature - The user's signature
|
|
31239
|
+
* @returns Promise resolving to TransactionHandle with PermissionGrantResult event data
|
|
31240
|
+
* @throws {RelayerError} When gasless transaction submission fails
|
|
31241
|
+
* @throws {BlockchainError} When permission addition fails
|
|
31242
|
+
* @throws {NetworkError} When network communication fails
|
|
31243
|
+
*/
|
|
31244
|
+
submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
31245
|
+
/**
|
|
31246
|
+
* Submits server files and permissions with signature to the blockchain, supporting schema validation and gasless transactions.
|
|
31247
|
+
*
|
|
31248
|
+
* @remarks
|
|
31249
|
+
* This method validates files against their specified schemas before submission.
|
|
31250
|
+
* Schema validation ensures data conforms to expected formats before on-chain registration.
|
|
31251
|
+
* Files with schemaId = 0 bypass validation. The method supports atomic batch operations
|
|
31252
|
+
* where all files and permissions are registered in a single transaction.
|
|
31253
|
+
*
|
|
31254
|
+
* @param params - Parameters for adding server files and permissions
|
|
31255
|
+
* @param params.granteeId - The ID of the permission grantee
|
|
31256
|
+
* @param params.grant - Grant URL containing permission parameters (typically IPFS)
|
|
31257
|
+
* @param params.fileUrls - Array of file URLs to register
|
|
31258
|
+
* @param params.schemaIds - Schema IDs for each file. Use 0 for files without schema validation.
|
|
31259
|
+
* Array length must match fileUrls length.
|
|
31260
|
+
* @param params.serverAddress - Server wallet address for decryption permissions
|
|
31261
|
+
* @param params.serverUrl - Server endpoint URL
|
|
31262
|
+
* @param params.serverPublicKey - Server's public key for encryption.
|
|
31263
|
+
* Obtain via `vana.server.getIdentity(userAddress).public_key`.
|
|
31264
|
+
* @param params.filePermissions - Nested array of permissions for each file
|
|
31265
|
+
* @returns TransactionHandle with immediate hash access and event parsing capability
|
|
31266
|
+
* @throws {Error} When schemaIds array length doesn't match fileUrls array length
|
|
31267
|
+
* @throws {SchemaValidationError} When file data doesn't match the specified schema.
|
|
31268
|
+
* Verify data structure matches schema definition from `vana.schemas.get(schemaId)`.
|
|
31269
|
+
* @throws {RelayerError} When gasless transaction submission fails.
|
|
31270
|
+
* Retry without relayer configuration to submit direct transaction.
|
|
31271
|
+
* @throws {SignatureError} When user rejects the signature request
|
|
31272
|
+
* @throws {BlockchainError} When server files and permissions addition fails
|
|
31273
|
+
* @throws {NetworkError} When network communication fails.
|
|
31274
|
+
* Check network connection or configure alternative gateways.
|
|
31275
|
+
*
|
|
31276
|
+
* @example
|
|
31277
|
+
* ```typescript
|
|
31278
|
+
* const result = await vana.permissions.submitAddServerFilesAndPermissions({
|
|
31279
|
+
* granteeId: BigInt(1),
|
|
31280
|
+
* grant: "ipfs://QmXxx...",
|
|
31281
|
+
* fileUrls: ["https://storage.example.com/data.json"],
|
|
31282
|
+
* schemaIds: [123], // LinkedIn profile schema ID
|
|
31283
|
+
* serverAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
|
|
31284
|
+
* serverUrl: "https://server.example.com",
|
|
31285
|
+
* serverPublicKey: serverInfo.public_key,
|
|
31286
|
+
* filePermissions: [[{
|
|
31287
|
+
* account: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
|
|
31288
|
+
* key: encryptedKey
|
|
31289
|
+
* }]]
|
|
31290
|
+
* });
|
|
31291
|
+
* const events = await result.waitForEvents();
|
|
31292
|
+
* console.log(`Permission ID: ${events.permissionId}`);
|
|
31293
|
+
* ```
|
|
31294
|
+
*/
|
|
31295
|
+
submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
31296
|
+
/**
|
|
31297
|
+
* Submits an already-signed add server files and permissions transaction to the blockchain.
|
|
31298
|
+
*
|
|
31299
|
+
* @remarks
|
|
31300
|
+
* This method returns a TransactionHandle that provides immediate access to the transaction hash
|
|
31301
|
+
* while allowing lazy-loaded access to parsed event data. Use `waitForEvents()` to retrieve
|
|
31302
|
+
* the permission ID and other event details after transaction confirmation.
|
|
31303
|
+
*
|
|
31304
|
+
* @param typedData - The EIP-712 typed data for AddServerFilesAndPermissions
|
|
31305
|
+
* @param signature - The user's signature
|
|
31306
|
+
* @returns TransactionHandle with immediate hash access and optional event parsing
|
|
31307
|
+
* @throws {RelayerError} When gasless transaction submission fails
|
|
31308
|
+
* @throws {BlockchainError} When server files and permissions addition fails
|
|
31309
|
+
* @throws {NetworkError} When network communication fails
|
|
31310
|
+
*
|
|
31311
|
+
* @example
|
|
31312
|
+
* ```typescript
|
|
31313
|
+
* const tx = await vana.permissions.submitSignedAddServerFilesAndPermissions(
|
|
31314
|
+
* typedData,
|
|
31315
|
+
* signature
|
|
31316
|
+
* );
|
|
31317
|
+
* console.log(`Transaction submitted: ${tx.hash}`);
|
|
31318
|
+
*
|
|
31319
|
+
* // Wait for confirmation and get the permission ID
|
|
31320
|
+
* const { permissionId } = await tx.waitForEvents();
|
|
31321
|
+
* console.log(`Permission created with ID: ${permissionId}`);
|
|
31322
|
+
* ```
|
|
31323
|
+
*/
|
|
31324
|
+
submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
31325
|
+
/**
|
|
31326
|
+
* Submit permission revocation with signature to the blockchain
|
|
31327
|
+
*
|
|
31328
|
+
* @param permissionId - Permission ID to revoke
|
|
31329
|
+
* @returns Promise resolving to transaction hash
|
|
31330
|
+
*/
|
|
31331
|
+
submitRevokePermission(permissionId: bigint): Promise<TransactionHandle<PermissionRevokeResult>>;
|
|
31332
|
+
/**
|
|
31333
|
+
* Submits a signed add permission transaction directly to the blockchain.
|
|
31334
|
+
*
|
|
31335
|
+
* @param typedData - The typed data structure for the permission addition
|
|
31336
|
+
* @param signature - The cryptographic signature authorizing the transaction
|
|
31337
|
+
* @returns Promise resolving to the transaction hash
|
|
31338
|
+
*/
|
|
31339
|
+
private submitDirectAddPermissionTransaction;
|
|
31340
|
+
/**
|
|
31341
|
+
* Submits a signed add server files and permissions transaction directly to the blockchain.
|
|
31342
|
+
*
|
|
31343
|
+
* @param typedData - The typed data structure for the server files and permissions addition
|
|
31344
|
+
* @param signature - The cryptographic signature authorizing the transaction
|
|
31345
|
+
* @returns Promise resolving to the transaction hash
|
|
31346
|
+
*/
|
|
31347
|
+
private submitDirectAddServerFilesAndPermissionsTransaction;
|
|
31295
31348
|
}
|
|
31296
31349
|
|
|
31297
31350
|
/**
|
|
@@ -31305,10 +31358,10 @@ declare class PermissionsController {
|
|
|
31305
31358
|
interface CreateSchemaParams {
|
|
31306
31359
|
/** The name of the schema */
|
|
31307
31360
|
name: string;
|
|
31308
|
-
/** The
|
|
31309
|
-
|
|
31361
|
+
/** The dialect of the schema (e.g., 'json' or 'sqlite') */
|
|
31362
|
+
dialect: "json" | "sqlite";
|
|
31310
31363
|
/** The schema definition object or JSON string */
|
|
31311
|
-
|
|
31364
|
+
schema: object | string;
|
|
31312
31365
|
}
|
|
31313
31366
|
/**
|
|
31314
31367
|
* Result of creating a new schema.
|
|
@@ -31353,8 +31406,8 @@ interface CreateSchemaResult {
|
|
|
31353
31406
|
* // Create a new schema with automatic IPFS upload
|
|
31354
31407
|
* const result = await vana.schemas.create({
|
|
31355
31408
|
* name: "User Profile",
|
|
31356
|
-
*
|
|
31357
|
-
*
|
|
31409
|
+
* dialect: "json",
|
|
31410
|
+
* schema: {
|
|
31358
31411
|
* type: "object",
|
|
31359
31412
|
* properties: {
|
|
31360
31413
|
* name: { type: "string" },
|
|
@@ -31389,7 +31442,7 @@ declare class SchemaController {
|
|
|
31389
31442
|
* - Uploads the definition to IPFS to generate a permanent URL
|
|
31390
31443
|
* - Registers the schema on the blockchain with the generated URL
|
|
31391
31444
|
*
|
|
31392
|
-
* @param params - Schema creation parameters including name,
|
|
31445
|
+
* @param params - Schema creation parameters including name, dialect, and definition
|
|
31393
31446
|
* @returns Promise resolving to creation results with schema ID and transaction hash
|
|
31394
31447
|
* @throws {SchemaValidationError} When the schema definition is invalid
|
|
31395
31448
|
* @throws {Error} When IPFS upload or blockchain registration fails
|
|
@@ -31398,8 +31451,8 @@ declare class SchemaController {
|
|
|
31398
31451
|
* // Create a JSON schema for user profiles
|
|
31399
31452
|
* const result = await vana.schemas.create({
|
|
31400
31453
|
* name: "User Profile",
|
|
31401
|
-
*
|
|
31402
|
-
*
|
|
31454
|
+
* dialect: "json",
|
|
31455
|
+
* schema: {
|
|
31403
31456
|
* type: "object",
|
|
31404
31457
|
* properties: {
|
|
31405
31458
|
* name: { type: "string" },
|
|
@@ -31414,42 +31467,66 @@ declare class SchemaController {
|
|
|
31414
31467
|
*/
|
|
31415
31468
|
create(params: CreateSchemaParams): Promise<CreateSchemaResult>;
|
|
31416
31469
|
/**
|
|
31417
|
-
* Retrieves a schema by its ID.
|
|
31470
|
+
* Retrieves a complete schema by its ID with definition fetched and flattened.
|
|
31418
31471
|
*
|
|
31419
31472
|
* @param schemaId - The ID of the schema to retrieve
|
|
31420
|
-
* @
|
|
31421
|
-
* @
|
|
31473
|
+
* @param options - Optional parameters
|
|
31474
|
+
* @param options.subgraphUrl - Custom subgraph URL to use instead of default
|
|
31475
|
+
* @returns Promise resolving to the complete schema object with all fields populated
|
|
31476
|
+
* @throws {Error} When the schema is not found, definition cannot be fetched, or chain is unavailable
|
|
31422
31477
|
* @example
|
|
31423
31478
|
* ```typescript
|
|
31424
31479
|
* const schema = await vana.schemas.get(1);
|
|
31425
|
-
* console.log(`Schema: ${schema.name} (${schema.
|
|
31480
|
+
* console.log(`Schema: ${schema.name} (${schema.dialect})`);
|
|
31481
|
+
* console.log(`Version: ${schema.version}`);
|
|
31482
|
+
* console.log(`Description: ${schema.description}`);
|
|
31483
|
+
* console.log('Schema:', schema.schema);
|
|
31484
|
+
*
|
|
31485
|
+
* // Use directly with validator (schema has all required fields)
|
|
31486
|
+
* validator.validateDataAgainstSchema(data, schema);
|
|
31426
31487
|
* ```
|
|
31427
31488
|
*/
|
|
31428
|
-
get(schemaId: number
|
|
31489
|
+
get(schemaId: number, options?: {
|
|
31490
|
+
subgraphUrl?: string;
|
|
31491
|
+
}): Promise<CompleteSchema>;
|
|
31429
31492
|
/**
|
|
31430
31493
|
* Gets the total number of schemas registered on the network.
|
|
31431
31494
|
*
|
|
31495
|
+
* @param options - Optional parameters
|
|
31496
|
+
* @param options.subgraphUrl - Custom subgraph URL to use instead of default
|
|
31432
31497
|
* @returns Promise resolving to the total schema count
|
|
31433
31498
|
* @throws {Error} When the count cannot be retrieved
|
|
31434
31499
|
* @example
|
|
31435
31500
|
* ```typescript
|
|
31436
31501
|
* const count = await vana.schemas.count();
|
|
31437
31502
|
* console.log(`Total schemas: ${count}`);
|
|
31503
|
+
*
|
|
31504
|
+
* // With custom subgraph
|
|
31505
|
+
* const count = await vana.schemas.count({
|
|
31506
|
+
* subgraphUrl: 'https://custom-subgraph.com/graphql'
|
|
31507
|
+
* });
|
|
31438
31508
|
* ```
|
|
31439
31509
|
*/
|
|
31440
|
-
count(
|
|
31510
|
+
count(options?: {
|
|
31511
|
+
subgraphUrl?: string;
|
|
31512
|
+
}): Promise<number>;
|
|
31441
31513
|
/**
|
|
31442
31514
|
* Lists all schemas with pagination.
|
|
31443
31515
|
*
|
|
31444
31516
|
* @param options - Optional parameters for listing schemas
|
|
31445
31517
|
* @param options.limit - Maximum number of schemas to return
|
|
31446
31518
|
* @param options.offset - Number of schemas to skip
|
|
31519
|
+
* @param options.subgraphUrl - Custom subgraph URL to use instead of default
|
|
31520
|
+
* @param options.includeDefinitions - Whether to fetch and include schema definitions (default: false for performance)
|
|
31447
31521
|
* @returns Promise resolving to an array of schemas
|
|
31448
31522
|
* @example
|
|
31449
31523
|
* ```typescript
|
|
31450
|
-
* // Get all schemas
|
|
31524
|
+
* // Get all schemas (without definitions for performance)
|
|
31451
31525
|
* const schemas = await vana.schemas.list();
|
|
31452
31526
|
*
|
|
31527
|
+
* // Get schemas with definitions
|
|
31528
|
+
* const schemas = await vana.schemas.list({ includeDefinitions: true });
|
|
31529
|
+
*
|
|
31453
31530
|
* // Get schemas with pagination
|
|
31454
31531
|
* const schemas = await vana.schemas.list({ limit: 10, offset: 0 });
|
|
31455
31532
|
* ```
|
|
@@ -31457,6 +31534,8 @@ declare class SchemaController {
|
|
|
31457
31534
|
list(options?: {
|
|
31458
31535
|
limit?: number;
|
|
31459
31536
|
offset?: number;
|
|
31537
|
+
subgraphUrl?: string;
|
|
31538
|
+
includeDefinitions?: boolean;
|
|
31460
31539
|
}): Promise<Schema[]>;
|
|
31461
31540
|
/**
|
|
31462
31541
|
* Adds a schema using the legacy method (low-level API).
|
|
@@ -31466,6 +31545,36 @@ declare class SchemaController {
|
|
|
31466
31545
|
* @returns Promise resolving to the add schema result
|
|
31467
31546
|
*/
|
|
31468
31547
|
addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
|
|
31548
|
+
/**
|
|
31549
|
+
* Internal method: Query schema via subgraph
|
|
31550
|
+
*
|
|
31551
|
+
* @param params - Query parameters
|
|
31552
|
+
* @param params.schemaId - The ID of the schema to retrieve
|
|
31553
|
+
* @param params.subgraphUrl - The subgraph URL to query
|
|
31554
|
+
* @returns Promise resolving to the schema object
|
|
31555
|
+
* @private
|
|
31556
|
+
*/
|
|
31557
|
+
private _getSchemaViaSubgraph;
|
|
31558
|
+
/**
|
|
31559
|
+
* Internal method: List schemas via subgraph
|
|
31560
|
+
*
|
|
31561
|
+
* @param params - Query parameters
|
|
31562
|
+
* @param params.limit - Maximum number of schemas to return
|
|
31563
|
+
* @param params.offset - Number of schemas to skip
|
|
31564
|
+
* @param params.subgraphUrl - The subgraph URL to query
|
|
31565
|
+
* @returns Promise resolving to an array of schemas
|
|
31566
|
+
* @private
|
|
31567
|
+
*/
|
|
31568
|
+
private _listSchemasViaSubgraph;
|
|
31569
|
+
/**
|
|
31570
|
+
* Internal method: Count schemas via subgraph
|
|
31571
|
+
*
|
|
31572
|
+
* @param params - Query parameters
|
|
31573
|
+
* @param params.subgraphUrl - The subgraph URL to query
|
|
31574
|
+
* @returns Promise resolving to the total schema count
|
|
31575
|
+
* @private
|
|
31576
|
+
*/
|
|
31577
|
+
private _countSchemasViaSubgraph;
|
|
31469
31578
|
/**
|
|
31470
31579
|
* Gets the user's wallet address.
|
|
31471
31580
|
*
|
|
@@ -31473,6 +31582,13 @@ declare class SchemaController {
|
|
|
31473
31582
|
* @returns Promise resolving to the user's address
|
|
31474
31583
|
*/
|
|
31475
31584
|
private getUserAddress;
|
|
31585
|
+
/**
|
|
31586
|
+
* Fetches and attaches definitions to an array of schemas.
|
|
31587
|
+
*
|
|
31588
|
+
* @param schemas - Array of schemas to fetch definitions for
|
|
31589
|
+
* @private
|
|
31590
|
+
*/
|
|
31591
|
+
private _fetchDefinitionsForSchemas;
|
|
31476
31592
|
}
|
|
31477
31593
|
|
|
31478
31594
|
/**
|
|
@@ -31547,34 +31663,30 @@ declare class SchemaValidator {
|
|
|
31547
31663
|
*/
|
|
31548
31664
|
validateDataSchema(schema: unknown): asserts schema is DataSchema;
|
|
31549
31665
|
/**
|
|
31550
|
-
* Validates data against a JSON Schema from a
|
|
31666
|
+
* Validates data against a JSON Schema from a schema
|
|
31551
31667
|
*
|
|
31552
31668
|
* @param data - The data to validate
|
|
31553
|
-
* @param schema - The
|
|
31669
|
+
* @param schema - The schema containing the validation rules (DataSchema or Schema)
|
|
31554
31670
|
* @throws SchemaValidationError if invalid
|
|
31555
31671
|
* @example
|
|
31556
31672
|
* ```typescript
|
|
31557
31673
|
* const validator = new SchemaValidator();
|
|
31558
31674
|
*
|
|
31559
|
-
*
|
|
31675
|
+
* // Works with Schema from schemas.get()
|
|
31676
|
+
* const schema = await vana.schemas.get(1);
|
|
31677
|
+
* validator.validateDataAgainstSchema(userData, schema);
|
|
31678
|
+
*
|
|
31679
|
+
* // Also works with DataSchema object
|
|
31680
|
+
* const dataSchema: DataSchema = {
|
|
31560
31681
|
* name: "User Profile",
|
|
31561
31682
|
* version: "1.0.0",
|
|
31562
31683
|
* dialect: "json",
|
|
31563
|
-
* schema: {
|
|
31564
|
-
* type: "object",
|
|
31565
|
-
* properties: {
|
|
31566
|
-
* name: { type: "string" },
|
|
31567
|
-
* age: { type: "number" }
|
|
31568
|
-
* },
|
|
31569
|
-
* required: ["name"]
|
|
31570
|
-
* }
|
|
31684
|
+
* schema: { type: "object", properties: { name: { type: "string" } } }
|
|
31571
31685
|
* };
|
|
31572
|
-
*
|
|
31573
|
-
* const userData = { name: "Alice", age: 30 };
|
|
31574
|
-
* validator.validateDataAgainstSchema(userData, schema);
|
|
31686
|
+
* validator.validateDataAgainstSchema(userData, dataSchema);
|
|
31575
31687
|
* ```
|
|
31576
31688
|
*/
|
|
31577
|
-
validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
|
|
31689
|
+
validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
|
|
31578
31690
|
/**
|
|
31579
31691
|
* Validates a SQLite DDL string for basic syntax
|
|
31580
31692
|
* Note: This is a basic validation, full SQL parsing would require a proper SQL parser
|
|
@@ -31618,7 +31730,7 @@ declare function validateDataSchema(schema: unknown): asserts schema is DataSche
|
|
|
31618
31730
|
* @returns void - Function doesn't return a value
|
|
31619
31731
|
* @throws SchemaValidationError if invalid
|
|
31620
31732
|
*/
|
|
31621
|
-
declare function validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
|
|
31733
|
+
declare function validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
|
|
31622
31734
|
/**
|
|
31623
31735
|
* Convenience function to fetch and validate a schema from a URL
|
|
31624
31736
|
*
|
|
@@ -34114,19 +34226,18 @@ declare class DataController {
|
|
|
34114
34226
|
subgraphUrl?: string;
|
|
34115
34227
|
}): Promise<UserFile$1[]>;
|
|
34116
34228
|
/**
|
|
34117
|
-
* Retrieves a list of permissions granted by a user
|
|
34229
|
+
* Retrieves a list of permissions granted by a user.
|
|
34118
34230
|
*
|
|
34119
|
-
* This method
|
|
34120
|
-
*
|
|
34121
|
-
*
|
|
34122
|
-
*
|
|
34123
|
-
* 3. No need for additional contract calls as all data comes from subgraph
|
|
34231
|
+
* This method supports automatic fallback between subgraph and RPC modes:
|
|
34232
|
+
* - If subgraph URL is available, tries subgraph query first
|
|
34233
|
+
* - Falls back to direct contract queries via RPC if subgraph fails
|
|
34234
|
+
* - RPC mode uses gasAwareMulticall for efficient batch queries
|
|
34124
34235
|
*
|
|
34125
34236
|
* @param params - Object containing the user address and optional subgraph URL
|
|
34126
34237
|
* @param params.user - The wallet address of the user to query permissions for
|
|
34127
34238
|
* @param params.subgraphUrl - Optional subgraph URL to override the default
|
|
34128
34239
|
* @returns Promise resolving to an array of permission objects
|
|
34129
|
-
* @throws Error if subgraph
|
|
34240
|
+
* @throws Error if both subgraph and RPC queries fail
|
|
34130
34241
|
*/
|
|
34131
34242
|
getUserPermissions(params: {
|
|
34132
34243
|
user: Address;
|
|
@@ -34142,43 +34253,59 @@ declare class DataController {
|
|
|
34142
34253
|
user: Address;
|
|
34143
34254
|
}>>;
|
|
34144
34255
|
/**
|
|
34145
|
-
*
|
|
34256
|
+
* Internal method: Query user permissions via subgraph
|
|
34146
34257
|
*
|
|
34147
|
-
*
|
|
34148
|
-
*
|
|
34258
|
+
* @param params - Query parameters object
|
|
34259
|
+
* @param params.user - The user address to query permissions for
|
|
34260
|
+
* @param params.subgraphUrl - The subgraph URL endpoint to query
|
|
34261
|
+
* @returns Promise resolving to an array of permission objects
|
|
34262
|
+
*/
|
|
34263
|
+
private _getUserPermissionsViaSubgraph;
|
|
34264
|
+
/**
|
|
34265
|
+
* Internal method: Query user permissions via direct RPC
|
|
34149
34266
|
*
|
|
34150
|
-
*
|
|
34151
|
-
* -
|
|
34152
|
-
*
|
|
34153
|
-
|
|
34267
|
+
* @param params - Query parameters object
|
|
34268
|
+
* @param params.user - The user address to query permissions for
|
|
34269
|
+
* @returns Promise resolving to an array of permission objects
|
|
34270
|
+
*/
|
|
34271
|
+
private _getUserPermissionsViaRpc;
|
|
34272
|
+
/**
|
|
34273
|
+
* Retrieves a list of trusted servers for a user.
|
|
34274
|
+
*
|
|
34275
|
+
* This method supports automatic fallback between subgraph and RPC modes:
|
|
34276
|
+
* - If subgraph URL is available, tries subgraph query first for fast results
|
|
34277
|
+
* - Falls back to direct contract queries via RPC if subgraph fails
|
|
34278
|
+
* - RPC mode uses gasAwareMulticall for efficient batch queries
|
|
34154
34279
|
*
|
|
34155
|
-
* @param params - Query parameters including user address and
|
|
34156
|
-
* @
|
|
34157
|
-
* @
|
|
34280
|
+
* @param params - Query parameters including user address and optional pagination
|
|
34281
|
+
* @param params.user - The wallet address of the user to query trusted servers for
|
|
34282
|
+
* @param params.subgraphUrl - Optional subgraph URL to override the default
|
|
34283
|
+
* @param params.limit - Maximum number of results to return (default: 50)
|
|
34284
|
+
* @param params.offset - Number of results to skip for pagination (default: 0)
|
|
34285
|
+
* @returns Promise resolving to an array of trusted server objects
|
|
34286
|
+
* @throws Error if both subgraph and RPC queries fail
|
|
34158
34287
|
* @example
|
|
34159
34288
|
* ```typescript
|
|
34160
|
-
* //
|
|
34161
|
-
* const
|
|
34162
|
-
* user: '0x...'
|
|
34163
|
-
* mode: 'subgraph',
|
|
34164
|
-
* subgraphUrl: 'https://...'
|
|
34289
|
+
* // Basic usage with automatic fallback
|
|
34290
|
+
* const servers = await vana.data.getUserTrustedServers({
|
|
34291
|
+
* user: '0x...'
|
|
34165
34292
|
* });
|
|
34166
34293
|
*
|
|
34167
|
-
* //
|
|
34168
|
-
* const
|
|
34294
|
+
* // With pagination
|
|
34295
|
+
* const servers = await vana.data.getUserTrustedServers({
|
|
34169
34296
|
* user: '0x...',
|
|
34170
|
-
*
|
|
34171
|
-
*
|
|
34297
|
+
* limit: 10,
|
|
34298
|
+
* offset: 20
|
|
34172
34299
|
* });
|
|
34173
34300
|
*
|
|
34174
|
-
* //
|
|
34175
|
-
* const
|
|
34301
|
+
* // With custom subgraph URL
|
|
34302
|
+
* const servers = await vana.data.getUserTrustedServers({
|
|
34176
34303
|
* user: '0x...',
|
|
34177
|
-
*
|
|
34304
|
+
* subgraphUrl: 'https://custom-subgraph.com/graphql'
|
|
34178
34305
|
* });
|
|
34179
34306
|
* ```
|
|
34180
34307
|
*/
|
|
34181
|
-
getUserTrustedServers(params: GetUserTrustedServersParams): Promise<
|
|
34308
|
+
getUserTrustedServers(params: GetUserTrustedServersParams): Promise<TrustedServer[]>;
|
|
34182
34309
|
/**
|
|
34183
34310
|
* Internal method: Query trusted servers via subgraph
|
|
34184
34311
|
*
|
|
@@ -34243,75 +34370,28 @@ declare class DataController {
|
|
|
34243
34370
|
* for specific files by ID.
|
|
34244
34371
|
*/
|
|
34245
34372
|
getFileById(fileId: number): Promise<UserFile$1>;
|
|
34246
|
-
/**
|
|
34247
|
-
* Uploads an encrypted file to storage and registers it on the blockchain.
|
|
34248
|
-
*
|
|
34249
|
-
* @deprecated Since v2.0.0 - Use vana.data.upload() instead for the high-level API with automatic encryption
|
|
34250
|
-
*
|
|
34251
|
-
* Migration guide:
|
|
34252
|
-
* ```typescript
|
|
34253
|
-
* // Old way (deprecated):
|
|
34254
|
-
* const encrypted = await encryptBlob(data, key);
|
|
34255
|
-
* const result = await vana.data.uploadEncryptedFile(encrypted, filename);
|
|
34256
|
-
*
|
|
34257
|
-
* // New way:
|
|
34258
|
-
* const result = await vana.data.upload({
|
|
34259
|
-
* content: data,
|
|
34260
|
-
* filename: filename,
|
|
34261
|
-
* encrypt: true // Handles encryption automatically
|
|
34262
|
-
* });
|
|
34263
|
-
* ```
|
|
34264
|
-
* @param encryptedFile - The encrypted file blob to upload
|
|
34265
|
-
* @param filename - Optional filename for the upload
|
|
34266
|
-
* @param providerName - Optional storage provider to use
|
|
34267
|
-
* @returns Promise resolving to upload result with file ID and storage URL
|
|
34268
|
-
*
|
|
34269
|
-
* This method handles the complete flow of:
|
|
34270
|
-
* 1. Uploading the encrypted file to the specified storage provider
|
|
34271
|
-
* 2. Registering the file URL on the DataRegistry contract via relayer
|
|
34272
|
-
* 3. Returning the assigned file ID and storage URL
|
|
34273
|
-
*/
|
|
34274
|
-
uploadEncryptedFile(encryptedFile: Blob, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
|
|
34275
|
-
/**
|
|
34276
|
-
* Uploads an encrypted file to storage and registers it on the blockchain with a schema.
|
|
34277
|
-
*
|
|
34278
|
-
* @deprecated Since v2.0.0 - Use vana.data.upload() instead for the high-level API with automatic encryption and schema validation
|
|
34279
|
-
*
|
|
34280
|
-
* Migration guide:
|
|
34281
|
-
* ```typescript
|
|
34282
|
-
* // Old way (deprecated):
|
|
34283
|
-
* const encrypted = await encryptBlob(data, key);
|
|
34284
|
-
* const result = await vana.data.uploadEncryptedFileWithSchema(encrypted, schemaId, filename);
|
|
34285
|
-
*
|
|
34286
|
-
* // New way:
|
|
34287
|
-
* const result = await vana.data.upload({
|
|
34288
|
-
* content: data,
|
|
34289
|
-
* filename: filename,
|
|
34290
|
-
* schemaId: schemaId, // Automatic validation
|
|
34291
|
-
* encrypt: true
|
|
34292
|
-
* });
|
|
34293
|
-
* ```
|
|
34294
|
-
* @param encryptedFile - The encrypted file blob to upload
|
|
34295
|
-
* @param schemaId - The schema ID to associate with the file
|
|
34296
|
-
* @param filename - Optional filename for the upload
|
|
34297
|
-
* @param providerName - Optional storage provider to use
|
|
34298
|
-
* @returns Promise resolving to upload result with file ID and storage URL
|
|
34299
|
-
*
|
|
34300
|
-
* This method handles the complete flow of:
|
|
34301
|
-
* 1. Uploading the encrypted file to the specified storage provider
|
|
34302
|
-
* 2. Registering the file URL on the DataRegistry contract with a schema ID
|
|
34303
|
-
* 3. Returning the assigned file ID and storage URL
|
|
34304
|
-
*/
|
|
34305
|
-
uploadEncryptedFileWithSchema(encryptedFile: Blob, schemaId: number, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
|
|
34306
34373
|
/**
|
|
34307
34374
|
* Registers a file URL directly on the blockchain with a schema ID.
|
|
34308
34375
|
*
|
|
34309
|
-
* @
|
|
34376
|
+
* @remarks
|
|
34377
|
+
* This method registers an existing file URL on the DataRegistry contract
|
|
34378
|
+
* with a schema ID, without uploading any data. Useful when you have already
|
|
34379
|
+
* uploaded content to storage and just need to register it on-chain.
|
|
34380
|
+
*
|
|
34381
|
+
* @param url - The URL of the file to register (IPFS or HTTP/HTTPS)
|
|
34310
34382
|
* @param schemaId - The schema ID to associate with the file
|
|
34311
34383
|
* @returns Promise resolving to the file ID and transaction hash
|
|
34312
|
-
*
|
|
34313
|
-
*
|
|
34314
|
-
*
|
|
34384
|
+
* @throws {Error} When chain ID is not available - "Chain ID not available"
|
|
34385
|
+
* @throws {Error} When wallet address is unavailable - "No addresses available"
|
|
34386
|
+
* @throws {Error} When transaction fails - "Failed to register file with schema"
|
|
34387
|
+
* @example
|
|
34388
|
+
* ```typescript
|
|
34389
|
+
* const { fileId, transactionHash } = await vana.data.registerFileWithSchema(
|
|
34390
|
+
* "ipfs://QmXxx...",
|
|
34391
|
+
* 1
|
|
34392
|
+
* );
|
|
34393
|
+
* console.log(`File ${fileId} registered with schema in tx ${transactionHash}`);
|
|
34394
|
+
* ```
|
|
34315
34395
|
*/
|
|
34316
34396
|
registerFileWithSchema(url: string, schemaId: number): Promise<{
|
|
34317
34397
|
fileId: number;
|
|
@@ -34369,95 +34449,114 @@ declare class DataController {
|
|
|
34369
34449
|
transactionHash: string;
|
|
34370
34450
|
}>;
|
|
34371
34451
|
/**
|
|
34372
|
-
* Adds a new
|
|
34373
|
-
*
|
|
34374
|
-
* @deprecated Since v2.0.0 - Use vana.schemas.create() instead for the high-level API with automatic IPFS upload
|
|
34452
|
+
* Adds a new refiner to the DataRefinerRegistry.
|
|
34375
34453
|
*
|
|
34376
|
-
*
|
|
34454
|
+
* @remarks
|
|
34455
|
+
* Refiners are data processing templates that define how raw data should be
|
|
34456
|
+
* transformed into structured formats. Each refiner is associated with a DLP
|
|
34457
|
+
* (Data Liquidity Pool), has a specific schema for output, and includes
|
|
34458
|
+
* instructions for the refinement process.
|
|
34459
|
+
*
|
|
34460
|
+
* @param params - Refiner configuration parameters
|
|
34461
|
+
* @param params.dlpId - The Data Liquidity Pool ID this refiner belongs to
|
|
34462
|
+
* @param params.name - Human-readable name for the refiner
|
|
34463
|
+
* @param params.schemaId - Schema ID that defines the output format
|
|
34464
|
+
* @param params.refinementInstructionUrl - URL containing processing instructions
|
|
34465
|
+
* @returns Promise resolving to the new refiner ID and transaction hash
|
|
34466
|
+
* @throws {Error} When chain ID is not available - "Chain ID not available"
|
|
34467
|
+
* @throws {Error} When transaction fails - "Failed to add refiner: {error}"
|
|
34468
|
+
* @example
|
|
34377
34469
|
* ```typescript
|
|
34378
|
-
*
|
|
34379
|
-
*
|
|
34380
|
-
* name: "
|
|
34381
|
-
*
|
|
34382
|
-
*
|
|
34383
|
-
* });
|
|
34384
|
-
*
|
|
34385
|
-
* // New way:
|
|
34386
|
-
* const result = await vana.schemas.create({
|
|
34387
|
-
* name: "UserProfile",
|
|
34388
|
-
* type: "JSON",
|
|
34389
|
-
* definition: schemaObject // Automatically uploads to IPFS
|
|
34470
|
+
* const result = await vana.data.addRefiner({
|
|
34471
|
+
* dlpId: 1,
|
|
34472
|
+
* name: "Social Media Sentiment Analyzer",
|
|
34473
|
+
* schemaId: 42,
|
|
34474
|
+
* refinementInstructionUrl: "ipfs://QmXxx..."
|
|
34390
34475
|
* });
|
|
34476
|
+
* console.log(`Created refiner ${result.refinerId} in tx ${result.transactionHash}`);
|
|
34391
34477
|
* ```
|
|
34392
|
-
* @param params - Schema parameters including name, type, and definition URL
|
|
34393
|
-
* @returns Promise resolving to the new schema ID and transaction hash
|
|
34394
34478
|
*/
|
|
34395
|
-
|
|
34479
|
+
addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
|
|
34396
34480
|
/**
|
|
34397
|
-
* Retrieves a
|
|
34481
|
+
* Retrieves a refiner by its ID.
|
|
34398
34482
|
*
|
|
34399
|
-
* @
|
|
34483
|
+
* @remarks
|
|
34484
|
+
* Queries the DataRefinerRegistry contract to get complete information about
|
|
34485
|
+
* a specific refiner including its DLP association, schema, and instructions.
|
|
34400
34486
|
*
|
|
34401
|
-
*
|
|
34487
|
+
* @param refinerId - The numeric refiner ID to retrieve
|
|
34488
|
+
* @returns Promise resolving to the refiner information object
|
|
34489
|
+
* @throws {Error} When chain ID is not available - "Chain ID not available"
|
|
34490
|
+
* @throws {Error} When refiner doesn't exist - "Refiner with ID {refinerId} does not exist"
|
|
34491
|
+
* @throws {Error} When contract read fails - "Failed to fetch refiner: {error}"
|
|
34492
|
+
* @example
|
|
34402
34493
|
* ```typescript
|
|
34403
|
-
*
|
|
34404
|
-
*
|
|
34405
|
-
*
|
|
34406
|
-
*
|
|
34407
|
-
*
|
|
34494
|
+
* const refiner = await vana.data.getRefiner(1);
|
|
34495
|
+
* console.log({
|
|
34496
|
+
* name: refiner.name,
|
|
34497
|
+
* dlp: refiner.dlpId,
|
|
34498
|
+
* schema: refiner.schemaId,
|
|
34499
|
+
* instructions: refiner.refinementInstructionUrl
|
|
34500
|
+
* });
|
|
34408
34501
|
* ```
|
|
34409
|
-
* @param schemaId - The schema ID to retrieve
|
|
34410
|
-
* @returns Promise resolving to the schema information
|
|
34411
34502
|
*/
|
|
34412
|
-
|
|
34503
|
+
getRefiner(refinerId: number): Promise<Refiner>;
|
|
34413
34504
|
/**
|
|
34414
|
-
*
|
|
34505
|
+
* Validates if a schema ID exists in the registry.
|
|
34415
34506
|
*
|
|
34416
|
-
* @
|
|
34507
|
+
* @remarks
|
|
34508
|
+
* Checks the DataRefinerRegistry contract to determine if a given schema ID
|
|
34509
|
+
* has been registered and is available for use.
|
|
34417
34510
|
*
|
|
34418
|
-
*
|
|
34511
|
+
* @param schemaId - The numeric schema ID to validate
|
|
34512
|
+
* @returns Promise resolving to true if schema exists, false otherwise
|
|
34513
|
+
* @example
|
|
34419
34514
|
* ```typescript
|
|
34420
|
-
*
|
|
34421
|
-
*
|
|
34422
|
-
*
|
|
34423
|
-
*
|
|
34424
|
-
*
|
|
34515
|
+
* const isValid = await vana.data.isValidSchemaId(42);
|
|
34516
|
+
* if (isValid) {
|
|
34517
|
+
* console.log('Schema 42 is available for use');
|
|
34518
|
+
* } else {
|
|
34519
|
+
* console.log('Schema 42 does not exist');
|
|
34520
|
+
* }
|
|
34425
34521
|
* ```
|
|
34426
|
-
* @returns Promise resolving to the total schema count
|
|
34427
|
-
*/
|
|
34428
|
-
getSchemasCount(): Promise<number>;
|
|
34429
|
-
/**
|
|
34430
|
-
* Adds a new refiner to the DataRefinerRegistry.
|
|
34431
|
-
*
|
|
34432
|
-
* @param params - Refiner parameters including DLP ID, name, schema ID, and instruction URL
|
|
34433
|
-
* @returns Promise resolving to the new refiner ID and transaction hash
|
|
34434
|
-
*/
|
|
34435
|
-
addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
|
|
34436
|
-
/**
|
|
34437
|
-
* Retrieves a refiner by its ID.
|
|
34438
|
-
*
|
|
34439
|
-
* @param refinerId - The refiner ID to retrieve
|
|
34440
|
-
* @returns Promise resolving to the refiner information
|
|
34441
|
-
*/
|
|
34442
|
-
getRefiner(refinerId: number): Promise<Refiner>;
|
|
34443
|
-
/**
|
|
34444
|
-
* Validates if a schema ID exists in the registry.
|
|
34445
|
-
*
|
|
34446
|
-
* @param schemaId - The schema ID to validate
|
|
34447
|
-
* @returns Promise resolving to boolean indicating if the schema ID is valid
|
|
34448
34522
|
*/
|
|
34449
34523
|
isValidSchemaId(schemaId: number): Promise<boolean>;
|
|
34450
34524
|
/**
|
|
34451
34525
|
* Gets the total number of refiners in the registry.
|
|
34452
34526
|
*
|
|
34527
|
+
* @remarks
|
|
34528
|
+
* Queries the DataRefinerRegistry contract to get the total count of all
|
|
34529
|
+
* registered refiners across all DLPs.
|
|
34530
|
+
*
|
|
34453
34531
|
* @returns Promise resolving to the total refiner count
|
|
34532
|
+
* @example
|
|
34533
|
+
* ```typescript
|
|
34534
|
+
* const count = await vana.data.getRefinersCount();
|
|
34535
|
+
* console.log(`Total refiners registered: ${count}`);
|
|
34536
|
+
* ```
|
|
34454
34537
|
*/
|
|
34455
34538
|
getRefinersCount(): Promise<number>;
|
|
34456
34539
|
/**
|
|
34457
34540
|
* Updates the schema ID for an existing refiner.
|
|
34458
34541
|
*
|
|
34459
|
-
* @
|
|
34542
|
+
* @remarks
|
|
34543
|
+
* Allows the owner of a refiner to update its associated schema ID.
|
|
34544
|
+
* This is useful when refiner output format needs to change.
|
|
34545
|
+
*
|
|
34546
|
+
* @param params - Update parameters
|
|
34547
|
+
* @param params.refinerId - The refiner ID to update
|
|
34548
|
+
* @param params.newSchemaId - The new schema ID to set
|
|
34460
34549
|
* @returns Promise resolving to the transaction hash
|
|
34550
|
+
* @throws {Error} When chain ID is not available - "Chain ID not available"
|
|
34551
|
+
* @throws {Error} When transaction fails - "Failed to update schema ID: {error}"
|
|
34552
|
+
* @example
|
|
34553
|
+
* ```typescript
|
|
34554
|
+
* const result = await vana.data.updateSchemaId({
|
|
34555
|
+
* refinerId: 1,
|
|
34556
|
+
* newSchemaId: 55
|
|
34557
|
+
* });
|
|
34558
|
+
* console.log(`Schema updated in tx ${result.transactionHash}`);
|
|
34559
|
+
* ```
|
|
34461
34560
|
*/
|
|
34462
34561
|
updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
|
|
34463
34562
|
/**
|
|
@@ -34479,6 +34578,17 @@ declare class DataController {
|
|
|
34479
34578
|
account: Address;
|
|
34480
34579
|
publicKey: string;
|
|
34481
34580
|
}>, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
|
|
34581
|
+
/**
|
|
34582
|
+
* Uploads content to storage without registering it on the blockchain.
|
|
34583
|
+
* This method only handles the storage upload and returns the file URL.
|
|
34584
|
+
*
|
|
34585
|
+
* @param content - The content to upload (string, Blob, Buffer, or object - objects will be JSON stringified)
|
|
34586
|
+
* @param filename - Optional filename for the uploaded file (defaults to timestamp-based name)
|
|
34587
|
+
* @param encrypt - Optional flag to encrypt the content before upload
|
|
34588
|
+
* @param providerName - Optional specific storage provider to use
|
|
34589
|
+
* @returns Promise resolving to the storage upload result with url, size, and contentType
|
|
34590
|
+
*/
|
|
34591
|
+
uploadToStorage(content: string | Blob | Buffer | object, filename?: string, encrypt?: boolean, providerName?: string): Promise<StorageUploadResult>;
|
|
34482
34592
|
/**
|
|
34483
34593
|
* Adds a permission for a party to access an existing file.
|
|
34484
34594
|
*
|
|
@@ -34505,7 +34615,7 @@ declare class DataController {
|
|
|
34505
34615
|
* console.log(`Transaction: ${result.transactionHash}`);
|
|
34506
34616
|
* ```
|
|
34507
34617
|
*/
|
|
34508
|
-
addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<FilePermissionResult
|
|
34618
|
+
addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
|
|
34509
34619
|
/**
|
|
34510
34620
|
* Submits a file permission transaction and returns the transaction hash immediately.
|
|
34511
34621
|
*
|
|
@@ -34522,7 +34632,7 @@ declare class DataController {
|
|
|
34522
34632
|
* console.log(`Transaction submitted: ${txHash}`);
|
|
34523
34633
|
* ```
|
|
34524
34634
|
*/
|
|
34525
|
-
submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<
|
|
34635
|
+
submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
|
|
34526
34636
|
/**
|
|
34527
34637
|
* Gets the encrypted key for a specific account's permission to access a file.
|
|
34528
34638
|
*
|
|
@@ -34689,24 +34799,6 @@ declare class DataController {
|
|
|
34689
34799
|
* ```
|
|
34690
34800
|
*/
|
|
34691
34801
|
fetchAndValidateSchema(url: string): Promise<DataSchema>;
|
|
34692
|
-
/**
|
|
34693
|
-
* Retrieves a schema by ID and fetches its definition URL to get the full data schema.
|
|
34694
|
-
*
|
|
34695
|
-
* @param schemaId - The schema ID to retrieve and validate
|
|
34696
|
-
* @returns The validated data schema
|
|
34697
|
-
* @throws SchemaValidationError if schema is invalid
|
|
34698
|
-
* @example
|
|
34699
|
-
* ```typescript
|
|
34700
|
-
* // Get schema from registry and validate its schema
|
|
34701
|
-
* const schema = await vana.data.getValidatedSchema(123);
|
|
34702
|
-
*
|
|
34703
|
-
* // Use it to validate user data
|
|
34704
|
-
* if (schema.dialect === "json") {
|
|
34705
|
-
* vana.data.validateDataAgainstSchema(userData, schema);
|
|
34706
|
-
* }
|
|
34707
|
-
* ```
|
|
34708
|
-
*/
|
|
34709
|
-
getValidatedSchema(schemaId: number): Promise<DataSchema>;
|
|
34710
34802
|
}
|
|
34711
34803
|
|
|
34712
34804
|
/**
|
|
@@ -34909,6 +35001,31 @@ interface Chains {
|
|
|
34909
35001
|
}
|
|
34910
35002
|
declare const chains: Chains;
|
|
34911
35003
|
|
|
35004
|
+
/**
|
|
35005
|
+
* Creates or retrieves a cached public client for blockchain read operations.
|
|
35006
|
+
*
|
|
35007
|
+
* @remarks
|
|
35008
|
+
* This function provides an optimized way to access blockchain data by maintaining
|
|
35009
|
+
* a cached client instance per chain. The client is used for reading contract state,
|
|
35010
|
+
* querying events, and other read-only blockchain operations. It automatically
|
|
35011
|
+
* handles HTTP transport configuration and chain switching.
|
|
35012
|
+
*
|
|
35013
|
+
* @param chainId - The chain ID to connect to (defaults to Moksha testnet)
|
|
35014
|
+
* @returns A public client configured for the specified chain with caching optimization
|
|
35015
|
+
* @throws {Error} When the specified chain ID is not supported by the SDK
|
|
35016
|
+
* @example
|
|
35017
|
+
* ```typescript
|
|
35018
|
+
* // Get client for default chain (Moksha testnet)
|
|
35019
|
+
* const client = createClient();
|
|
35020
|
+
*
|
|
35021
|
+
* // Get client for specific chain
|
|
35022
|
+
* const mainnetClient = createClient(14800);
|
|
35023
|
+
*
|
|
35024
|
+
* // Use client for blockchain reads
|
|
35025
|
+
* const blockNumber = await client.getBlockNumber();
|
|
35026
|
+
* ```
|
|
35027
|
+
* @category Blockchain
|
|
35028
|
+
*/
|
|
34912
35029
|
declare const createClient: (chainId?: keyof typeof chains) => PublicClient & {
|
|
34913
35030
|
chain: Chain;
|
|
34914
35031
|
};
|
|
@@ -35627,51 +35744,157 @@ declare class SerializationError extends VanaError {
|
|
|
35627
35744
|
constructor(message: string);
|
|
35628
35745
|
}
|
|
35629
35746
|
/**
|
|
35630
|
-
*
|
|
35747
|
+
* Thrown when a signature operation fails or cannot be completed.
|
|
35631
35748
|
*
|
|
35632
35749
|
* @remarks
|
|
35633
|
-
*
|
|
35634
|
-
*
|
|
35635
|
-
*
|
|
35750
|
+
* This error occurs when wallet signature operations fail due to disconnection,
|
|
35751
|
+
* locked accounts, or other wallet-related issues. It preserves the original
|
|
35752
|
+
* error for debugging while providing consistent error handling across the SDK.
|
|
35753
|
+
*
|
|
35754
|
+
* Recovery strategies:
|
|
35755
|
+
* - Check wallet connection and account unlock status
|
|
35756
|
+
* - Retry operation with explicit user interaction
|
|
35757
|
+
* - For gasless operations, consider switching to direct transactions
|
|
35758
|
+
*
|
|
35759
|
+
* @example
|
|
35760
|
+
* ```typescript
|
|
35761
|
+
* try {
|
|
35762
|
+
* await vana.permissions.grant({ grantee: '0x...' });
|
|
35763
|
+
* } catch (error) {
|
|
35764
|
+
* if (error instanceof SignatureError) {
|
|
35765
|
+
* // Prompt user to unlock wallet
|
|
35766
|
+
* await promptWalletUnlock();
|
|
35767
|
+
* // Retry operation
|
|
35768
|
+
* }
|
|
35769
|
+
* }
|
|
35770
|
+
* ```
|
|
35771
|
+
* @category Error Handling
|
|
35636
35772
|
*/
|
|
35637
35773
|
declare class SignatureError extends VanaError {
|
|
35638
35774
|
readonly originalError?: Error | undefined;
|
|
35639
35775
|
constructor(message: string, originalError?: Error | undefined);
|
|
35640
35776
|
}
|
|
35641
35777
|
/**
|
|
35642
|
-
*
|
|
35778
|
+
* Thrown when network communication fails during API calls or blockchain interactions.
|
|
35643
35779
|
*
|
|
35644
35780
|
* @remarks
|
|
35645
|
-
*
|
|
35646
|
-
*
|
|
35781
|
+
* This error encompasses network connectivity issues, API unavailability,
|
|
35782
|
+
* timeout errors, and CORS restrictions. It's commonly encountered during
|
|
35783
|
+
* IPFS operations, subgraph queries, or RPC calls.
|
|
35784
|
+
*
|
|
35785
|
+
* Recovery strategies:
|
|
35786
|
+
* - Check network connectivity
|
|
35787
|
+
* - Retry with exponential backoff
|
|
35788
|
+
* - Verify API endpoints are accessible
|
|
35789
|
+
* - Switch to alternative network providers or gateways
|
|
35790
|
+
*
|
|
35791
|
+
* @example
|
|
35792
|
+
* ```typescript
|
|
35793
|
+
* try {
|
|
35794
|
+
* const files = await vana.data.getUserFiles({ owner: '0x...' });
|
|
35795
|
+
* } catch (error) {
|
|
35796
|
+
* if (error instanceof NetworkError) {
|
|
35797
|
+
* // Implement retry with exponential backoff
|
|
35798
|
+
* await retryWithBackoff(() => vana.data.getUserFiles({ owner: '0x...' }));
|
|
35799
|
+
* }
|
|
35800
|
+
* }
|
|
35801
|
+
* ```
|
|
35802
|
+
* @category Error Handling
|
|
35647
35803
|
*/
|
|
35648
35804
|
declare class NetworkError extends VanaError {
|
|
35649
35805
|
readonly originalError?: Error | undefined;
|
|
35650
35806
|
constructor(message: string, originalError?: Error | undefined);
|
|
35651
35807
|
}
|
|
35652
35808
|
/**
|
|
35653
|
-
*
|
|
35809
|
+
* Thrown when transaction nonce retrieval fails during gasless operations.
|
|
35654
35810
|
*
|
|
35655
35811
|
* @remarks
|
|
35656
|
-
*
|
|
35657
|
-
*
|
|
35812
|
+
* This error occurs when the SDK cannot retrieve the user's current nonce from
|
|
35813
|
+
* smart contracts, preventing gasless transaction submission. Nonces are critical
|
|
35814
|
+
* for preventing replay attacks in signed transactions.
|
|
35815
|
+
*
|
|
35816
|
+
* Recovery strategies:
|
|
35817
|
+
* - Retry nonce retrieval after brief delay
|
|
35818
|
+
* - Check wallet connection and account status
|
|
35819
|
+
* - Use manual nonce specification if supported by the operation
|
|
35820
|
+
* - Switch to direct transactions as fallback
|
|
35821
|
+
*
|
|
35822
|
+
* @example
|
|
35823
|
+
* ```typescript
|
|
35824
|
+
* try {
|
|
35825
|
+
* await vana.permissions.grant({ grantee: '0x...' });
|
|
35826
|
+
* } catch (error) {
|
|
35827
|
+
* if (error instanceof NonceError) {
|
|
35828
|
+
* // Wait and retry
|
|
35829
|
+
* await delay(1000);
|
|
35830
|
+
* await vana.permissions.grant({ grantee: '0x...' });
|
|
35831
|
+
* }
|
|
35832
|
+
* }
|
|
35833
|
+
* ```
|
|
35834
|
+
* @category Error Handling
|
|
35658
35835
|
*/
|
|
35659
35836
|
declare class NonceError extends VanaError {
|
|
35660
35837
|
constructor(message: string);
|
|
35661
35838
|
}
|
|
35662
35839
|
/**
|
|
35663
|
-
*
|
|
35840
|
+
* Thrown when personal server operations fail or cannot be completed.
|
|
35664
35841
|
*
|
|
35665
35842
|
* @remarks
|
|
35666
|
-
*
|
|
35667
|
-
*
|
|
35843
|
+
* This error occurs during interactions with personal servers for computation
|
|
35844
|
+
* requests, identity retrieval, or operation status checks. Common causes include
|
|
35845
|
+
* server unavailability, untrusted server status, or invalid permission grants.
|
|
35846
|
+
*
|
|
35847
|
+
* Recovery strategies:
|
|
35848
|
+
* - Verify server URL accessibility
|
|
35849
|
+
* - Check server trust status via `vana.permissions.getTrustedServers()`
|
|
35850
|
+
* - Ensure valid permissions exist for the operation
|
|
35851
|
+
* - Retry after server becomes available
|
|
35852
|
+
*
|
|
35853
|
+
* @example
|
|
35854
|
+
* ```typescript
|
|
35855
|
+
* try {
|
|
35856
|
+
* const result = await vana.server.createOperation({ permissionId: 123 });
|
|
35857
|
+
* } catch (error) {
|
|
35858
|
+
* if (error instanceof PersonalServerError) {
|
|
35859
|
+
* // Check if server is trusted
|
|
35860
|
+
* const trustedServers = await vana.permissions.getTrustedServers();
|
|
35861
|
+
* if (!trustedServers.includes(serverId)) {
|
|
35862
|
+
* await vana.permissions.trustServer({ serverId });
|
|
35863
|
+
* }
|
|
35864
|
+
* }
|
|
35865
|
+
* }
|
|
35866
|
+
* ```
|
|
35867
|
+
* @category Error Handling
|
|
35668
35868
|
*/
|
|
35669
35869
|
declare class PersonalServerError extends VanaError {
|
|
35670
35870
|
readonly originalError?: Error | undefined;
|
|
35671
35871
|
constructor(message: string, originalError?: Error | undefined);
|
|
35672
35872
|
}
|
|
35673
35873
|
/**
|
|
35674
|
-
*
|
|
35874
|
+
* Thrown when attempting to register a server with a URL different from its existing registration.
|
|
35875
|
+
*
|
|
35876
|
+
* @remarks
|
|
35877
|
+
* This error occurs when trying to add or trust a server that's already registered
|
|
35878
|
+
* on-chain with a different URL. Server URLs are immutable once registered to
|
|
35879
|
+
* maintain consistency and security. Applications should use the existing URL
|
|
35880
|
+
* or register a new server with a different ID.
|
|
35881
|
+
*
|
|
35882
|
+
* @example
|
|
35883
|
+
* ```typescript
|
|
35884
|
+
* try {
|
|
35885
|
+
* await vana.permissions.addAndTrustServer({
|
|
35886
|
+
* serverId: 1,
|
|
35887
|
+
* serverUrl: 'https://new-url.com',
|
|
35888
|
+
* publicKey: '0x...'
|
|
35889
|
+
* });
|
|
35890
|
+
* } catch (error) {
|
|
35891
|
+
* if (error instanceof ServerUrlMismatchError) {
|
|
35892
|
+
* console.log(`Server already registered with: ${error.existingUrl}`);
|
|
35893
|
+
* // Use existing URL or register new server
|
|
35894
|
+
* }
|
|
35895
|
+
* }
|
|
35896
|
+
* ```
|
|
35897
|
+
* @category Error Handling
|
|
35675
35898
|
*/
|
|
35676
35899
|
declare class ServerUrlMismatchError extends VanaError {
|
|
35677
35900
|
constructor(existingUrl: string, providedUrl: string, serverId: string);
|
|
@@ -35680,7 +35903,25 @@ declare class ServerUrlMismatchError extends VanaError {
|
|
|
35680
35903
|
readonly serverId: string;
|
|
35681
35904
|
}
|
|
35682
35905
|
/**
|
|
35683
|
-
*
|
|
35906
|
+
* Thrown when permission grant, revoke, or validation operations fail.
|
|
35907
|
+
*
|
|
35908
|
+
* @remarks
|
|
35909
|
+
* This error occurs during permission management operations including grants,
|
|
35910
|
+
* revocations, and permission validation checks. Common causes include invalid
|
|
35911
|
+
* grantee addresses, expired permissions, or insufficient privileges.
|
|
35912
|
+
*
|
|
35913
|
+
* @example
|
|
35914
|
+
* ```typescript
|
|
35915
|
+
* try {
|
|
35916
|
+
* await vana.permissions.revoke({ permissionId: 999999 });
|
|
35917
|
+
* } catch (error) {
|
|
35918
|
+
* if (error instanceof PermissionError) {
|
|
35919
|
+
* console.error('Permission operation failed:', error.message);
|
|
35920
|
+
* // Permission may not exist or user may not be owner
|
|
35921
|
+
* }
|
|
35922
|
+
* }
|
|
35923
|
+
* ```
|
|
35924
|
+
* @category Error Handling
|
|
35684
35925
|
*/
|
|
35685
35926
|
declare class PermissionError extends VanaError {
|
|
35686
35927
|
readonly originalError?: Error | undefined;
|
|
@@ -36688,21 +36929,53 @@ declare function withSignatureCache(cache: VanaCacheAdapter, walletAddress: stri
|
|
|
36688
36929
|
|
|
36689
36930
|
declare const CONTRACT_ADDRESSES: Record<number, Record<string, string>>;
|
|
36690
36931
|
/**
|
|
36691
|
-
* Retrieves the deployed contract address for a specific contract on a given chain.
|
|
36932
|
+
* Retrieves the deployed contract address for a specific Vana protocol contract on a given chain.
|
|
36692
36933
|
*
|
|
36693
|
-
* @
|
|
36694
|
-
*
|
|
36695
|
-
*
|
|
36696
|
-
*
|
|
36934
|
+
* @remarks
|
|
36935
|
+
* This function provides type-safe access to contract addresses across all supported Vana networks.
|
|
36936
|
+
* It automatically searches both current and legacy contract registries to ensure backwards
|
|
36937
|
+
* compatibility while providing clear error messages for unsupported combinations.
|
|
36938
|
+
*
|
|
36939
|
+
* The function validates that both the chain ID and contract name are supported before
|
|
36940
|
+
* attempting address lookup, helping developers identify deployment or configuration issues
|
|
36941
|
+
* early in the development process.
|
|
36942
|
+
*
|
|
36943
|
+
* **Supported Chains:**
|
|
36944
|
+
* - 14800: Vana Mainnet
|
|
36945
|
+
* - 1480: Moksha Testnet
|
|
36946
|
+
*
|
|
36947
|
+
* **Contract Categories:**
|
|
36948
|
+
* - Data Management: DataRegistry, DataRefinerRegistry
|
|
36949
|
+
* - Permissions: DataPortabilityPermissions, DataPortabilityServers, DataPortabilityGrantees
|
|
36950
|
+
* - Computing: TeePoolPhala, TeePoolDedicatedGpu, etc.
|
|
36951
|
+
* - Token & Governance: DATImplementation, VanaPoolStaking, etc.
|
|
36952
|
+
*
|
|
36953
|
+
* @param chainId - The chain ID to look up the contract on (14800 for mainnet, 1480 for testnet)
|
|
36954
|
+
* @param contract - The contract name to get the address for (use TypeScript autocomplete for available options)
|
|
36955
|
+
* @returns The contract address as a checksummed hex string (0x...)
|
|
36956
|
+
* @throws {Error} When contract address not found for the specified contract and chain combination.
|
|
36957
|
+
* This typically indicates the contract is not deployed on the requested network.
|
|
36697
36958
|
* @example
|
|
36698
36959
|
* ```typescript
|
|
36960
|
+
* // Get core protocol contract addresses
|
|
36961
|
+
* const dataRegistry = getContractAddress(14800, 'DataRegistry');
|
|
36962
|
+
* const permissions = getContractAddress(14800, 'DataPortabilityPermissions');
|
|
36963
|
+
* const trustedServers = getContractAddress(14800, 'DataPortabilityServers');
|
|
36964
|
+
*
|
|
36965
|
+
* // Handle unsupported combinations gracefully
|
|
36699
36966
|
* try {
|
|
36700
|
-
* const
|
|
36701
|
-
* console.log('DataRegistry address:',
|
|
36967
|
+
* const address = getContractAddress(1480, 'DataRegistry');
|
|
36968
|
+
* console.log('DataRegistry testnet address:', address);
|
|
36702
36969
|
* } catch (error) {
|
|
36703
|
-
* console.error('Contract not
|
|
36970
|
+
* console.error('Contract not available on testnet:', error.message);
|
|
36971
|
+
* // Fallback to mainnet or show user-friendly error
|
|
36704
36972
|
* }
|
|
36973
|
+
*
|
|
36974
|
+
* // TypeScript provides autocomplete for contract names
|
|
36975
|
+
* const poolAddress = getContractAddress(14800, 'TeePoolPhala'); // ✅ Valid
|
|
36976
|
+
* // const invalid = getContractAddress(14800, 'InvalidContract'); // ❌ TypeScript error
|
|
36705
36977
|
* ```
|
|
36978
|
+
* @category Configuration
|
|
36706
36979
|
*/
|
|
36707
36980
|
declare const getContractAddress: (chainId: keyof typeof CONTRACT_ADDRESSES, contract: VanaContract) => `0x${string}`;
|
|
36708
36981
|
|
|
@@ -36877,6 +37150,10 @@ declare class CircuitBreaker {
|
|
|
36877
37150
|
*
|
|
36878
37151
|
* This implementation uses browser-compatible libraries and configurations
|
|
36879
37152
|
* to provide crypto, PGP, and HTTP functionality without Node.js dependencies.
|
|
37153
|
+
*
|
|
37154
|
+
* WARNING: Dependencies that access globals during init
|
|
37155
|
+
* MUST be dynamically imported to support Turbopack.
|
|
37156
|
+
* See: https://github.com/vercel/next.js/issues/82632
|
|
36880
37157
|
*/
|
|
36881
37158
|
|
|
36882
37159
|
/**
|
|
@@ -37216,4 +37493,4 @@ declare function Vana(config: VanaConfig): VanaBrowserImpl;
|
|
|
37216
37493
|
*/
|
|
37217
37494
|
type VanaInstance = VanaBrowserImpl;
|
|
37218
37495
|
|
|
37219
|
-
export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams,
|
|
37496
|
+
export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type CompleteSchema, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams, GoogleDriveStorage, GrantExpiredError, type GrantFile, type GrantPermissionParams, GrantSchemaError, GrantValidationError, type GrantValidationErrorResponse, type GrantValidationOptions, type GrantValidationResult, type GrantedPermission, type Grantee, type GranteeInfo, GranteeMismatchError, type GranteeQueryOptions, type HttpMethod, IPFS_GATEWAYS, type IdentityResponseModel, type InitPersonalServerParams, type InternalServerErrorResponse, InvalidConfigurationError, IpfsStorage, type LegacyPermissionParams, type MaybeArray, type MaybePromise, MemoryCache, type Middleware, MiddlewarePipeline, NetworkError, type NetworkInfo, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, type SchemaMetadata, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, TransactionHandle, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, VanaBrowserImpl, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };
|