@trustvc/trustvc 2.14.1 → 2.15.0-beta.2
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 +303 -0
- package/dist/cjs/eip7702-functions/deploy/index.js +19 -0
- package/dist/cjs/eip7702-functions/deploy/platform-paymaster.js +82 -0
- package/dist/cjs/eip7702-functions/deploy/token-registry.js +24 -0
- package/dist/cjs/eip7702-functions/index.js +31 -0
- package/dist/cjs/eip7702-functions/platform-paymaster-functions/admin.js +54 -0
- package/dist/cjs/eip7702-functions/platform-paymaster-functions/index.js +12 -0
- package/dist/cjs/eip7702-functions/token-registry-functions-gasless/index.js +33 -0
- package/dist/cjs/eip7702-functions/token-registry-functions-gasless/mint.js +32 -0
- package/dist/cjs/eip7702-functions/token-registry-functions-gasless/rejectTransfers.js +57 -0
- package/dist/cjs/eip7702-functions/token-registry-functions-gasless/returnToken.js +57 -0
- package/dist/cjs/eip7702-functions/token-registry-functions-gasless/transfer.js +77 -0
- package/dist/cjs/index.js +7 -0
- package/dist/esm/eip7702-functions/deploy/index.js +2 -0
- package/dist/esm/eip7702-functions/deploy/platform-paymaster.js +80 -0
- package/dist/esm/eip7702-functions/deploy/token-registry.js +22 -0
- package/dist/esm/eip7702-functions/index.js +4 -0
- package/dist/esm/eip7702-functions/platform-paymaster-functions/admin.js +44 -0
- package/dist/esm/eip7702-functions/platform-paymaster-functions/index.js +1 -0
- package/dist/esm/eip7702-functions/token-registry-functions-gasless/index.js +4 -0
- package/dist/esm/eip7702-functions/token-registry-functions-gasless/mint.js +30 -0
- package/dist/esm/eip7702-functions/token-registry-functions-gasless/rejectTransfers.js +53 -0
- package/dist/esm/eip7702-functions/token-registry-functions-gasless/returnToken.js +53 -0
- package/dist/esm/eip7702-functions/token-registry-functions-gasless/transfer.js +72 -0
- package/dist/esm/index.js +1 -0
- package/dist/types/eip7702-functions/deploy/index.d.ts +5 -0
- package/dist/types/eip7702-functions/deploy/platform-paymaster.d.ts +41 -0
- package/dist/types/eip7702-functions/deploy/token-registry.d.ts +34 -0
- package/dist/types/eip7702-functions/index.d.ts +15 -0
- package/dist/types/eip7702-functions/platform-paymaster-functions/admin.d.ts +82 -0
- package/dist/types/eip7702-functions/platform-paymaster-functions/index.d.ts +4 -0
- package/dist/types/eip7702-functions/token-registry-functions-gasless/index.d.ts +10 -0
- package/dist/types/eip7702-functions/token-registry-functions-gasless/mint.d.ts +35 -0
- package/dist/types/eip7702-functions/token-registry-functions-gasless/rejectTransfers.d.ts +46 -0
- package/dist/types/eip7702-functions/token-registry-functions-gasless/returnToken.d.ts +49 -0
- package/dist/types/eip7702-functions/token-registry-functions-gasless/transfer.d.ts +56 -0
- package/dist/types/index.d.ts +9 -0
- package/package.json +5 -2
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { WalletClient } from 'viem';
|
|
2
|
+
import { Signer as Signer$1 } from 'ethersV6';
|
|
3
|
+
import { Signer } from 'ethers';
|
|
4
|
+
|
|
5
|
+
type AdminSigner = Signer | Signer$1 | WalletClient;
|
|
6
|
+
/**
|
|
7
|
+
* Whitelists a user on the PlatformPaymaster and sets their gas credit allowance.
|
|
8
|
+
* Credits must be between 0 and 3 (enforced on-chain by the contract).
|
|
9
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
10
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
11
|
+
* @param {string} user - User address to whitelist.
|
|
12
|
+
* @param {bigint} credits - Credit allowance (0–3).
|
|
13
|
+
* @returns {Promise<string>} Transaction hash.
|
|
14
|
+
*/
|
|
15
|
+
declare const setUserWhitelist: (signer: AdminSigner, paymasterAddress: `0x${string}`, user: `0x${string}`, credits: bigint) => Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Removes a user from the PlatformPaymaster whitelist (sets credits to 0).
|
|
18
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
19
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
20
|
+
* @param {string} user - User address to remove.
|
|
21
|
+
* @returns {Promise<string>} Transaction hash.
|
|
22
|
+
*/
|
|
23
|
+
declare const removeUserFromWhitelist: (signer: AdminSigner, paymasterAddress: `0x${string}`, user: `0x${string}`) => Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Adds a Token Registry to the PlatformPaymaster's authorized registries list.
|
|
26
|
+
* Only authorized registries can have documents minted through the paymaster.
|
|
27
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
28
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
29
|
+
* @param {string} registry - Registry contract address to authorize.
|
|
30
|
+
* @returns {Promise<string>} Transaction hash.
|
|
31
|
+
*/
|
|
32
|
+
declare const addRegistry: (signer: AdminSigner, paymasterAddress: `0x${string}`, registry: `0x${string}`) => Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Removes a Token Registry from the PlatformPaymaster's authorized registries list.
|
|
35
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
36
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
37
|
+
* @param {string} registry - Registry contract address to deauthorize.
|
|
38
|
+
* @returns {Promise<string>} Transaction hash.
|
|
39
|
+
*/
|
|
40
|
+
declare const removeRegistry: (signer: AdminSigner, paymasterAddress: `0x${string}`, registry: `0x${string}`) => Promise<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Adds a Title Escrow to the PlatformPaymaster's authorized title escrows list.
|
|
43
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
44
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
45
|
+
* @param {string} titleEscrow - Title Escrow contract address to authorize.
|
|
46
|
+
* @returns {Promise<string>} Transaction hash.
|
|
47
|
+
*/
|
|
48
|
+
declare const addTitleEscrow: (signer: AdminSigner, paymasterAddress: `0x${string}`, titleEscrow: `0x${string}`) => Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Removes a Title Escrow from the PlatformPaymaster's authorized title escrows list.
|
|
51
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
52
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
53
|
+
* @param {string} titleEscrow - Title Escrow contract address to deauthorize.
|
|
54
|
+
* @returns {Promise<string>} Transaction hash.
|
|
55
|
+
*/
|
|
56
|
+
declare const removeTitleEscrow: (signer: AdminSigner, paymasterAddress: `0x${string}`, titleEscrow: `0x${string}`) => Promise<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Adds an address to the PlatformPaymaster's authorized callers list.
|
|
59
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
60
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
61
|
+
* @param {string} caller - Address to authorize as a caller.
|
|
62
|
+
* @returns {Promise<string>} Transaction hash.
|
|
63
|
+
*/
|
|
64
|
+
declare const addAuthorizedCaller: (signer: AdminSigner, paymasterAddress: `0x${string}`, caller: `0x${string}`) => Promise<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Removes an address from the PlatformPaymaster's authorized callers list.
|
|
67
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
68
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
69
|
+
* @param {string} caller - Address to remove from authorized callers.
|
|
70
|
+
* @returns {Promise<string>} Transaction hash.
|
|
71
|
+
*/
|
|
72
|
+
declare const removeAuthorizedCaller: (signer: AdminSigner, paymasterAddress: `0x${string}`, caller: `0x${string}`) => Promise<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Sets the global daily gas spend limit per user on the PlatformPaymaster.
|
|
75
|
+
* @param {AdminSigner} signer - Owner ethers signer (v5/v6) or viem WalletClient.
|
|
76
|
+
* @param {string} paymasterAddress - Address of the deployed PlatformPaymaster.
|
|
77
|
+
* @param {bigint} dailyLimit - New daily limit in wei (0n = unlimited).
|
|
78
|
+
* @returns {Promise<string>} Transaction hash.
|
|
79
|
+
*/
|
|
80
|
+
declare const setDailyLimit: (signer: AdminSigner, paymasterAddress: `0x${string}`, dailyLimit: bigint) => Promise<string>;
|
|
81
|
+
|
|
82
|
+
export { addAuthorizedCaller, addRegistry, addTitleEscrow, removeAuthorizedCaller, removeRegistry, removeTitleEscrow, removeUserFromWhitelist, setDailyLimit, setUserWhitelist };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { MintGaslessOptions, mintGasless } from './mint.js';
|
|
2
|
+
export { rejectTransferBeneficiaryGasless, rejectTransferHolderGasless, rejectTransferOwnersGasless } from './rejectTransfers.js';
|
|
3
|
+
export { acceptReturnedGasless, rejectReturnedGasless, returnToIssuerGasless } from './returnToken.js';
|
|
4
|
+
export { nominateGasless, transferBeneficiaryGasless, transferHolderGasless, transferOwnersGasless } from './transfer.js';
|
|
5
|
+
import '../../token-registry-functions/types.js';
|
|
6
|
+
import '../../utils/supportedChains/index.js';
|
|
7
|
+
import '../../utils/gasStation/index.js';
|
|
8
|
+
import 'ethers';
|
|
9
|
+
import '../../utils/network/index.js';
|
|
10
|
+
import 'ethersV6';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MintTokenParams, TransactionOptions } 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
|
+
interface MintGaslessOptions {
|
|
16
|
+
paymasterAddress: string;
|
|
17
|
+
tokenRegistryAddress: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Mints a new TradeTrust document gaslessly via EIP-7702 + Pimlico.
|
|
21
|
+
* Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
|
|
22
|
+
*
|
|
23
|
+
* Calls `mintDocument(registry, beneficiary, holder, tokenId, remark)` on the PlatformPaymaster,
|
|
24
|
+
* which verifies the registry is authorized, mints the token, and auto-adds beneficiary, holder,
|
|
25
|
+
* and the new TitleEscrow to the paymaster's authorized lists.
|
|
26
|
+
* @param {MintGaslessOptions} contractOptions - Requires `paymasterAddress` and `tokenRegistryAddress`.
|
|
27
|
+
* @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client.
|
|
28
|
+
* @param {MintTokenParams} params - `beneficiaryAddress`, `holderAddress`, `tokenId`, and optional `remarks`.
|
|
29
|
+
* @param {TransactionOptions} options - Transaction options; `options.id` is used to encrypt remarks.
|
|
30
|
+
* @throws {Error} If `paymasterAddress` or `tokenRegistryAddress` is missing.
|
|
31
|
+
* @returns {Promise<string>} The transaction hash of the submitted UserOp.
|
|
32
|
+
*/
|
|
33
|
+
declare const mintGasless: (contractOptions: MintGaslessOptions, smartAccountClient: GaslessSmartAccountClient, params: MintTokenParams, options: TransactionOptions) => Promise<string>;
|
|
34
|
+
|
|
35
|
+
export { type MintGaslessOptions, mintGasless };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ContractOptions, RejectTransferParams, TransactionOptions } 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
|
+
* Rejects the transfer of holder for a title escrow contract gaslessly via EIP-7702 + Pimlico.
|
|
17
|
+
* @param {ContractOptions} contractOptions - Contract-related options including the token registry address, and optionally, token ID and the title escrow address.
|
|
18
|
+
* @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = current holder). Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
|
|
19
|
+
* @param {RejectTransferParams} params - Contains the `remarks` field which is an optional string that will be encrypted and sent with the transaction.
|
|
20
|
+
* @param {TransactionOptions} options - Transfer options including optional `chainId`, `titleEscrowVersion`, `maxFeePerGas`, `maxPriorityFeePerGas`, and an `id` used for encryption.
|
|
21
|
+
* @throws error if the title escrow address is missing.
|
|
22
|
+
* @returns {Promise<string>} The transaction hash of the submitted UserOp.
|
|
23
|
+
*/
|
|
24
|
+
declare const rejectTransferHolderGasless: (contractOptions: ContractOptions, smartAccountClient: GaslessSmartAccountClient, params: RejectTransferParams, options: TransactionOptions) => Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Rejects the transfer of beneficiary for a title escrow contract gaslessly via EIP-7702 + Pimlico.
|
|
27
|
+
* @param {ContractOptions} contractOptions - Contract-related options including the token registry address, and optionally, token ID and the title escrow address.
|
|
28
|
+
* @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = current beneficiary). Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
|
|
29
|
+
* @param {RejectTransferParams} params - Contains the `remarks` field which is an optional string that will be encrypted and sent with the transaction.
|
|
30
|
+
* @param {TransactionOptions} options - Transfer options including optional `chainId`, `titleEscrowVersion`, `maxFeePerGas`, `maxPriorityFeePerGas`, and an `id` used for encryption.
|
|
31
|
+
* @throws error if the title escrow address is missing.
|
|
32
|
+
* @returns {Promise<string>} The transaction hash of the submitted UserOp.
|
|
33
|
+
*/
|
|
34
|
+
declare const rejectTransferBeneficiaryGasless: (contractOptions: ContractOptions, smartAccountClient: GaslessSmartAccountClient, params: RejectTransferParams, options: TransactionOptions) => Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Rejects the transfer of ownership for a title escrow contract gaslessly via EIP-7702 + Pimlico.
|
|
37
|
+
* @param {ContractOptions} contractOptions - Contract-related options including the token registry address, and optionally, token ID and the title escrow address.
|
|
38
|
+
* @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = current holder and beneficiary). Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
|
|
39
|
+
* @param {RejectTransferParams} params - Contains the `remarks` field which is an optional string that will be encrypted and sent with the transaction.
|
|
40
|
+
* @param {TransactionOptions} options - Transfer options including optional `chainId`, `titleEscrowVersion`, `maxFeePerGas`, `maxPriorityFeePerGas`, and an `id` used for encryption.
|
|
41
|
+
* @throws error if the title escrow address is missing.
|
|
42
|
+
* @returns {Promise<string>} The transaction hash of the submitted UserOp.
|
|
43
|
+
*/
|
|
44
|
+
declare const rejectTransferOwnersGasless: (contractOptions: ContractOptions, smartAccountClient: GaslessSmartAccountClient, params: RejectTransferParams, options: TransactionOptions) => Promise<string>;
|
|
45
|
+
|
|
46
|
+
export { rejectTransferBeneficiaryGasless, rejectTransferHolderGasless, rejectTransferOwnersGasless };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ContractOptions, ReturnToIssuerParams, TransactionOptions, AcceptReturnedOptions, RejectReturnedParams, RejectReturnedOptions, AcceptReturnedParams } 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
|
+
* Returns a token to the original issuer from the Title Escrow contract gaslessly via EIP-7702 + Pimlico.
|
|
17
|
+
* Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
|
|
18
|
+
* @param {ContractOptions} contractOptions - Contract-related options including the token registry address, and optionally, token ID and the title escrow address.
|
|
19
|
+
* @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = current holder and beneficiary).
|
|
20
|
+
* @param {ReturnToIssuerParams} params - Contains the `remarks` field which is an optional string that will be encrypted and sent with the transaction.
|
|
21
|
+
* @param {TransactionOptions} options - Transaction options including optional `chainId`, `titleEscrowVersion`, `maxFeePerGas`, `maxPriorityFeePerGas`, and an `id` used for encryption.
|
|
22
|
+
* @throws {Error} If the title escrow address is missing.
|
|
23
|
+
* @returns {Promise<string>} The transaction hash of the submitted UserOp.
|
|
24
|
+
*/
|
|
25
|
+
declare const returnToIssuerGasless: (contractOptions: ContractOptions, smartAccountClient: GaslessSmartAccountClient, params: ReturnToIssuerParams, options: TransactionOptions) => Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Rejects a returned token by restoring it back to the token registry gaslessly via EIP-7702 + Pimlico.
|
|
28
|
+
* Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
|
|
29
|
+
* @param {AcceptReturnedOptions} contractOptions - Contains the `tokenRegistryAddress` used to locate the TradeTrustToken contract.
|
|
30
|
+
* @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = registry admin).
|
|
31
|
+
* @param {RejectReturnedParams} params - Includes the `tokenId` to restore and optional `remarks` to encrypt.
|
|
32
|
+
* @param {TransactionOptions} options - Transaction options including optional `chainId`, `titleEscrowVersion`, `maxFeePerGas`, `maxPriorityFeePerGas`, and an `id` used for encryption.
|
|
33
|
+
* @throws {Error} If the token registry address is missing.
|
|
34
|
+
* @returns {Promise<string>} The transaction hash of the submitted UserOp.
|
|
35
|
+
*/
|
|
36
|
+
declare const rejectReturnedGasless: (contractOptions: AcceptReturnedOptions, smartAccountClient: GaslessSmartAccountClient, params: RejectReturnedParams, options: TransactionOptions) => Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Accepts a returned token by burning it from the TradeTrustToken contract gaslessly via EIP-7702 + Pimlico.
|
|
39
|
+
* Gas is sponsored by the PlatformPaymaster — no ETH required from the caller.
|
|
40
|
+
* @param {RejectReturnedOptions} contractOptions - Contains the `tokenRegistryAddress` from which the token will be burned.
|
|
41
|
+
* @param {GaslessSmartAccountClient} smartAccountClient - Pre-built EIP-7702 smart account client (owner = registry admin).
|
|
42
|
+
* @param {AcceptReturnedParams} params - Includes the `tokenId` to burn and optional `remarks` for audit trail.
|
|
43
|
+
* @param {TransactionOptions} options - Transaction options including optional `chainId`, `titleEscrowVersion`, `maxFeePerGas`, `maxPriorityFeePerGas`, and an `id` used for encryption.
|
|
44
|
+
* @throws {Error} If the token registry address is missing.
|
|
45
|
+
* @returns {Promise<string>} The transaction hash of the submitted UserOp.
|
|
46
|
+
*/
|
|
47
|
+
declare const acceptReturnedGasless: (contractOptions: RejectReturnedOptions, smartAccountClient: GaslessSmartAccountClient, params: AcceptReturnedParams, options: TransactionOptions) => Promise<string>;
|
|
48
|
+
|
|
49
|
+
export { acceptReturnedGasless, rejectReturnedGasless, returnToIssuerGasless };
|
|
@@ -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 };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -26,6 +26,14 @@ 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';
|
|
36
|
+
export { abis as eip7702Abis } from '@trustvc/eip7702';
|
|
29
37
|
export { decrypt } from './core/decrypt.js';
|
|
30
38
|
export { encrypt } from './core/encrypt.js';
|
|
31
39
|
export { verifyDocument } from './core/verify.js';
|
|
@@ -77,6 +85,7 @@ import '@tradetrust-tt/token-registry-v5/contracts';
|
|
|
77
85
|
import 'ethersV6';
|
|
78
86
|
import './document-store/types.js';
|
|
79
87
|
import './token-registry-functions/types.js';
|
|
88
|
+
import 'viem';
|
|
80
89
|
import '@ethersproject/abstract-provider';
|
|
81
90
|
import 'ethers/lib/utils';
|
|
82
91
|
import '@ethersproject/abstract-signer';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustvc/trustvc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0-beta.2",
|
|
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
|
-
"
|
|
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",
|