@mantle-rwa/sdk 0.1.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.
- package/dist/cjs/client.js +198 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/constants/index.js +211 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/errors/index.js +218 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/index.js +51 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/modules/compliance.js +202 -0
- package/dist/cjs/modules/compliance.js.map +1 -0
- package/dist/cjs/modules/index.js +18 -0
- package/dist/cjs/modules/index.js.map +1 -0
- package/dist/cjs/modules/kyc.js +278 -0
- package/dist/cjs/modules/kyc.js.map +1 -0
- package/dist/cjs/modules/token.js +365 -0
- package/dist/cjs/modules/token.js.map +1 -0
- package/dist/cjs/modules/yield.js +406 -0
- package/dist/cjs/modules/yield.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/types/index.js +20 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/utils/index.js +206 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/esm/client.js +194 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants/index.js +208 -0
- package/dist/esm/constants/index.js.map +1 -0
- package/dist/esm/errors/index.js +209 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/index.js +17 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/modules/compliance.js +198 -0
- package/dist/esm/modules/compliance.js.map +1 -0
- package/dist/esm/modules/index.js +8 -0
- package/dist/esm/modules/index.js.map +1 -0
- package/dist/esm/modules/kyc.js +273 -0
- package/dist/esm/modules/kyc.js.map +1 -0
- package/dist/esm/modules/token.js +360 -0
- package/dist/esm/modules/token.js.map +1 -0
- package/dist/esm/modules/yield.js +401 -0
- package/dist/esm/modules/yield.js.map +1 -0
- package/dist/esm/types/index.js +17 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/utils/index.js +188 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/types/client.d.ts +93 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/constants/index.d.ts +83 -0
- package/dist/types/constants/index.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +83 -0
- package/dist/types/errors/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/modules/compliance.d.ts +29 -0
- package/dist/types/modules/compliance.d.ts.map +1 -0
- package/dist/types/modules/index.d.ts +8 -0
- package/dist/types/modules/index.d.ts.map +1 -0
- package/dist/types/modules/kyc.d.ts +131 -0
- package/dist/types/modules/kyc.d.ts.map +1 -0
- package/dist/types/modules/token.d.ts +145 -0
- package/dist/types/modules/token.d.ts.map +1 -0
- package/dist/types/modules/yield.d.ts +143 -0
- package/dist/types/modules/yield.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +254 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +80 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/package.json +52 -0
- package/src/client.ts +258 -0
- package/src/constants/index.ts +226 -0
- package/src/errors/index.ts +291 -0
- package/src/index.ts +42 -0
- package/src/modules/compliance.ts +252 -0
- package/src/modules/index.ts +8 -0
- package/src/modules/kyc.ts +446 -0
- package/src/modules/token.ts +488 -0
- package/src/modules/yield.ts +566 -0
- package/src/types/index.ts +326 -0
- package/src/utils/index.ts +240 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YieldModule - Handles yield distribution management
|
|
3
|
+
*/
|
|
4
|
+
import { type Provider, type Signer } from 'ethers';
|
|
5
|
+
import type { Distribution, DistributionConfig, DistributionPreview, PendingClaim, TransactionResult, TransactionOptions } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Instance of a connected yield distributor
|
|
8
|
+
*/
|
|
9
|
+
export declare class YieldDistributorInstance {
|
|
10
|
+
private readonly _contract;
|
|
11
|
+
private readonly _retries;
|
|
12
|
+
private readonly _retryDelay;
|
|
13
|
+
/** Distributor contract address */
|
|
14
|
+
readonly address: string;
|
|
15
|
+
constructor(address: string, provider: Provider, signer: Signer | null, retries: number, retryDelay: number);
|
|
16
|
+
/**
|
|
17
|
+
* Get the number of distributions
|
|
18
|
+
*/
|
|
19
|
+
distributionCount(): Promise<number>;
|
|
20
|
+
/**
|
|
21
|
+
* Get distribution information
|
|
22
|
+
*/
|
|
23
|
+
getDistributionInfo(distributionId: number): Promise<Distribution>;
|
|
24
|
+
/**
|
|
25
|
+
* Get claimable amount for an account
|
|
26
|
+
*/
|
|
27
|
+
getClaimableAmount(distributionId: number, account: string): Promise<bigint>;
|
|
28
|
+
/**
|
|
29
|
+
* Check if an account has claimed from a distribution
|
|
30
|
+
*/
|
|
31
|
+
hasClaimed(distributionId: number, account: string): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Get all distributions
|
|
34
|
+
*/
|
|
35
|
+
getDistributionHistory(): Promise<Distribution[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Get pending claims for an account
|
|
38
|
+
*/
|
|
39
|
+
getPendingClaims(account: string): Promise<PendingClaim[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a new distribution
|
|
42
|
+
*/
|
|
43
|
+
createDistribution(paymentToken: string, totalAmount: string, claimWindowDays?: number, options?: TransactionOptions): Promise<{
|
|
44
|
+
result: TransactionResult;
|
|
45
|
+
distributionId: number;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Claim yield from a distribution
|
|
49
|
+
*/
|
|
50
|
+
claim(distributionId: number, options?: TransactionOptions): Promise<TransactionResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Claim yield from multiple distributions
|
|
53
|
+
*/
|
|
54
|
+
claimMultiple(distributionIds: number[], options?: TransactionOptions): Promise<TransactionResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Handle unclaimed funds after claim window expires
|
|
57
|
+
*/
|
|
58
|
+
handleUnclaimedFunds(distributionId: number, options?: TransactionOptions): Promise<TransactionResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Set the unclaimed funds recipient
|
|
61
|
+
*/
|
|
62
|
+
setUnclaimedFundsRecipient(recipient: string, options?: TransactionOptions): Promise<TransactionResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Listen for DistributionCreated events
|
|
65
|
+
*/
|
|
66
|
+
onDistributionCreated(callback: (distributionId: bigint, paymentToken: string, totalAmount: bigint, snapshotId: bigint) => void): () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Listen for YieldClaimed events
|
|
69
|
+
*/
|
|
70
|
+
onYieldClaimed(callback: (distributionId: bigint, claimant: string, amount: bigint) => void): () => void;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Module for yield distribution operations
|
|
74
|
+
*/
|
|
75
|
+
export declare class YieldModule {
|
|
76
|
+
private readonly _provider;
|
|
77
|
+
private readonly _signer;
|
|
78
|
+
private readonly _retries;
|
|
79
|
+
private readonly _retryDelay;
|
|
80
|
+
constructor(provider: Provider, signer: Signer | null, retries: number, retryDelay: number);
|
|
81
|
+
/**
|
|
82
|
+
* Connect to an existing yield distributor
|
|
83
|
+
*/
|
|
84
|
+
connect(address: string): YieldDistributorInstance;
|
|
85
|
+
/**
|
|
86
|
+
* Create a distribution
|
|
87
|
+
*
|
|
88
|
+
* @param config - Distribution configuration
|
|
89
|
+
* @returns Transaction result with distribution ID
|
|
90
|
+
*/
|
|
91
|
+
distribute(config: DistributionConfig): Promise<{
|
|
92
|
+
result: TransactionResult;
|
|
93
|
+
distributionId: number;
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* Preview a distribution (calculate per-holder amounts)
|
|
97
|
+
*
|
|
98
|
+
* This method calculates what each holder would receive based on their
|
|
99
|
+
* proportional ownership at the snapshot time.
|
|
100
|
+
*
|
|
101
|
+
* @param tokenAddress - The RWA token address
|
|
102
|
+
* @param totalAmount - Total amount to distribute (in token units)
|
|
103
|
+
* @param snapshotId - Optional snapshot ID (uses current balances if not provided)
|
|
104
|
+
* @param holderAddresses - Optional array of holder addresses to calculate for
|
|
105
|
+
* @returns Preview of the distribution with per-holder breakdown
|
|
106
|
+
*/
|
|
107
|
+
previewDistribution(tokenAddress: string, totalAmount: string, snapshotId?: bigint, holderAddresses?: string[]): Promise<DistributionPreview>;
|
|
108
|
+
/**
|
|
109
|
+
* Calculate yield amount for a specific holder
|
|
110
|
+
*
|
|
111
|
+
* @param tokenAddress - The RWA token address
|
|
112
|
+
* @param holderAddress - The holder's address
|
|
113
|
+
* @param totalAmount - Total distribution amount
|
|
114
|
+
* @param snapshotId - Optional snapshot ID
|
|
115
|
+
* @returns The calculated yield amount for the holder
|
|
116
|
+
*/
|
|
117
|
+
calculateHolderYield(tokenAddress: string, holderAddress: string, totalAmount: string, snapshotId?: bigint): Promise<{
|
|
118
|
+
balance: bigint;
|
|
119
|
+
yieldAmount: bigint;
|
|
120
|
+
percentage: number;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Claim yield from a distribution
|
|
124
|
+
*/
|
|
125
|
+
claim(distributorAddress: string, distributionId: number): Promise<TransactionResult>;
|
|
126
|
+
/**
|
|
127
|
+
* Claim all pending yields
|
|
128
|
+
*/
|
|
129
|
+
claimAll(distributorAddress: string): Promise<TransactionResult>;
|
|
130
|
+
/**
|
|
131
|
+
* Get claimable amount for an account
|
|
132
|
+
*/
|
|
133
|
+
getClaimableAmount(distributorAddress: string, distributionId: number, account: string): Promise<bigint>;
|
|
134
|
+
/**
|
|
135
|
+
* Get distribution history
|
|
136
|
+
*/
|
|
137
|
+
getDistributionHistory(distributorAddress: string): Promise<Distribution[]>;
|
|
138
|
+
/**
|
|
139
|
+
* Get pending claims for an account
|
|
140
|
+
*/
|
|
141
|
+
getPendingClaims(distributorAddress: string, account: string): Promise<PendingClaim[]>;
|
|
142
|
+
}
|
|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,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAI/F"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for the Mantle RWA SDK
|
|
3
|
+
*/
|
|
4
|
+
import type { TransactionReceipt } from 'ethers';
|
|
5
|
+
/**
|
|
6
|
+
* Supported network names
|
|
7
|
+
*/
|
|
8
|
+
export type NetworkName = 'mantle' | 'mantle-sepolia';
|
|
9
|
+
/**
|
|
10
|
+
* Custom network configuration
|
|
11
|
+
*/
|
|
12
|
+
export interface CustomNetwork {
|
|
13
|
+
rpcUrl: string;
|
|
14
|
+
chainId: number;
|
|
15
|
+
name?: string;
|
|
16
|
+
explorerUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Network configuration
|
|
20
|
+
*/
|
|
21
|
+
export interface NetworkConfig {
|
|
22
|
+
name: string;
|
|
23
|
+
chainId: number;
|
|
24
|
+
rpcUrl: string;
|
|
25
|
+
explorerUrl: string;
|
|
26
|
+
contracts?: {
|
|
27
|
+
factory?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Accreditation tiers matching the smart contract enum
|
|
32
|
+
*/
|
|
33
|
+
export declare enum AccreditationTier {
|
|
34
|
+
None = 0,
|
|
35
|
+
Retail = 1,
|
|
36
|
+
Accredited = 2,
|
|
37
|
+
Institutional = 3
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Parsed event from a transaction
|
|
41
|
+
*/
|
|
42
|
+
export interface ParsedEvent {
|
|
43
|
+
name: string;
|
|
44
|
+
args: Record<string, unknown>;
|
|
45
|
+
address: string;
|
|
46
|
+
blockNumber: number;
|
|
47
|
+
transactionHash: string;
|
|
48
|
+
logIndex: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Result of a transaction
|
|
52
|
+
*/
|
|
53
|
+
export interface TransactionResult {
|
|
54
|
+
hash: string;
|
|
55
|
+
blockNumber: number;
|
|
56
|
+
gasUsed: bigint;
|
|
57
|
+
status: 'success' | 'failed';
|
|
58
|
+
events: ParsedEvent[];
|
|
59
|
+
receipt: TransactionReceipt;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for transaction execution
|
|
63
|
+
*/
|
|
64
|
+
export interface TransactionOptions {
|
|
65
|
+
gasLimit?: bigint;
|
|
66
|
+
maxFeePerGas?: bigint;
|
|
67
|
+
maxPriorityFeePerGas?: bigint;
|
|
68
|
+
nonce?: number;
|
|
69
|
+
retries?: number;
|
|
70
|
+
retryDelay?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Available compliance rule types
|
|
74
|
+
*/
|
|
75
|
+
export type ComplianceRule = 'accredited-investor' | 'transfer-limit-24h' | 'transfer-limit-30d' | 'holding-period' | 'max-investors' | 'geographic-restriction';
|
|
76
|
+
/**
|
|
77
|
+
* Transfer eligibility check result
|
|
78
|
+
*/
|
|
79
|
+
export interface TransferEligibility {
|
|
80
|
+
eligible: boolean;
|
|
81
|
+
reason?: string;
|
|
82
|
+
checks: TransferCheck[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Individual transfer check result
|
|
86
|
+
*/
|
|
87
|
+
export interface TransferCheck {
|
|
88
|
+
name: string;
|
|
89
|
+
passed: boolean;
|
|
90
|
+
details?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Configuration for deploying a new RWA system
|
|
94
|
+
*/
|
|
95
|
+
export interface DeploymentConfig {
|
|
96
|
+
tokenName: string;
|
|
97
|
+
tokenSymbol: string;
|
|
98
|
+
initialSupply: string;
|
|
99
|
+
complianceModules?: string[];
|
|
100
|
+
yieldClaimWindowDays?: number;
|
|
101
|
+
vaultSigners: string[];
|
|
102
|
+
vaultThreshold: number;
|
|
103
|
+
vaultWithdrawalThreshold?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Addresses of deployed contracts
|
|
107
|
+
*/
|
|
108
|
+
export interface DeployedContracts {
|
|
109
|
+
token: string;
|
|
110
|
+
vault: string;
|
|
111
|
+
yieldDistributor: string;
|
|
112
|
+
kycRegistry: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Configuration for deploying a token
|
|
116
|
+
*/
|
|
117
|
+
export interface TokenDeployConfig {
|
|
118
|
+
name: string;
|
|
119
|
+
symbol: string;
|
|
120
|
+
totalSupply: string;
|
|
121
|
+
complianceRules?: ComplianceRule[];
|
|
122
|
+
kycRegistryAddress?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Token information
|
|
126
|
+
*/
|
|
127
|
+
export interface TokenInfo {
|
|
128
|
+
address: string;
|
|
129
|
+
name: string;
|
|
130
|
+
symbol: string;
|
|
131
|
+
decimals: number;
|
|
132
|
+
totalSupply: bigint;
|
|
133
|
+
paused: boolean;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Investor data from the KYC registry
|
|
137
|
+
*/
|
|
138
|
+
export interface InvestorData {
|
|
139
|
+
verified: boolean;
|
|
140
|
+
tier: AccreditationTier;
|
|
141
|
+
expiry: Date;
|
|
142
|
+
identityHash: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Verification session for KYC flow
|
|
146
|
+
*/
|
|
147
|
+
export interface VerificationSession {
|
|
148
|
+
sessionId: string;
|
|
149
|
+
provider: string;
|
|
150
|
+
status: 'pending' | 'in_progress' | 'completed' | 'failed';
|
|
151
|
+
redirectUrl?: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Result of a KYC verification
|
|
155
|
+
*/
|
|
156
|
+
export interface VerificationResult {
|
|
157
|
+
verified: boolean;
|
|
158
|
+
tier: AccreditationTier;
|
|
159
|
+
identityHash: string;
|
|
160
|
+
expiryDate: Date;
|
|
161
|
+
rawData?: unknown;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Configuration for creating a distribution
|
|
165
|
+
*/
|
|
166
|
+
export interface DistributionConfig {
|
|
167
|
+
tokenAddress: string;
|
|
168
|
+
paymentToken: string;
|
|
169
|
+
totalAmount: string;
|
|
170
|
+
snapshotDate?: Date;
|
|
171
|
+
claimWindowDays?: number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Preview of a distribution
|
|
175
|
+
*/
|
|
176
|
+
export interface DistributionPreview {
|
|
177
|
+
totalHolders: number;
|
|
178
|
+
totalSupplyAtSnapshot: bigint;
|
|
179
|
+
distributions: HolderDistribution[];
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Distribution amount for a single holder
|
|
183
|
+
*/
|
|
184
|
+
export interface HolderDistribution {
|
|
185
|
+
address: string;
|
|
186
|
+
balance: bigint;
|
|
187
|
+
yieldAmount: bigint;
|
|
188
|
+
percentage: number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Distribution information
|
|
192
|
+
*/
|
|
193
|
+
export interface Distribution {
|
|
194
|
+
id: number;
|
|
195
|
+
paymentToken: string;
|
|
196
|
+
totalAmount: bigint;
|
|
197
|
+
snapshotId: bigint;
|
|
198
|
+
claimDeadline: Date;
|
|
199
|
+
claimedAmount: bigint;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Pending claim for an account
|
|
203
|
+
*/
|
|
204
|
+
export interface PendingClaim {
|
|
205
|
+
distributionId: number;
|
|
206
|
+
amount: bigint;
|
|
207
|
+
paymentToken: string;
|
|
208
|
+
deadline: Date;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Withdrawal proposal
|
|
212
|
+
*/
|
|
213
|
+
export interface WithdrawalProposal {
|
|
214
|
+
id: number;
|
|
215
|
+
token: string;
|
|
216
|
+
amount: bigint;
|
|
217
|
+
recipient: string;
|
|
218
|
+
approvalCount: number;
|
|
219
|
+
executed: boolean;
|
|
220
|
+
approvers: string[];
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Vault status information
|
|
224
|
+
*/
|
|
225
|
+
export interface VaultStatus {
|
|
226
|
+
isEmergency: boolean;
|
|
227
|
+
collateralizationRatio: number;
|
|
228
|
+
backingVerified: boolean;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Compliance report for regulatory purposes
|
|
232
|
+
*/
|
|
233
|
+
export interface ComplianceReport {
|
|
234
|
+
generatedAt: Date;
|
|
235
|
+
tokenAddress: string;
|
|
236
|
+
totalHolders: number;
|
|
237
|
+
verifiedHolders: number;
|
|
238
|
+
accreditedHolders: number;
|
|
239
|
+
transfersBlocked: number;
|
|
240
|
+
complianceScore: number;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Filing data for regulatory submissions
|
|
244
|
+
*/
|
|
245
|
+
export interface FilingData {
|
|
246
|
+
filingType: string;
|
|
247
|
+
tokenAddress: string;
|
|
248
|
+
reportingPeriod: {
|
|
249
|
+
start: Date;
|
|
250
|
+
end: Date;
|
|
251
|
+
};
|
|
252
|
+
data: Record<string, unknown>;
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAMjD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,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B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,IAAI,CAAC;CAChB;AAMD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;CAC1B;AAMD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,IAAI,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE;QACf,KAAK,EAAE,IAAI,CAAC;QACZ,GAAG,EAAE,IAAI,CAAC;KACX,CAAC;IACF,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for the Mantle RWA SDK
|
|
3
|
+
*/
|
|
4
|
+
import { ethers, type TransactionReceipt, type Interface } from 'ethers';
|
|
5
|
+
import type { ParsedEvent, TransactionResult } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Validate an Ethereum address
|
|
8
|
+
*/
|
|
9
|
+
export declare function isValidAddress(address: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Validate and normalize an Ethereum address
|
|
12
|
+
*/
|
|
13
|
+
export declare function normalizeAddress(address: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Parse a string amount to bigint with decimals
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseAmount(amount: string, decimals?: number): bigint;
|
|
18
|
+
/**
|
|
19
|
+
* Format a bigint amount to string with decimals
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatAmount(amount: bigint, decimals?: number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Parse events from a transaction receipt
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseEvents(receipt: TransactionReceipt, contractInterface: Interface): ParsedEvent[];
|
|
26
|
+
/**
|
|
27
|
+
* Create a transaction result from a receipt
|
|
28
|
+
*/
|
|
29
|
+
export declare function createTransactionResult(receipt: TransactionReceipt, events: ParsedEvent[]): TransactionResult;
|
|
30
|
+
/**
|
|
31
|
+
* Sleep for a specified duration
|
|
32
|
+
*/
|
|
33
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Retry a function with exponential backoff
|
|
36
|
+
*/
|
|
37
|
+
export declare function retry<T>(fn: () => Promise<T>, options?: {
|
|
38
|
+
retries?: number;
|
|
39
|
+
delay?: number;
|
|
40
|
+
onRetry?: (error: unknown, attempt: number) => void;
|
|
41
|
+
}): Promise<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Estimate gas with buffer
|
|
44
|
+
*/
|
|
45
|
+
export declare function estimateGasWithBuffer(estimateFn: () => Promise<bigint>, bufferPercent?: number): Promise<bigint>;
|
|
46
|
+
/**
|
|
47
|
+
* Generate a keccak256 hash of identity data
|
|
48
|
+
*/
|
|
49
|
+
export declare function hashIdentityData(data: {
|
|
50
|
+
firstName?: string;
|
|
51
|
+
lastName?: string;
|
|
52
|
+
dateOfBirth?: string;
|
|
53
|
+
documentNumber?: string;
|
|
54
|
+
country?: string;
|
|
55
|
+
}): string;
|
|
56
|
+
/**
|
|
57
|
+
* Convert a timestamp to a Date object
|
|
58
|
+
*/
|
|
59
|
+
export declare function timestampToDate(timestamp: bigint | number): Date;
|
|
60
|
+
/**
|
|
61
|
+
* Convert a Date to a Unix timestamp
|
|
62
|
+
*/
|
|
63
|
+
export declare function dateToTimestamp(date: Date): number;
|
|
64
|
+
/**
|
|
65
|
+
* Check if a timestamp is expired
|
|
66
|
+
*/
|
|
67
|
+
export declare function isExpired(timestamp: bigint | number): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Calculate percentage
|
|
70
|
+
*/
|
|
71
|
+
export declare function calculatePercentage(part: bigint, total: bigint): number;
|
|
72
|
+
/**
|
|
73
|
+
* Chunk an array into smaller arrays
|
|
74
|
+
*/
|
|
75
|
+
export declare function chunk<T>(array: T[], size: number): T[][];
|
|
76
|
+
/**
|
|
77
|
+
* Wait for a transaction to be mined
|
|
78
|
+
*/
|
|
79
|
+
export declare function waitForTransaction(provider: ethers.Provider, hash: string, confirmations?: number): Promise<TransactionReceipt>;
|
|
80
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAI/D;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAMvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EA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,MAAM,GAAG,IAAI,CAGhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAI7D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvE;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAMxD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,IAAI,EAAE,MAAM,EACZ,aAAa,GAAE,MAAU,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAU7B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mantle-rwa/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript SDK for RWA tokenization on Mantle Network",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/cjs/index.js",
|
|
8
|
+
"module": "./dist/esm/index.js",
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/esm/index.js",
|
|
13
|
+
"require": "./dist/cjs/index.js",
|
|
14
|
+
"types": "./dist/types/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
|
|
23
|
+
"build:esm": "tsc -p tsconfig.esm.json && node scripts/fix-esm-imports.js",
|
|
24
|
+
"build:cjs": "tsc -p tsconfig.cjs.json && node scripts/add-cjs-package-json.js",
|
|
25
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
|
+
"test:coverage": "vitest run --coverage",
|
|
29
|
+
"lint": "eslint src --ext .ts",
|
|
30
|
+
"clean": "rm -rf dist coverage",
|
|
31
|
+
"typecheck": "tsc --noEmit"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"ethers": "^6.11.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^20.11.0",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
39
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
40
|
+
"@vitest/coverage-v8": "^1.2.0",
|
|
41
|
+
"eslint": "^8.56.0",
|
|
42
|
+
"fast-check": "^3.15.0",
|
|
43
|
+
"typescript": "^5.3.3",
|
|
44
|
+
"vitest": "^1.2.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"ethers": "^6.0.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
}
|
|
52
|
+
}
|