@zebec-network/solana-payroll-sdk 1.2.2 → 2.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/instructions.d.ts +34 -1
- package/dist/instructions.js +47 -1
- package/dist/pda.d.ts +3 -0
- package/dist/pda.js +14 -0
- package/dist/services.d.ts +18 -2
- package/dist/services.js +81 -9
- package/dist/types.d.ts +21 -3
- package/package.json +2 -2
package/dist/instructions.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare function createCreatePayrollInstruction(program: Program<ZebecPay
|
|
|
28
28
|
isPausable: number;
|
|
29
29
|
rateUpdatable: number;
|
|
30
30
|
startNow: number;
|
|
31
|
-
|
|
31
|
+
payrollRunId: number[];
|
|
32
32
|
initialBufferAmount: BN;
|
|
33
33
|
autoTopupDelegate: number;
|
|
34
34
|
senderId: number[];
|
|
@@ -98,3 +98,36 @@ export declare function createTransferFeesInstruction(program: Program<ZebecPayr
|
|
|
98
98
|
decimals: number;
|
|
99
99
|
feeAmount: BN;
|
|
100
100
|
}): Promise<TransactionInstruction>;
|
|
101
|
+
export declare function createInitYieldConfigInstruction(program: Program<ZebecPayrollIdl>, accounts: {
|
|
102
|
+
admin: PublicKey;
|
|
103
|
+
yieldConfig: PublicKey;
|
|
104
|
+
vault: PublicKey;
|
|
105
|
+
vaultUsdtAta: PublicKey;
|
|
106
|
+
usdtMint: PublicKey;
|
|
107
|
+
usxMint: PublicKey;
|
|
108
|
+
}, data: {
|
|
109
|
+
minUnlockAmount: BN;
|
|
110
|
+
unlockCooldown: BN;
|
|
111
|
+
}): Promise<TransactionInstruction>;
|
|
112
|
+
export declare function createYieldDepositInstruction(program: Program<ZebecPayrollIdl>, accounts: {
|
|
113
|
+
company: PublicKey;
|
|
114
|
+
companyDeposit: PublicKey;
|
|
115
|
+
yieldConfig: PublicKey;
|
|
116
|
+
vault: PublicKey;
|
|
117
|
+
vaultUsdtAta: PublicKey;
|
|
118
|
+
companyUsdtAta: PublicKey;
|
|
119
|
+
usdtMint: PublicKey;
|
|
120
|
+
}, data: {
|
|
121
|
+
amount: BN;
|
|
122
|
+
}): Promise<TransactionInstruction>;
|
|
123
|
+
export declare function createUnlockNowInstruction(program: Program<ZebecPayrollIdl>, accounts: {
|
|
124
|
+
admin: PublicKey;
|
|
125
|
+
feePayer: PublicKey;
|
|
126
|
+
company: PublicKey;
|
|
127
|
+
companyDeposit: PublicKey;
|
|
128
|
+
yieldConfig: PublicKey;
|
|
129
|
+
vault: PublicKey;
|
|
130
|
+
vaultUsdtAta: PublicKey;
|
|
131
|
+
companyUsdtAta: PublicKey;
|
|
132
|
+
usdtMint: PublicKey;
|
|
133
|
+
}): Promise<TransactionInstruction>;
|
package/dist/instructions.js
CHANGED
|
@@ -15,7 +15,7 @@ export async function createCreatePayrollInstruction(program, accounts, data) {
|
|
|
15
15
|
isPausable: data.isPausable,
|
|
16
16
|
rateUpdatable: data.rateUpdatable,
|
|
17
17
|
startNow: data.startNow,
|
|
18
|
-
|
|
18
|
+
payrollRunId: data.payrollRunId,
|
|
19
19
|
initialBufferAmount: data.initialBufferAmount,
|
|
20
20
|
autoTopupDelegate: data.autoTopupDelegate,
|
|
21
21
|
senderId: data.senderId,
|
|
@@ -131,3 +131,49 @@ export async function createTransferFeesInstruction(program, accounts, data) {
|
|
|
131
131
|
})
|
|
132
132
|
.instruction();
|
|
133
133
|
}
|
|
134
|
+
export async function createInitYieldConfigInstruction(program, accounts, data) {
|
|
135
|
+
return program.methods
|
|
136
|
+
.initYieldConfig({
|
|
137
|
+
minUnlockAmount: data.minUnlockAmount,
|
|
138
|
+
unlockCooldown: data.unlockCooldown,
|
|
139
|
+
})
|
|
140
|
+
.accountsPartial({
|
|
141
|
+
admin: accounts.admin,
|
|
142
|
+
yieldConfig: accounts.yieldConfig,
|
|
143
|
+
vault: accounts.vault,
|
|
144
|
+
vaultUsdtAta: accounts.vaultUsdtAta,
|
|
145
|
+
usdtMint: accounts.usdtMint,
|
|
146
|
+
usxMint: accounts.usxMint,
|
|
147
|
+
})
|
|
148
|
+
.instruction();
|
|
149
|
+
}
|
|
150
|
+
export async function createYieldDepositInstruction(program, accounts, data) {
|
|
151
|
+
return program.methods
|
|
152
|
+
.yieldDeposit(data.amount)
|
|
153
|
+
.accountsPartial({
|
|
154
|
+
company: accounts.company,
|
|
155
|
+
companyDeposit: accounts.companyDeposit,
|
|
156
|
+
yieldConfig: accounts.yieldConfig,
|
|
157
|
+
vault: accounts.vault,
|
|
158
|
+
vaultUsdtAta: accounts.vaultUsdtAta,
|
|
159
|
+
companyUsdtAta: accounts.companyUsdtAta,
|
|
160
|
+
usdtMint: accounts.usdtMint,
|
|
161
|
+
})
|
|
162
|
+
.instruction();
|
|
163
|
+
}
|
|
164
|
+
export async function createUnlockNowInstruction(program, accounts) {
|
|
165
|
+
return program.methods
|
|
166
|
+
.unlockNow()
|
|
167
|
+
.accountsPartial({
|
|
168
|
+
admin: accounts.admin,
|
|
169
|
+
feePayer: accounts.feePayer,
|
|
170
|
+
company: accounts.company,
|
|
171
|
+
companyDeposit: accounts.companyDeposit,
|
|
172
|
+
yieldConfig: accounts.yieldConfig,
|
|
173
|
+
vault: accounts.vault,
|
|
174
|
+
vaultUsdtAta: accounts.vaultUsdtAta,
|
|
175
|
+
companyUsdtAta: accounts.companyUsdtAta,
|
|
176
|
+
usdtMint: accounts.usdtMint,
|
|
177
|
+
})
|
|
178
|
+
.instruction();
|
|
179
|
+
}
|
package/dist/pda.d.ts
CHANGED
|
@@ -2,3 +2,6 @@ import { type Address } from "@coral-xyz/anchor";
|
|
|
2
2
|
import { PublicKey } from "@solana/web3.js";
|
|
3
3
|
export declare function derivePayrollConfigPda(configName: string, configProgramId: Address): [PublicKey, number];
|
|
4
4
|
export declare function derivePayrollVaultPda(metatadata: Address, payrollProgramId: Address): [PublicKey, number];
|
|
5
|
+
export declare function deriveYieldConfigPda(payrollProgramId: Address): [PublicKey, number];
|
|
6
|
+
export declare function deriveYieldVaultPda(payrollProgramId: Address): [PublicKey, number];
|
|
7
|
+
export declare function deriveCompanyDepositPda(company: Address, payrollProgramId: Address): [PublicKey, number];
|
package/dist/pda.js
CHANGED
|
@@ -6,9 +6,23 @@ import { PublicKey } from "@solana/web3.js";
|
|
|
6
6
|
const PAYROLL_CONFIG_SEEDS = {
|
|
7
7
|
PAYROLL_CONFIG: utils.bytes.utf8.encode("payroll_config"),
|
|
8
8
|
};
|
|
9
|
+
const YIELD_SEEDS = {
|
|
10
|
+
YIELD_CONFIG: utils.bytes.utf8.encode("yield_config"),
|
|
11
|
+
YIELD_VAULT: utils.bytes.utf8.encode("yield_vault"),
|
|
12
|
+
COMPANY_DEPOSIT: utils.bytes.utf8.encode("Yield"),
|
|
13
|
+
};
|
|
9
14
|
export function derivePayrollConfigPda(configName, configProgramId) {
|
|
10
15
|
return PublicKey.findProgramAddressSync([PAYROLL_CONFIG_SEEDS.PAYROLL_CONFIG, utils.bytes.utf8.encode(configName)], translateAddress(configProgramId));
|
|
11
16
|
}
|
|
12
17
|
export function derivePayrollVaultPda(metatadata, payrollProgramId) {
|
|
13
18
|
return PublicKey.findProgramAddressSync([translateAddress(metatadata).toBuffer()], translateAddress(payrollProgramId));
|
|
14
19
|
}
|
|
20
|
+
export function deriveYieldConfigPda(payrollProgramId) {
|
|
21
|
+
return PublicKey.findProgramAddressSync([YIELD_SEEDS.YIELD_CONFIG], translateAddress(payrollProgramId));
|
|
22
|
+
}
|
|
23
|
+
export function deriveYieldVaultPda(payrollProgramId) {
|
|
24
|
+
return PublicKey.findProgramAddressSync([YIELD_SEEDS.YIELD_VAULT], translateAddress(payrollProgramId));
|
|
25
|
+
}
|
|
26
|
+
export function deriveCompanyDepositPda(company, payrollProgramId) {
|
|
27
|
+
return PublicKey.findProgramAddressSync([translateAddress(company).toBuffer(), YIELD_SEEDS.COMPANY_DEPOSIT], translateAddress(payrollProgramId));
|
|
28
|
+
}
|
package/dist/services.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Address, type Program } from "@coral-xyz/anchor";
|
|
2
|
-
import { type Commitment } from "@solana/web3.js";
|
|
2
|
+
import { type Commitment, PublicKey } from "@solana/web3.js";
|
|
3
3
|
import { MultiTransactionPayload, TransactionPayload } from "@zebec-network/solana-common";
|
|
4
4
|
import type { ZebecConfigs as ZebecConfigsIdl } from "@zebec-network/zebec_configs";
|
|
5
5
|
import type { ZebecPayroll as ZebecPayrollIdl } from "@zebec-network/zebec_payroll";
|
|
6
|
-
import type { CancelPayrollParams, ChangePayrollReceiverParams, CreateMultiplePayrollParams, CreatePayrollParams, PayrollConfigInfo, PayrollMetadataInfo, SetTopupDelegateParams, TokenMetadata, TopupPayrollParams, WithdrawPayrollParams } from "./types.js";
|
|
6
|
+
import type { CancelPayrollParams, ChangePayrollReceiverParams, CreateMultiplePayrollParams, CreatePayrollParams, InitYieldConfigParams, PayrollConfigInfo, PayrollMetadataInfo, SetTopupDelegateParams, TokenMetadata, TopupPayrollParams, UnlockNowParams, WithdrawPayrollParams, YieldDepositParams } from "./types.js";
|
|
7
7
|
export declare function getPayrollConfig(configProgram: Program<ZebecConfigsIdl>, configName: string): Promise<PayrollConfigInfo>;
|
|
8
8
|
export declare function getWhitelistedTokens(configProgram: Program<ZebecConfigsIdl>, configName: string, commitment?: "processed" | "confirmed" | "finalized"): Promise<TokenMetadata[]>;
|
|
9
9
|
export declare function getPayrollMetadataInfo(program: Program<ZebecPayrollIdl>, payrollMetadata: Address, commitment?: Commitment): Promise<PayrollMetadataInfo>;
|
|
@@ -17,3 +17,19 @@ export declare function withdrawPayroll(payrollProgram: Program<ZebecPayrollIdl>
|
|
|
17
17
|
export declare function changePayrollReceiver(program: Program<ZebecPayrollIdl>, params: ChangePayrollReceiverParams): Promise<TransactionPayload>;
|
|
18
18
|
export declare function setTopupDelegate(payrollProgram: Program<ZebecPayrollIdl>, configProgram: Program<ZebecConfigsIdl>, params: SetTopupDelegateParams): Promise<TransactionPayload>;
|
|
19
19
|
export declare function topupPayroll(payrollProgram: Program<ZebecPayrollIdl>, configProgram: Program<ZebecConfigsIdl>, params: TopupPayrollParams): Promise<TransactionPayload>;
|
|
20
|
+
export declare function initYieldConfig(payrollProgram: Program<ZebecPayrollIdl>, params: InitYieldConfigParams): Promise<TransactionPayload>;
|
|
21
|
+
export declare function yieldDeposit(payrollProgram: Program<ZebecPayrollIdl>, params: YieldDepositParams): Promise<TransactionPayload>;
|
|
22
|
+
export declare function unlockNow(payrollProgram: Program<ZebecPayrollIdl>, params: UnlockNowParams): Promise<TransactionPayload>;
|
|
23
|
+
export declare function getCompanyDeposit(payrollProgram: Program<ZebecPayrollIdl>, company: Address): Promise<{
|
|
24
|
+
company: PublicKey;
|
|
25
|
+
depositedAmount: import("bn.js");
|
|
26
|
+
rewardsReceived: import("bn.js");
|
|
27
|
+
depositTime: import("bn.js");
|
|
28
|
+
hasDeposited: boolean;
|
|
29
|
+
pendingUnlock: {
|
|
30
|
+
usdtAmount: import("bn.js");
|
|
31
|
+
usxAmount: import("bn.js");
|
|
32
|
+
requestTime: import("bn.js");
|
|
33
|
+
} | null;
|
|
34
|
+
bump: number;
|
|
35
|
+
}>;
|
package/dist/services.js
CHANGED
|
@@ -8,8 +8,8 @@ import { createAssociatedTokenAccountInstruction, getAssociatedTokenAddressSync,
|
|
|
8
8
|
import { BigNumber } from "bignumber.js";
|
|
9
9
|
import { BN } from "bn.js";
|
|
10
10
|
import { PAYROLL_NAME_BUFFER_SIZE } from "./constants.js";
|
|
11
|
-
import { createCancelPayrollInstruction, createChangeRecipientInstruction, createCreatePayrollInstruction, createPauseResumePayrollInstruction, createSetTopupDelegateInstruction, createTopupPayrollInstruction, createTransferFeesInstruction, createWithdrawPayrollInstruction, } from "./instructions.js";
|
|
12
|
-
import { derivePayrollConfigPda, derivePayrollVaultPda } from "./pda.js";
|
|
11
|
+
import { createCancelPayrollInstruction, createChangeRecipientInstruction, createCreatePayrollInstruction, createInitYieldConfigInstruction, createPauseResumePayrollInstruction, createSetTopupDelegateInstruction, createTopupPayrollInstruction, createTransferFeesInstruction, createUnlockNowInstruction, createWithdrawPayrollInstruction, createYieldDepositInstruction, } from "./instructions.js";
|
|
12
|
+
import { deriveCompanyDepositPda, derivePayrollConfigPda, derivePayrollVaultPda, deriveYieldConfigPda, deriveYieldVaultPda, } from "./pda.js";
|
|
13
13
|
import { getFeeInfoForPayroll } from "./utils.js";
|
|
14
14
|
export async function getPayrollConfig(configProgram, configName) {
|
|
15
15
|
const [payrollConfigPda] = derivePayrollConfigPda(configName, configProgram.programId);
|
|
@@ -165,7 +165,7 @@ export async function getPayrollMetadataInfo(program, payrollMetadata, commitmen
|
|
|
165
165
|
isPausable: Boolean(metadataInfo.permissions.isPausable),
|
|
166
166
|
rateUpdatable: Boolean(metadataInfo.permissions.rateUpdatable),
|
|
167
167
|
},
|
|
168
|
-
|
|
168
|
+
payrollRunId: utils.bytes.utf8.decode(Uint8Array.from(metadataInfo.payrollRunId).filter((byte) => byte !== 0)), // Remove padding zeros
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
async function createPayload(program, payerKey, instructions, signers, addressLookupTableAccounts) {
|
|
@@ -214,8 +214,8 @@ export async function createPayroll(payrollProgram, configProgram, params, payro
|
|
|
214
214
|
.times(TEN_BIGNUM.pow(payrollTokenDecimals))
|
|
215
215
|
.toFixed(0);
|
|
216
216
|
const cliffPercentage = new BN(percentToBps(params.cliffPercentage));
|
|
217
|
-
const
|
|
218
|
-
|
|
217
|
+
const payrollRunId = new Uint8Array(PAYROLL_NAME_BUFFER_SIZE);
|
|
218
|
+
payrollRunId.set(utils.bytes.utf8.encode(params.payrollRunId));
|
|
219
219
|
const feeInfo = await getFeeInfoForPayroll(payrollFeeBaseUrl, payrollToken, amount);
|
|
220
220
|
const feeTokenDecimals = await getMintDecimals(payrollProgram.provider.connection, payrollConfigAccount.feeToken);
|
|
221
221
|
const parsedFeeAmount = feeInfo.feeAmountRaw;
|
|
@@ -269,7 +269,7 @@ export async function createPayroll(payrollProgram, configProgram, params, payro
|
|
|
269
269
|
startNow: Number(params.startNow),
|
|
270
270
|
startTime: new BN(params.startTime),
|
|
271
271
|
autoWithdrawFrequency: new BN(params.autoWithdrawFrequency),
|
|
272
|
-
|
|
272
|
+
payrollRunId: Array.from(payrollRunId),
|
|
273
273
|
transferableByRecipient: Number(params.transferableByRecipient),
|
|
274
274
|
transferableBySender: Number(params.transferableBySender),
|
|
275
275
|
receiverId: Array.from(params.receiverId),
|
|
@@ -309,8 +309,8 @@ export async function createMultiplePayroll(payrollProgram, configProgram, param
|
|
|
309
309
|
.times(TEN_BIGNUM.pow(payrollTokenDecimals))
|
|
310
310
|
.toFixed(0);
|
|
311
311
|
const cliffPercentage = new BN(percentToBps(payroll.cliffPercentage));
|
|
312
|
-
const
|
|
313
|
-
|
|
312
|
+
const payrollRunId = new Uint8Array(PAYROLL_NAME_BUFFER_SIZE);
|
|
313
|
+
payrollRunId.set(utils.bytes.utf8.encode(payroll.payrollRunId));
|
|
314
314
|
const feeInfo = await getFeeInfoForPayroll(payrollFeeBaseUrl, payrollToken, amount);
|
|
315
315
|
const feeTokenDecimals = await getMintDecimals(payrollProgram.provider.connection, payrollConfigAccount.feeToken);
|
|
316
316
|
const parsedFeeAmount = feeInfo.feeAmountRaw;
|
|
@@ -364,7 +364,7 @@ export async function createMultiplePayroll(payrollProgram, configProgram, param
|
|
|
364
364
|
startNow: Number(payroll.startNow),
|
|
365
365
|
startTime: new BN(payroll.startTime),
|
|
366
366
|
autoWithdrawFrequency: new BN(payroll.autoWithdrawFrequency),
|
|
367
|
-
|
|
367
|
+
payrollRunId: Array.from(payrollRunId),
|
|
368
368
|
transferableByRecipient: Number(payroll.transferableByRecipient),
|
|
369
369
|
transferableBySender: Number(payroll.transferableBySender),
|
|
370
370
|
receiverId: Array.from(payroll.receiverId),
|
|
@@ -526,3 +526,75 @@ export async function topupPayroll(payrollProgram, configProgram, params) {
|
|
|
526
526
|
});
|
|
527
527
|
return createPayload(payrollProgram, caller, [ix]);
|
|
528
528
|
}
|
|
529
|
+
export async function initYieldConfig(payrollProgram, params) {
|
|
530
|
+
const admin = translateAddress(params.admin);
|
|
531
|
+
const usdtMint = translateAddress(params.usdtMint);
|
|
532
|
+
const usxMint = translateAddress(params.usxMint);
|
|
533
|
+
const [yieldConfig] = deriveYieldConfigPda(payrollProgram.programId);
|
|
534
|
+
const [vault] = deriveYieldVaultPda(payrollProgram.programId);
|
|
535
|
+
const vaultUsdtAta = getAssociatedTokenAddressSync(usdtMint, vault, true);
|
|
536
|
+
const usdtDecimals = await getMintDecimals(payrollProgram.provider.connection, usdtMint);
|
|
537
|
+
const minUnlockAmount = new BN(BigNumber(params.minUnlockAmount)
|
|
538
|
+
.times(TEN_BIGNUM.pow(usdtDecimals))
|
|
539
|
+
.toFixed(0));
|
|
540
|
+
const ix = await createInitYieldConfigInstruction(payrollProgram, {
|
|
541
|
+
admin,
|
|
542
|
+
yieldConfig,
|
|
543
|
+
vault,
|
|
544
|
+
vaultUsdtAta,
|
|
545
|
+
usdtMint,
|
|
546
|
+
usxMint,
|
|
547
|
+
}, {
|
|
548
|
+
minUnlockAmount,
|
|
549
|
+
unlockCooldown: new BN(params.unlockCooldown),
|
|
550
|
+
});
|
|
551
|
+
return createPayload(payrollProgram, admin, [ix]);
|
|
552
|
+
}
|
|
553
|
+
export async function yieldDeposit(payrollProgram, params) {
|
|
554
|
+
const company = translateAddress(params.company);
|
|
555
|
+
const usdtMint = translateAddress(params.usdtMint);
|
|
556
|
+
const [companyDeposit] = deriveCompanyDepositPda(company, payrollProgram.programId);
|
|
557
|
+
const [yieldConfig] = deriveYieldConfigPda(payrollProgram.programId);
|
|
558
|
+
const [vault] = deriveYieldVaultPda(payrollProgram.programId);
|
|
559
|
+
const vaultUsdtAta = getAssociatedTokenAddressSync(usdtMint, vault, true);
|
|
560
|
+
const companyUsdtAta = getAssociatedTokenAddressSync(usdtMint, company, true);
|
|
561
|
+
const usdtDecimals = await getMintDecimals(payrollProgram.provider.connection, usdtMint);
|
|
562
|
+
const amount = new BN(BigNumber(params.amount).times(TEN_BIGNUM.pow(usdtDecimals)).toFixed(0));
|
|
563
|
+
const ix = await createYieldDepositInstruction(payrollProgram, {
|
|
564
|
+
company,
|
|
565
|
+
companyDeposit,
|
|
566
|
+
yieldConfig,
|
|
567
|
+
vault,
|
|
568
|
+
vaultUsdtAta,
|
|
569
|
+
companyUsdtAta,
|
|
570
|
+
usdtMint,
|
|
571
|
+
}, { amount });
|
|
572
|
+
return createPayload(payrollProgram, company, [ix]);
|
|
573
|
+
}
|
|
574
|
+
export async function unlockNow(payrollProgram, params) {
|
|
575
|
+
const admin = translateAddress(params.admin);
|
|
576
|
+
const company = translateAddress(params.company);
|
|
577
|
+
const usdtMint = translateAddress(params.usdtMint);
|
|
578
|
+
const feePayer = params.feePayer ? translateAddress(params.feePayer) : admin;
|
|
579
|
+
const [companyDeposit] = deriveCompanyDepositPda(company, payrollProgram.programId);
|
|
580
|
+
const [yieldConfig] = deriveYieldConfigPda(payrollProgram.programId);
|
|
581
|
+
const [vault] = deriveYieldVaultPda(payrollProgram.programId);
|
|
582
|
+
const vaultUsdtAta = getAssociatedTokenAddressSync(usdtMint, vault, true);
|
|
583
|
+
const companyUsdtAta = getAssociatedTokenAddressSync(usdtMint, company, true);
|
|
584
|
+
const ix = await createUnlockNowInstruction(payrollProgram, {
|
|
585
|
+
admin,
|
|
586
|
+
feePayer,
|
|
587
|
+
company,
|
|
588
|
+
companyDeposit,
|
|
589
|
+
yieldConfig,
|
|
590
|
+
vault,
|
|
591
|
+
vaultUsdtAta,
|
|
592
|
+
companyUsdtAta,
|
|
593
|
+
usdtMint,
|
|
594
|
+
});
|
|
595
|
+
return createPayload(payrollProgram, feePayer, [ix]);
|
|
596
|
+
}
|
|
597
|
+
export async function getCompanyDeposit(payrollProgram, company) {
|
|
598
|
+
const account = await payrollProgram.account.companyDeposit.fetch(translateAddress(company));
|
|
599
|
+
return account;
|
|
600
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export type PayrollMetadataInfo = {
|
|
|
55
55
|
initialBufferAmount: string;
|
|
56
56
|
topupCount: number;
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
payrollRunId: string;
|
|
59
59
|
};
|
|
60
60
|
export type TokenMetadata = {
|
|
61
61
|
mint: PublicKey;
|
|
@@ -88,7 +88,7 @@ export type CreatePayrollParams = {
|
|
|
88
88
|
startNow: boolean;
|
|
89
89
|
startTime: number;
|
|
90
90
|
autoWithdrawFrequency: number;
|
|
91
|
-
|
|
91
|
+
payrollRunId: string;
|
|
92
92
|
transferableByRecipient: boolean;
|
|
93
93
|
transferableBySender: boolean;
|
|
94
94
|
canTopup: boolean;
|
|
@@ -117,7 +117,7 @@ export type CreateMultiplePayrollParams = {
|
|
|
117
117
|
startNow: boolean;
|
|
118
118
|
startTime: number;
|
|
119
119
|
autoWithdrawFrequency: number;
|
|
120
|
-
|
|
120
|
+
payrollRunId: string;
|
|
121
121
|
transferableByRecipient: boolean;
|
|
122
122
|
transferableBySender: boolean;
|
|
123
123
|
canTopup: boolean;
|
|
@@ -166,6 +166,24 @@ export type SetTopupDelegateParams = {
|
|
|
166
166
|
payrollMetadata: Address;
|
|
167
167
|
amount: Numeric;
|
|
168
168
|
};
|
|
169
|
+
export type InitYieldConfigParams = {
|
|
170
|
+
admin: Address;
|
|
171
|
+
usdtMint: Address;
|
|
172
|
+
usxMint: Address;
|
|
173
|
+
minUnlockAmount: Numeric;
|
|
174
|
+
unlockCooldown: number;
|
|
175
|
+
};
|
|
176
|
+
export type YieldDepositParams = {
|
|
177
|
+
company: Address;
|
|
178
|
+
usdtMint: Address;
|
|
179
|
+
amount: Numeric;
|
|
180
|
+
};
|
|
181
|
+
export type UnlockNowParams = {
|
|
182
|
+
admin: Address;
|
|
183
|
+
feePayer?: Address;
|
|
184
|
+
company: Address;
|
|
185
|
+
usdtMint: Address;
|
|
186
|
+
};
|
|
169
187
|
export type PayrollFeeInfo = {
|
|
170
188
|
symbol: string;
|
|
171
189
|
chain: string;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@zebec-network/core-utils": "^1.2.0",
|
|
12
12
|
"@zebec-network/solana-common": "^2.6.0",
|
|
13
13
|
"@zebec-network/zebec_configs": "^1.1.1",
|
|
14
|
-
"@zebec-network/zebec_payroll": "^1.
|
|
14
|
+
"@zebec-network/zebec_payroll": "^1.4.0",
|
|
15
15
|
"bignumber.js": "^11.0.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
},
|
|
44
44
|
"type": "module",
|
|
45
45
|
"types": "dist/index.d.ts",
|
|
46
|
-
"version": "1.
|
|
46
|
+
"version": "2.1.0"
|
|
47
47
|
}
|