@trustvc/trustvc 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/cjs/{document-store/deploy.js → deploy/document-store.js} +18 -18
  2. package/dist/cjs/deploy/token-registry.js +97 -0
  3. package/dist/cjs/document-store/grant-role.js +67 -0
  4. package/dist/cjs/document-store/index.js +15 -12
  5. package/dist/cjs/document-store/issue.js +0 -5
  6. package/dist/cjs/document-store/revoke-role.js +67 -0
  7. package/dist/cjs/document-store/revoke.js +0 -5
  8. package/dist/cjs/document-store/transferOwnership.js +42 -0
  9. package/dist/cjs/document-store/types.js +2 -0
  10. package/dist/cjs/index.js +8 -0
  11. package/dist/cjs/token-registry-functions/index.js +7 -0
  12. package/dist/cjs/token-registry-functions/ownerOf.js +9 -7
  13. package/dist/cjs/token-registry-functions/utils.js +39 -0
  14. package/dist/cjs/token-registry-v5/index.js +4 -4
  15. package/dist/cjs/utils/ethers/index.js +6 -2
  16. package/dist/esm/{document-store/deploy.js → deploy/document-store.js} +19 -19
  17. package/dist/esm/deploy/token-registry.js +95 -0
  18. package/dist/esm/document-store/grant-role.js +65 -0
  19. package/dist/esm/document-store/index.js +6 -3
  20. package/dist/esm/document-store/issue.js +0 -5
  21. package/dist/esm/document-store/revoke-role.js +65 -0
  22. package/dist/esm/document-store/revoke.js +0 -5
  23. package/dist/esm/document-store/transferOwnership.js +40 -0
  24. package/dist/esm/document-store/types.js +1 -0
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/token-registry-functions/index.js +1 -0
  27. package/dist/esm/token-registry-functions/ownerOf.js +9 -7
  28. package/dist/esm/token-registry-functions/utils.js +38 -2
  29. package/dist/esm/token-registry-v5/index.js +1 -1
  30. package/dist/esm/utils/ethers/index.js +7 -4
  31. package/dist/types/deploy/document-store.d.ts +77 -0
  32. package/dist/types/deploy/token-registry.d.ts +82 -0
  33. package/dist/types/document-store/grant-role.d.ts +28 -0
  34. package/dist/types/document-store/index.d.ts +7 -3
  35. package/dist/types/document-store/issue.d.ts +6 -11
  36. package/dist/types/document-store/revoke-role.d.ts +28 -0
  37. package/dist/types/document-store/transferOwnership.d.ts +30 -0
  38. package/dist/types/document-store/types.d.ts +15 -0
  39. package/dist/types/index.d.ts +17 -13
  40. package/dist/types/token-registry-functions/index.d.ts +1 -0
  41. package/dist/types/token-registry-functions/ownerOf.d.ts +1 -1
  42. package/dist/types/token-registry-functions/types.d.ts +26 -1
  43. package/dist/types/token-registry-functions/utils.d.ts +7 -4
  44. package/dist/types/token-registry-v5/index.d.ts +1 -2
  45. package/dist/types/utils/ethers/index.d.ts +6 -5
  46. package/package.json +1 -1
  47. package/dist/types/document-store/deploy.d.ts +0 -29
@@ -1,9 +1,10 @@
1
1
  import { Signer as Signer$1, ContractTransactionResponse } from 'ethersV6';
2
2
  import { Signer, ContractTransaction } from 'ethers';
3
- import { CHAIN_ID } from '../utils/supportedChains/index.js';
4
- import { GasValue } from '../token-registry-functions/types.js';
3
+ import { CommandOptions } from './types.js';
4
+ import '../utils/supportedChains/index.js';
5
5
  import '../utils/gasStation/index.js';
6
6
  import '../utils/network/index.js';
7
+ import '../token-registry-functions/types.js';
7
8
 
8
9
  /**
9
10
  * Issues a document hash to the DocumentStore contract.
@@ -15,18 +16,12 @@ import '../utils/network/index.js';
15
16
  * @param {string} documentStoreAddress - The address of the DocumentStore contract.
16
17
  * @param {string} documentHash - The hash of the document to issue (must be a valid hex string).
17
18
  * @param {SignerV5 | SignerV6} signer - Signer instance (Ethers v5 or v6) that authorizes the issue transaction.
18
- * @param {IssueOptions} options - Optional transaction metadata including gas values and chain ID.
19
+ * @param {CommandOptions} options - Optional transaction metadata including gas values and chain ID.
19
20
  * @returns {Promise<ContractTransactionV5 | ContractTransactionV6>} A promise resolving to the transaction result from the issue call.
20
21
  * @throws {Error} If the document store address or signer provider is not provided.
21
22
  * @throws {Error} If the document hash is invalid.
22
23
  * @throws {Error} If the `callStatic.issue` fails as a pre-check.
23
24
  */
24
- interface IssueOptions {
25
- chainId?: CHAIN_ID;
26
- maxFeePerGas?: GasValue;
27
- maxPriorityFeePerGas?: GasValue;
28
- isTransferable?: boolean;
29
- }
30
- declare const documentStoreIssue: (documentStoreAddress: string, documentHash: string, signer: Signer | Signer$1, options?: IssueOptions) => Promise<ContractTransaction | ContractTransactionResponse>;
25
+ declare const documentStoreIssue: (documentStoreAddress: string, documentHash: string, signer: Signer | Signer$1, options?: CommandOptions) => Promise<ContractTransaction | ContractTransactionResponse>;
31
26
 
32
- export { type IssueOptions, documentStoreIssue };
27
+ export { documentStoreIssue };
@@ -0,0 +1,28 @@
1
+ import { Signer as Signer$1, ContractTransactionResponse } from 'ethersV6';
2
+ import { Signer, ContractTransaction } from 'ethers';
3
+ import { CommandOptions } from './types.js';
4
+ import '../utils/supportedChains/index.js';
5
+ import '../utils/gasStation/index.js';
6
+ import '../utils/network/index.js';
7
+ import '../token-registry-functions/types.js';
8
+
9
+ /**
10
+ * Revokes a role from an account on the DocumentStore contract.
11
+ * Supports both Ethers v5 and v6 signers.
12
+ * Supports three types of document stores:
13
+ * 1. DocumentStore (ERC-165 compliant)
14
+ * 2. TransferableDocumentStore (ERC-165 compliant)
15
+ * 3. TT Document Store (legacy, no ERC-165 support - used as fallback)
16
+ * @param {string} documentStoreAddress - The address of the DocumentStore contract.
17
+ * @param {string} role - The role to revoke (e.g., 'ISSUER', 'REVOKER', 'ADMIN').
18
+ * @param {string} account - The account to revoke the role from.
19
+ * @param {SignerV5 | SignerV6} signer - Signer instance (Ethers v5 or v6) that authorizes the revoke role transaction.
20
+ * @param {CommandOptions} options - Optional transaction metadata including gas values and chain ID.
21
+ * @returns {Promise<ContractTransactionV5 | ContractTransactionV6>} A promise resolving to the transaction result from the revoke role call.
22
+ * @throws {Error} If the document store address or signer provider is not provided.
23
+ * @throws {Error} If the role is invalid.
24
+ * @throws {Error} If the `callStatic.revokeRole` fails as a pre-check.
25
+ */
26
+ declare const documentStoreRevokeRole: (documentStoreAddress: string, role: string, account: string, signer: Signer | Signer$1, options?: CommandOptions) => Promise<ContractTransaction | ContractTransactionResponse>;
27
+
28
+ export { documentStoreRevokeRole };
@@ -0,0 +1,30 @@
1
+ import { Signer as Signer$1, ContractTransactionResponse } from 'ethersV6';
2
+ import { Signer, ContractTransaction } from 'ethers';
3
+ import { CommandOptions } from './types.js';
4
+ import '../utils/supportedChains/index.js';
5
+ import '../utils/gasStation/index.js';
6
+ import '../utils/network/index.js';
7
+ import '../token-registry-functions/types.js';
8
+
9
+ /**
10
+ * Transfers ownership of a DocumentStore contract to a new owner.
11
+ * Supports both Ethers v5 and v6 signers.
12
+ * Supports three types of document stores:
13
+ * 1. DocumentStore (ERC-165 compliant)
14
+ * 2. TransferableDocumentStore (ERC-165 compliant)
15
+ * 3. TT Document Store (legacy, no ERC-165 support - used as fallback)
16
+ * @param {string} documentStoreAddress - The address of the DocumentStore contract.
17
+ * @param {string} account - The account to transfer ownership to.
18
+ * @param {SignerV5 | SignerV6} signer - Signer instance (Ethers v5 or v6) that authorizes the transfer ownership transaction.
19
+ * @param {CommandOptions} options - Optional transaction metadata including gas values and chain ID.
20
+ * @returns {Promise<{grantTransaction: Promise<ContractTransactionV5 | ContractTransactionV6>; revokeTransaction: Promise<ContractTransactionV5 | ContractTransactionV6>}>} A promise resolving to the transaction result from the grant and revoke role calls.
21
+ * @throws {Error} If the document store address or signer provider is not provided.
22
+ * @throws {Error} If the role is invalid.
23
+ * @throws {Error} If the `callStatic.revokeRole` fails as a pre-check.
24
+ */
25
+ declare const documentStoreTransferOwnership: (documentStoreAddress: string, account: string, signer: Signer | Signer$1, options?: CommandOptions) => Promise<{
26
+ grantTransaction: Promise<ContractTransaction | ContractTransactionResponse>;
27
+ revokeTransaction: Promise<ContractTransaction | ContractTransactionResponse>;
28
+ }>;
29
+
30
+ export { documentStoreTransferOwnership };
@@ -0,0 +1,15 @@
1
+ import { CHAIN_ID } from '../utils/supportedChains/index.js';
2
+ import { GasValue } from '../token-registry-functions/types.js';
3
+ import '../utils/gasStation/index.js';
4
+ import 'ethers';
5
+ import '../utils/network/index.js';
6
+ import 'ethersV6';
7
+
8
+ interface CommandOptions {
9
+ chainId?: CHAIN_ID;
10
+ maxFeePerGas?: GasValue;
11
+ maxPriorityFeePerGas?: GasValue;
12
+ isTransferable?: boolean;
13
+ }
14
+
15
+ export type { CommandOptions };
@@ -3,22 +3,35 @@ export { contractAddress as v4ContractAddress } from './token-registry-v4/contra
3
3
  export { supportInterfaceIds as v4SupportInterfaceIds } from './token-registry-v4/supportInterfaceIds.js';
4
4
  export { c as v4Contracts } from './contracts-BEtjrEPE.js';
5
5
  export { computeInterfaceId as v4ComputeInterfaceId, computeTitleEscrowAddress as v4ComputeTitleEscrowAddress, encodeInitParams as v4EncodeInitParams, getEventFromReceipt as v4GetEventFromReceipt } from './token-registry-v4/utils.js';
6
- export { utils as v4Utils, utils as v5Utils } from '@tradetrust-tt/token-registry-v4';
6
+ export { utils as v4Utils } from '@tradetrust-tt/token-registry-v4';
7
7
  export { contractAddress as v5ContractAddress } from './token-registry-v5/contractAddress.js';
8
8
  export { roleHash as v5RoleHash } from './token-registry-v5/roleHash.js';
9
9
  export { supportInterfaceIds as v5SupportInterfaceIds } from './token-registry-v5/supportInterfaceIds.js';
10
10
  export { c as v5Contracts } from './contracts-BaIGKzNt.js';
11
11
  export { computeInterfaceId as v5ComputeInterfaceId, encodeInitParams as v5EncodeInitParams, getEventFromReceipt as v5GetEventFromReceipt } from './token-registry-v5/utils.js';
12
+ export { utils as v5Utils } from '@tradetrust-tt/token-registry-v5';
12
13
  export { TypedContractMethod } from '@tradetrust-tt/token-registry-v5/contracts/common';
13
14
  export { documentStoreIssue } from './document-store/issue.js';
14
15
  export { documentStoreRevoke } from './document-store/revoke.js';
15
- export { deployDocumentStore } from './document-store/deploy.js';
16
+ export { documentStoreRevokeRole } from './document-store/revoke-role.js';
17
+ export { documentStoreGrantRole } from './document-store/grant-role.js';
18
+ export { OAErrorMessageHandling, errorMessageHandling, interpretFragments, w3cCredentialStatusRevoked, w3cCredentialStatusSuspended } from './utils/fragment/index.js';
19
+ export { networkCurrency, networkName, networkType, networks } from './utils/network/index.js';
20
+ export { generate12ByteNonce, generate32ByteKey, stringToUint8Array } from './utils/stringUtils/index.js';
21
+ export { CHAIN_ID, SUPPORTED_CHAINS, chainInfo } from './utils/supportedChains/index.js';
22
+ export { errorMessages } from './utils/errorMessages/index.js';
23
+ export { WrappedOrSignedOpenAttestationDocument, getChainId, getObfuscatedData, getTokenId, getTokenRegistryAddress, getTransferableRecordsCredentialStatus, isObfuscated, isTransferableRecord } from './utils/documents/index.js';
24
+ export { GasStationFeeData, GasStationFunction, calculateMaxFee, gasStation, scaleBigNumber } from './utils/gasStation/index.js';
25
+ export { AwsKmsSigner, AwsKmsSignerCredentials } from '@tradetrust-tt/ethers-aws-kms-signer';
26
+ export { gaEvent, gaPageView, validateGaEvent, validateGtag, validatePageViewEvent } from './utils/analytics/analytics.js';
27
+ export { deployDocumentStore } from './deploy/document-store.js';
16
28
  export { DocumentStore__factory, TransferableDocumentStore__factory } from '@trustvc/document-store';
17
29
  export { nominate, transferBeneficiary, transferHolder, transferOwners } from './token-registry-functions/transfer.js';
18
30
  export { rejectTransferBeneficiary, rejectTransferHolder, rejectTransferOwners } from './token-registry-functions/rejectTransfers.js';
19
31
  export { acceptReturned, rejectReturned, returnToIssuer } from './token-registry-functions/returnToken.js';
20
32
  export { mint } from './token-registry-functions/mint.js';
21
33
  export { ownerOf } from './token-registry-functions/ownerOf.js';
34
+ export { DeployOptions, TransactionReceipt, deployTokenRegistry } from './deploy/token-registry.js';
22
35
  export { decrypt } from './core/decrypt.js';
23
36
  export { encrypt } from './core/encrypt.js';
24
37
  export { verifyDocument } from './core/verify.js';
@@ -46,15 +59,6 @@ export { PrivateKeyPair } from '@trustvc/w3c-issuer';
46
59
  export { i as vc } from './index-1ws_BWZW.js';
47
60
  export { verifyW3CSignature } from './w3c/verify.js';
48
61
  export { deriveW3C } from './w3c/derive.js';
49
- export { OAErrorMessageHandling, errorMessageHandling, interpretFragments, w3cCredentialStatusRevoked, w3cCredentialStatusSuspended } from './utils/fragment/index.js';
50
- export { networkCurrency, networkName, networkType, networks } from './utils/network/index.js';
51
- export { generate12ByteNonce, generate32ByteKey, stringToUint8Array } from './utils/stringUtils/index.js';
52
- export { CHAIN_ID, SUPPORTED_CHAINS, chainInfo } from './utils/supportedChains/index.js';
53
- export { errorMessages } from './utils/errorMessages/index.js';
54
- export { WrappedOrSignedOpenAttestationDocument, getChainId, getObfuscatedData, getTokenId, getTokenRegistryAddress, getTransferableRecordsCredentialStatus, isObfuscated, isTransferableRecord } from './utils/documents/index.js';
55
- export { GasStationFeeData, GasStationFunction, calculateMaxFee, gasStation, scaleBigNumber } from './utils/gasStation/index.js';
56
- export { AwsKmsSigner, AwsKmsSignerCredentials } from '@tradetrust-tt/ethers-aws-kms-signer';
57
- export { gaEvent, gaPageView, validateGaEvent, validateGtag, validatePageViewEvent } from './utils/analytics/analytics.js';
58
62
  export { CustomDnsResolver, IDNSQueryResponse, IDNSRecord, OpenAttestationDNSTextRecord, OpenAttestationDnsDidRecord, defaultDnsResolvers, getDnsDidRecords, getDocumentStoreRecords, parseDnsDidResults, parseDocumentStoreResults, parseOpenAttestationRecord, queryDns } from '@tradetrust-tt/dnsprove';
59
63
  export { OpenAttestationDocument, SUPPORTED_SIGNING_ALGORITHM, SchemaId, SignedWrappedDocument, WrappedDocument, getData as getDataV2, isSchemaValidationError, obfuscateDocument, v2, v3, validateSchema, __unsafe__use__it__at__your__own__risks__wrapDocument as wrapOADocumentV3, __unsafe__use__it__at__your__own__risks__wrapDocuments as wrapOADocumentsV3 } from '@tradetrust-tt/tradetrust';
60
64
  export { DiagnoseError } from '@tradetrust-tt/tradetrust/dist/types/shared/utils';
@@ -65,9 +69,10 @@ import '@tradetrust-tt/token-registry-v4/contracts';
65
69
  import 'ethers';
66
70
  import '@typechain/ethers-v5/static/common';
67
71
  import '@tradetrust-tt/token-registry-v5/contracts';
68
- import '@tradetrust-tt/token-registry-v5';
69
72
  import 'ethersV6';
73
+ import './document-store/types.js';
70
74
  import './token-registry-functions/types.js';
75
+ import '@trustvc/w3c-credential-status';
71
76
  import '@ethersproject/abstract-provider';
72
77
  import 'ethers/lib/utils';
73
78
  import '@ethersproject/abstract-signer';
@@ -85,4 +90,3 @@ import './verify/fragments/issuer-identity/w3cIssuerIdentity.js';
85
90
  import './verify/fragments/document-status/w3cEmptyCredentialStatus/index.js';
86
91
  import 'runtypes';
87
92
  import '@trustvc/w3c-context';
88
- import '@trustvc/w3c-credential-status';
@@ -3,6 +3,7 @@ export { rejectTransferBeneficiary, rejectTransferHolder, rejectTransferOwners }
3
3
  export { acceptReturned, rejectReturned, returnToIssuer } from './returnToken.js';
4
4
  export { mint } from './mint.js';
5
5
  export { ownerOf } from './ownerOf.js';
6
+ export { DeployOptions, TransactionReceipt, deployTokenRegistry } from '../deploy/token-registry.js';
6
7
  import 'ethersV6';
7
8
  import 'ethers';
8
9
  import './types.js';
@@ -9,7 +9,7 @@ import '../utils/network/index.js';
9
9
  * Retrieves the owner of a given token from the TradeTrustToken contract.
10
10
  * Supports both Token Registry V4 and V5 implementations.
11
11
  * @param {OwnerOfTokenOptions} contractOptions - Options containing the token registry address.
12
- * @param {Signer | SignerV6} signer - Signer instance (v5 or v6) used to query the blockchain.
12
+ * @param {SignerV5 | SignerV6} signer - Signer instance (v5 or v6) used to query the blockchain.
13
13
  * @param {OwnerOfTokenParams} params - Contains the `tokenId` of the token to query ownership for.
14
14
  * @param {TransactionOptions} options - Includes the `titleEscrowVersion` and other optional metadata for interface detection.
15
15
  * @returns {Promise<string>} A promise that resolves to the owner address of the specified token.
@@ -4,6 +4,12 @@ import { BigNumberish, Provider } from 'ethersV6';
4
4
  import '../utils/gasStation/index.js';
5
5
  import '../utils/network/index.js';
6
6
 
7
+ interface GasPriceScale {
8
+ maxPriorityFeePerGasScale: number;
9
+ }
10
+ interface GasOption extends GasPriceScale {
11
+ dryRun: boolean;
12
+ }
7
13
  type GasValue = BigNumber | BigNumberish | string | number;
8
14
  interface RejectTransferParams {
9
15
  remarks?: string;
@@ -78,5 +84,24 @@ interface ProviderInfo {
78
84
  ethersVersion: 'v5' | 'v6';
79
85
  titleEscrowVersion: 'v4' | 'v5';
80
86
  }
87
+ interface NetworkOption {
88
+ network: string;
89
+ }
90
+ type WalletOption = {
91
+ encryptedWalletPath: string;
92
+ };
93
+ type PrivateKeyOption = {
94
+ key?: string;
95
+ keyFile?: never;
96
+ } | {
97
+ key?: never;
98
+ keyFile?: string;
99
+ };
100
+ type NetworkAndWalletSignerOption = NetworkOption & (Partial<WalletOption> | Partial<PrivateKeyOption>);
101
+ interface DeployContractAddress {
102
+ TitleEscrowFactory?: string;
103
+ TokenImplementation?: string;
104
+ Deployer?: string;
105
+ }
81
106
 
82
- export type { AcceptReturnedOptions, AcceptReturnedParams, ContractOptions, GasValue, MintTokenOptions, MintTokenParams, NominateParams, OwnerOfTokenOptions, OwnerOfTokenParams, ProviderInfo, RejectReturnedOptions, RejectReturnedParams, RejectTransferParams, ReturnToIssuerParams, TransactionOptions, TransferBeneficiaryParams, TransferHolderParams, TransferOwnersParams };
107
+ export type { AcceptReturnedOptions, AcceptReturnedParams, ContractOptions, DeployContractAddress, GasOption, GasPriceScale, GasValue, MintTokenOptions, MintTokenParams, NetworkAndWalletSignerOption, NetworkOption, NominateParams, OwnerOfTokenOptions, OwnerOfTokenParams, PrivateKeyOption, ProviderInfo, RejectReturnedOptions, RejectReturnedParams, RejectTransferParams, ReturnToIssuerParams, TransactionOptions, TransferBeneficiaryParams, TransferHolderParams, TransferOwnersParams, WalletOption };
@@ -1,7 +1,7 @@
1
- import { GasValue } from './types.js';
1
+ import { GasValue, DeployContractAddress } from './types.js';
2
2
  import { CHAIN_ID } from '../utils/supportedChains/index.js';
3
- import { Signer as Signer$1 } from 'ethers';
4
- import { Signer } from 'ethersV6';
3
+ import { Signer as Signer$1, providers } from 'ethers';
4
+ import { Signer, Provider } from 'ethersV6';
5
5
  import '../utils/gasStation/index.js';
6
6
  import '../utils/network/index.js';
7
7
 
@@ -14,5 +14,8 @@ declare const getTxOptions: (signer: Signer | Signer$1, chainId: CHAIN_ID, maxFe
14
14
  }>;
15
15
  declare const getChainIdSafe: (signer: Signer | Signer$1) => Promise<bigint | number>;
16
16
  declare const getSignerAddressSafe: (signer: Signer | Signer$1) => Promise<string>;
17
+ declare const getDefaultContractAddress: (chainId: CHAIN_ID) => DeployContractAddress;
18
+ declare const isValidAddress: (address?: string) => boolean;
19
+ declare const isSupportedTitleEscrowFactory: (factoryAddress: string, provider: providers.Provider | Provider) => Promise<boolean>;
17
20
 
18
- export { getChainIdSafe, getSignerAddressSafe, getTxOptions };
21
+ export { getChainIdSafe, getDefaultContractAddress, getSignerAddressSafe, getTxOptions, isSupportedTitleEscrowFactory, isValidAddress };
@@ -3,7 +3,6 @@ export { roleHash as v5RoleHash } from './roleHash.js';
3
3
  export { supportInterfaceIds as v5SupportInterfaceIds } from './supportInterfaceIds.js';
4
4
  export { c as v5Contracts } from '../contracts-BaIGKzNt.js';
5
5
  export { computeInterfaceId as v5ComputeInterfaceId, encodeInitParams as v5EncodeInitParams, getEventFromReceipt as v5GetEventFromReceipt } from './utils.js';
6
- export { constants, utils, utils as v5Utils } from '@tradetrust-tt/token-registry-v4';
6
+ export { constants, utils, utils as v5Utils } from '@tradetrust-tt/token-registry-v5';
7
7
  export { TypedContractMethod } from '@tradetrust-tt/token-registry-v5/contracts/common';
8
8
  import '@tradetrust-tt/token-registry-v5/contracts';
9
- import '@tradetrust-tt/token-registry-v5';
@@ -1,8 +1,9 @@
1
- import { ethers as ethers$1 } from 'ethers';
2
- import { ethers } from 'ethersV6';
3
- import { Provider } from '@ethersproject/abstract-provider';
1
+ import { Provider, Contract as Contract$1, ContractFactory as ContractFactory$1 } from 'ethersV6';
2
+ import { providers, Contract, ContractFactory } from 'ethers';
4
3
 
4
+ type ProviderV5 = providers.Provider;
5
5
  declare const isV6EthersProvider: (provider: any) => boolean;
6
- declare const getEthersContractFromProvider: (provider: Provider | ethers.Provider) => typeof ethers$1.Contract | typeof ethers.Contract;
6
+ declare const getEthersContractFromProvider: (provider: ProviderV5 | Provider) => typeof Contract | typeof Contract$1;
7
+ declare const getEthersContractFactoryFromProvider: (provider: ProviderV5 | Provider) => typeof ContractFactory | typeof ContractFactory$1;
7
8
 
8
- export { getEthersContractFromProvider, isV6EthersProvider };
9
+ export { getEthersContractFactoryFromProvider, getEthersContractFromProvider, isV6EthersProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustvc/trustvc",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "TrustVC library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,29 +0,0 @@
1
- import { Signer as Signer$1, ContractTransactionReceipt } from 'ethersV6';
2
- import { Signer, ContractReceipt } from 'ethers';
3
- import { CHAIN_ID } from '../utils/supportedChains/index.js';
4
- import { GasValue } from '../token-registry-functions/types.js';
5
- import '../utils/gasStation/index.js';
6
- import '../utils/network/index.js';
7
-
8
- /**
9
- * Deploys a new DocumentStore contract.
10
- * Supports both Ethers v5 and v6 signers.
11
- * @param {string} storeName - The name of the document store.
12
- * @param {string} owner - The owner address of the document store.
13
- * @param {SignerV5 | SignerV6} signer - Signer instance (Ethers v5 or v6) that authorizes the deployment.
14
- * @param {DeployOptions} options - Optional transaction metadata including gas values and chain ID.
15
- * @returns {Promise<TransactionReceipt>} A promise resolving to the deployed contract address and transaction hash.
16
- * @throws {Error} If the signer provider is not provided.
17
- * @throws {Error} If the store name or owner address is not provided.
18
- * @throws {Error} If deployment fails.
19
- */
20
- interface DeployOptions {
21
- chainId?: CHAIN_ID;
22
- maxFeePerGas?: GasValue;
23
- maxPriorityFeePerGas?: GasValue;
24
- isTransferable?: boolean;
25
- }
26
- type TransactionReceipt = ContractReceipt | ContractTransactionReceipt;
27
- declare const deployDocumentStore: (storeName: string, owner: string, signer: Signer | Signer$1, options?: DeployOptions) => Promise<TransactionReceipt>;
28
-
29
- export { type DeployOptions, type TransactionReceipt, deployDocumentStore };