@trustvc/trustvc 2.14.0 → 2.15.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/eip7702-functions/deploy/index.js +19 -0
  2. package/dist/cjs/eip7702-functions/deploy/platform-paymaster.js +82 -0
  3. package/dist/cjs/eip7702-functions/deploy/token-registry.js +24 -0
  4. package/dist/cjs/eip7702-functions/index.js +26 -0
  5. package/dist/cjs/eip7702-functions/platform-paymaster-functions/admin.js +54 -0
  6. package/dist/cjs/eip7702-functions/platform-paymaster-functions/index.js +12 -0
  7. package/dist/cjs/eip7702-functions/token-registry-functions-gasless/index.js +33 -0
  8. package/dist/cjs/eip7702-functions/token-registry-functions-gasless/mint.js +32 -0
  9. package/dist/cjs/eip7702-functions/token-registry-functions-gasless/rejectTransfers.js +57 -0
  10. package/dist/cjs/eip7702-functions/token-registry-functions-gasless/returnToken.js +57 -0
  11. package/dist/cjs/eip7702-functions/token-registry-functions-gasless/transfer.js +77 -0
  12. package/dist/cjs/index.js +7 -0
  13. package/dist/cjs/utils/supportedChains/index.js +1 -1
  14. package/dist/esm/eip7702-functions/deploy/index.js +2 -0
  15. package/dist/esm/eip7702-functions/deploy/platform-paymaster.js +80 -0
  16. package/dist/esm/eip7702-functions/deploy/token-registry.js +22 -0
  17. package/dist/esm/eip7702-functions/index.js +3 -0
  18. package/dist/esm/eip7702-functions/platform-paymaster-functions/admin.js +44 -0
  19. package/dist/esm/eip7702-functions/platform-paymaster-functions/index.js +1 -0
  20. package/dist/esm/eip7702-functions/token-registry-functions-gasless/index.js +4 -0
  21. package/dist/esm/eip7702-functions/token-registry-functions-gasless/mint.js +30 -0
  22. package/dist/esm/eip7702-functions/token-registry-functions-gasless/rejectTransfers.js +53 -0
  23. package/dist/esm/eip7702-functions/token-registry-functions-gasless/returnToken.js +53 -0
  24. package/dist/esm/eip7702-functions/token-registry-functions-gasless/transfer.js +72 -0
  25. package/dist/esm/index.js +1 -0
  26. package/dist/esm/utils/supportedChains/index.js +1 -1
  27. package/dist/types/eip7702-functions/deploy/index.d.ts +5 -0
  28. package/dist/types/eip7702-functions/deploy/platform-paymaster.d.ts +41 -0
  29. package/dist/types/eip7702-functions/deploy/token-registry.d.ts +34 -0
  30. package/dist/types/eip7702-functions/index.d.ts +14 -0
  31. package/dist/types/eip7702-functions/platform-paymaster-functions/admin.d.ts +82 -0
  32. package/dist/types/eip7702-functions/platform-paymaster-functions/index.d.ts +4 -0
  33. package/dist/types/eip7702-functions/token-registry-functions-gasless/index.d.ts +10 -0
  34. package/dist/types/eip7702-functions/token-registry-functions-gasless/mint.d.ts +35 -0
  35. package/dist/types/eip7702-functions/token-registry-functions-gasless/rejectTransfers.d.ts +46 -0
  36. package/dist/types/eip7702-functions/token-registry-functions-gasless/returnToken.d.ts +49 -0
  37. package/dist/types/eip7702-functions/token-registry-functions-gasless/transfer.d.ts +56 -0
  38. package/dist/types/index.d.ts +8 -0
  39. package/package.json +5 -2
@@ -0,0 +1,56 @@
1
+ import { ContractOptions, TransferHolderParams, TransactionOptions, TransferBeneficiaryParams, TransferOwnersParams, NominateParams } from '../../token-registry-functions/types.js';
2
+ import '../../utils/supportedChains/index.js';
3
+ import '../../utils/gasStation/index.js';
4
+ import 'ethers';
5
+ import '../../utils/network/index.js';
6
+ import 'ethersV6';
7
+
8
+ interface GaslessSmartAccountClient {
9
+ sendTransaction(args: {
10
+ to: `0x${string}`;
11
+ value: bigint;
12
+ data: `0x${string}`;
13
+ }): Promise<string>;
14
+ }
15
+ /**
16
+ * Transfers the holder role of a Title Escrow gaslessly via EIP-7702 + Pimlico.
17
+ * Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
18
+ * @param {ContractOptions} contractOptions - `titleEscrowAddress` of the Title Escrow to act on.
19
+ * @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = current holder).
20
+ * @param {TransferHolderParams} params - `holderAddress` to transfer to, and optional `remarks`.
21
+ * @param {TransactionOptions} options - Transaction options; `options.id` is used to encrypt remarks.
22
+ * @returns {Promise<string>} The transaction hash of the submitted UserOp.
23
+ */
24
+ declare const transferHolderGasless: (contractOptions: ContractOptions, smartAccountClient: GaslessSmartAccountClient, params: TransferHolderParams, options: TransactionOptions) => Promise<string>;
25
+ /**
26
+ * Transfers the beneficiary role of a Title Escrow gaslessly via EIP-7702 + Pimlico.
27
+ * Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
28
+ * @param {ContractOptions} contractOptions - `titleEscrowAddress` of the Title Escrow to act on.
29
+ * @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = current holder).
30
+ * @param {TransferBeneficiaryParams} params - `newBeneficiaryAddress` to transfer to, and optional `remarks`.
31
+ * @param {TransactionOptions} options - Transaction options; `options.id` is used to encrypt remarks.
32
+ * @returns {Promise<string>} The transaction hash of the submitted UserOp.
33
+ */
34
+ declare const transferBeneficiaryGasless: (contractOptions: ContractOptions, smartAccountClient: GaslessSmartAccountClient, params: TransferBeneficiaryParams, options: TransactionOptions) => Promise<string>;
35
+ /**
36
+ * Transfers both the holder and beneficiary roles of a Title Escrow gaslessly via EIP-7702 + Pimlico.
37
+ * Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
38
+ * @param {ContractOptions} contractOptions - `titleEscrowAddress` of the Title Escrow to act on.
39
+ * @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = current holder and beneficiary).
40
+ * @param {TransferOwnersParams} params - `newBeneficiaryAddress`, `newHolderAddress`, and optional `remarks`.
41
+ * @param {TransactionOptions} options - Transaction options; `options.id` is used to encrypt remarks.
42
+ * @returns {Promise<string>} The transaction hash of the submitted UserOp.
43
+ */
44
+ declare const transferOwnersGasless: (contractOptions: ContractOptions, smartAccountClient: GaslessSmartAccountClient, params: TransferOwnersParams, options: TransactionOptions) => Promise<string>;
45
+ /**
46
+ * Nominates a new beneficiary on a Title Escrow gaslessly via EIP-7702 + Pimlico.
47
+ * Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
48
+ * @param {ContractOptions} contractOptions - `titleEscrowAddress` of the Title Escrow to act on.
49
+ * @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = current beneficiary).
50
+ * @param {NominateParams} params - `newBeneficiaryAddress` to nominate, and optional `remarks`.
51
+ * @param {TransactionOptions} options - Transaction options; `options.id` is used to encrypt remarks.
52
+ * @returns {Promise<string>} The transaction hash of the submitted UserOp.
53
+ */
54
+ declare const nominateGasless: (contractOptions: ContractOptions, smartAccountClient: GaslessSmartAccountClient, params: NominateParams, options: TransactionOptions) => Promise<string>;
55
+
56
+ export { nominateGasless, transferBeneficiaryGasless, transferHolderGasless, transferOwnersGasless };
@@ -26,6 +26,13 @@ export { acceptReturned, rejectReturned, returnToIssuer } from './token-registry
26
26
  export { mint } from './token-registry-functions/mint.js';
27
27
  export { ownerOf } from './token-registry-functions/ownerOf.js';
28
28
  export { DeployOptions, TransactionReceipt, deployTokenRegistry } from './deploy/token-registry.js';
29
+ export { MintGaslessOptions, mintGasless } from './eip7702-functions/token-registry-functions-gasless/mint.js';
30
+ export { rejectTransferBeneficiaryGasless, rejectTransferHolderGasless, rejectTransferOwnersGasless } from './eip7702-functions/token-registry-functions-gasless/rejectTransfers.js';
31
+ export { acceptReturnedGasless, rejectReturnedGasless, returnToIssuerGasless } from './eip7702-functions/token-registry-functions-gasless/returnToken.js';
32
+ export { nominateGasless, transferBeneficiaryGasless, transferHolderGasless, transferOwnersGasless } from './eip7702-functions/token-registry-functions-gasless/transfer.js';
33
+ export { DeployPlatformPaymasterOptions, DeployPlatformPaymasterResult, deployPlatformPaymaster } from './eip7702-functions/deploy/platform-paymaster.js';
34
+ export { DeployTokenRegistryGaslessOptions, deployTokenRegistryGasless } from './eip7702-functions/deploy/token-registry.js';
35
+ export { addAuthorizedCaller, addRegistry, addTitleEscrow, removeAuthorizedCaller, removeRegistry, removeTitleEscrow, removeUserFromWhitelist, setDailyLimit, setUserWhitelist } from './eip7702-functions/platform-paymaster-functions/admin.js';
29
36
  export { decrypt } from './core/decrypt.js';
30
37
  export { encrypt } from './core/encrypt.js';
31
38
  export { verifyDocument } from './core/verify.js';
@@ -77,6 +84,7 @@ import '@tradetrust-tt/token-registry-v5/contracts';
77
84
  import 'ethersV6';
78
85
  import './document-store/types.js';
79
86
  import './token-registry-functions/types.js';
87
+ import 'viem';
80
88
  import '@ethersproject/abstract-provider';
81
89
  import 'ethers/lib/utils';
82
90
  import '@ethersproject/abstract-signer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustvc/trustvc",
3
- "version": "2.14.0",
3
+ "version": "2.15.0-beta.1",
4
4
  "description": "TrustVC library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -122,6 +122,7 @@
122
122
  "@tradetrust-tt/tradetrust": "^6.10.3",
123
123
  "@tradetrust-tt/tt-verify": "^9.7.5",
124
124
  "@trustvc/document-store": "^1.0.3",
125
+ "@trustvc/eip7702": "^1.0.0-beta.1",
125
126
  "@trustvc/w3c": "^2.2.0",
126
127
  "@trustvc/w3c-context": "^2.2.0",
127
128
  "@trustvc/w3c-credential-status": "^2.2.0",
@@ -132,7 +133,9 @@
132
133
  "js-sha3": "^0.9.3",
133
134
  "node-fetch": "^2.7.0",
134
135
  "node-forge": "^1.3.3",
135
- "ts-chacha20": "^1.2.0"
136
+ "permissionless": "^0.3.6",
137
+ "ts-chacha20": "^1.2.0",
138
+ "viem": "^2.53.1"
136
139
  },
137
140
  "devDependencies": {
138
141
  "@commitlint/cli": "^19.8.0",