atfi 1.1.3 → 1.1.4
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/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +34 -0
- package/dist/index.mjs +34 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -545,6 +545,10 @@ declare class ATFiSDK {
|
|
|
545
545
|
* Approve token spending
|
|
546
546
|
*/
|
|
547
547
|
approve(token: Address, spender: Address, amount: bigint): Promise<Hash>;
|
|
548
|
+
/**
|
|
549
|
+
* Get all participants for a vault
|
|
550
|
+
*/
|
|
551
|
+
getParticipants(vaultAddress: Address): Promise<ParticipantInfo[]>;
|
|
548
552
|
/**
|
|
549
553
|
* Get detailed event information
|
|
550
554
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -545,6 +545,10 @@ declare class ATFiSDK {
|
|
|
545
545
|
* Approve token spending
|
|
546
546
|
*/
|
|
547
547
|
approve(token: Address, spender: Address, amount: bigint): Promise<Hash>;
|
|
548
|
+
/**
|
|
549
|
+
* Get all participants for a vault
|
|
550
|
+
*/
|
|
551
|
+
getParticipants(vaultAddress: Address): Promise<ParticipantInfo[]>;
|
|
548
552
|
/**
|
|
549
553
|
* Get detailed event information
|
|
550
554
|
*/
|
package/dist/index.js
CHANGED
|
@@ -750,6 +750,40 @@ var ATFiSDK = class _ATFiSDK {
|
|
|
750
750
|
});
|
|
751
751
|
}
|
|
752
752
|
// ============ Read Functions ============
|
|
753
|
+
/**
|
|
754
|
+
* Get all participants for a vault
|
|
755
|
+
*/
|
|
756
|
+
async getParticipants(vaultAddress) {
|
|
757
|
+
const count = await this.publicClient.readContract({
|
|
758
|
+
address: vaultAddress,
|
|
759
|
+
abi: VaultATFiABI,
|
|
760
|
+
functionName: "getParticipantCount"
|
|
761
|
+
});
|
|
762
|
+
const participantCount = Number(count);
|
|
763
|
+
if (participantCount === 0) return [];
|
|
764
|
+
const addressCalls = [];
|
|
765
|
+
for (let i = 0; i < participantCount; i++) {
|
|
766
|
+
addressCalls.push({
|
|
767
|
+
address: vaultAddress,
|
|
768
|
+
abi: VaultATFiABI,
|
|
769
|
+
functionName: "participantList",
|
|
770
|
+
args: [BigInt(i)]
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
const addresses = await Promise.all(
|
|
774
|
+
Array.from(
|
|
775
|
+
{ length: participantCount },
|
|
776
|
+
(_, i) => this.publicClient.readContract({
|
|
777
|
+
address: vaultAddress,
|
|
778
|
+
abi: VaultATFiABI,
|
|
779
|
+
functionName: "participantList",
|
|
780
|
+
args: [BigInt(i)]
|
|
781
|
+
})
|
|
782
|
+
)
|
|
783
|
+
);
|
|
784
|
+
const statusPromises = addresses.map((addr) => this.getParticipantStatus(vaultAddress, addr));
|
|
785
|
+
return Promise.all(statusPromises);
|
|
786
|
+
}
|
|
753
787
|
/**
|
|
754
788
|
* Get detailed event information
|
|
755
789
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -699,6 +699,40 @@ var ATFiSDK = class _ATFiSDK {
|
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
701
|
// ============ Read Functions ============
|
|
702
|
+
/**
|
|
703
|
+
* Get all participants for a vault
|
|
704
|
+
*/
|
|
705
|
+
async getParticipants(vaultAddress) {
|
|
706
|
+
const count = await this.publicClient.readContract({
|
|
707
|
+
address: vaultAddress,
|
|
708
|
+
abi: VaultATFiABI,
|
|
709
|
+
functionName: "getParticipantCount"
|
|
710
|
+
});
|
|
711
|
+
const participantCount = Number(count);
|
|
712
|
+
if (participantCount === 0) return [];
|
|
713
|
+
const addressCalls = [];
|
|
714
|
+
for (let i = 0; i < participantCount; i++) {
|
|
715
|
+
addressCalls.push({
|
|
716
|
+
address: vaultAddress,
|
|
717
|
+
abi: VaultATFiABI,
|
|
718
|
+
functionName: "participantList",
|
|
719
|
+
args: [BigInt(i)]
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
const addresses = await Promise.all(
|
|
723
|
+
Array.from(
|
|
724
|
+
{ length: participantCount },
|
|
725
|
+
(_, i) => this.publicClient.readContract({
|
|
726
|
+
address: vaultAddress,
|
|
727
|
+
abi: VaultATFiABI,
|
|
728
|
+
functionName: "participantList",
|
|
729
|
+
args: [BigInt(i)]
|
|
730
|
+
})
|
|
731
|
+
)
|
|
732
|
+
);
|
|
733
|
+
const statusPromises = addresses.map((addr) => this.getParticipantStatus(vaultAddress, addr));
|
|
734
|
+
return Promise.all(statusPromises);
|
|
735
|
+
}
|
|
702
736
|
/**
|
|
703
737
|
* Get detailed event information
|
|
704
738
|
*/
|