@alephium/powfi-sdk 0.0.1-rc.13 → 0.0.1-rc.16
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/lib/index.d.mts +4 -3
- package/lib/index.d.ts +4 -3
- package/lib/index.js +13 -9
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +14 -9
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/staking/staking.ts +2 -0
- package/staking/artifacts/AlphUnstakeVault.ral.json +3 -2
- package/staking/artifacts/XAlphToken.ral.json +5 -3
- package/staking/artifacts/ts/AlphUnstakeVault.ts +3 -3
- package/staking/artifacts/ts/XAlphToken.ts +4 -3
package/lib/index.d.mts
CHANGED
|
@@ -4490,7 +4490,7 @@ declare namespace AlphUnstakeVaultTypes {
|
|
|
4490
4490
|
};
|
|
4491
4491
|
cancelAndReturn: {
|
|
4492
4492
|
params: Omit<CallContractParams<{}>, "args">;
|
|
4493
|
-
result: CallContractResult<bigint>;
|
|
4493
|
+
result: CallContractResult<[bigint, bigint]>;
|
|
4494
4494
|
};
|
|
4495
4495
|
destroy: {
|
|
4496
4496
|
params: Omit<CallContractParams<{}>, "args">;
|
|
@@ -4572,7 +4572,7 @@ declare class Factory$i extends ContractFactory<AlphUnstakeVaultInstance, AlphUn
|
|
|
4572
4572
|
claim: (params: TestContractParamsWithoutMaps<AlphUnstakeVaultTypes.Fields, {
|
|
4573
4573
|
amount: bigint;
|
|
4574
4574
|
}>) => Promise<TestContractResultWithoutMaps<boolean>>;
|
|
4575
|
-
cancelAndReturn: (params: Omit<TestContractParamsWithoutMaps<AlphUnstakeVaultTypes.Fields, never>, "args">) => Promise<TestContractResultWithoutMaps<bigint>>;
|
|
4575
|
+
cancelAndReturn: (params: Omit<TestContractParamsWithoutMaps<AlphUnstakeVaultTypes.Fields, never>, "args">) => Promise<TestContractResultWithoutMaps<[bigint, bigint]>>;
|
|
4576
4576
|
destroy: (params: Omit<TestContractParamsWithoutMaps<AlphUnstakeVaultTypes.Fields, never>, "args">) => Promise<TestContractResultWithoutMaps<null>>;
|
|
4577
4577
|
};
|
|
4578
4578
|
stateForTest(initFields: AlphUnstakeVaultTypes.Fields, asset?: Asset, address?: string): ContractState<AlphUnstakeVaultTypes.Fields> | _alephium_web3.ContractStateWithMaps<AlphUnstakeVaultTypes.Fields, Record<string, Map<_alephium_web3.Val, _alephium_web3.Val>>>;
|
|
@@ -6223,7 +6223,8 @@ declare namespace XAlphTokenTypes {
|
|
|
6223
6223
|
type UnstakeCancelledEvent = ContractEvent<{
|
|
6224
6224
|
to: Address;
|
|
6225
6225
|
xAlphAmount: bigint;
|
|
6226
|
-
|
|
6226
|
+
claimedAlphAmount: bigint;
|
|
6227
|
+
restakedAlphAmount: bigint;
|
|
6227
6228
|
}>;
|
|
6228
6229
|
type RewardDepositedEvent = ContractEvent<{
|
|
6229
6230
|
from: Address;
|
package/lib/index.d.ts
CHANGED
|
@@ -4490,7 +4490,7 @@ declare namespace AlphUnstakeVaultTypes {
|
|
|
4490
4490
|
};
|
|
4491
4491
|
cancelAndReturn: {
|
|
4492
4492
|
params: Omit<CallContractParams<{}>, "args">;
|
|
4493
|
-
result: CallContractResult<bigint>;
|
|
4493
|
+
result: CallContractResult<[bigint, bigint]>;
|
|
4494
4494
|
};
|
|
4495
4495
|
destroy: {
|
|
4496
4496
|
params: Omit<CallContractParams<{}>, "args">;
|
|
@@ -4572,7 +4572,7 @@ declare class Factory$i extends ContractFactory<AlphUnstakeVaultInstance, AlphUn
|
|
|
4572
4572
|
claim: (params: TestContractParamsWithoutMaps<AlphUnstakeVaultTypes.Fields, {
|
|
4573
4573
|
amount: bigint;
|
|
4574
4574
|
}>) => Promise<TestContractResultWithoutMaps<boolean>>;
|
|
4575
|
-
cancelAndReturn: (params: Omit<TestContractParamsWithoutMaps<AlphUnstakeVaultTypes.Fields, never>, "args">) => Promise<TestContractResultWithoutMaps<bigint>>;
|
|
4575
|
+
cancelAndReturn: (params: Omit<TestContractParamsWithoutMaps<AlphUnstakeVaultTypes.Fields, never>, "args">) => Promise<TestContractResultWithoutMaps<[bigint, bigint]>>;
|
|
4576
4576
|
destroy: (params: Omit<TestContractParamsWithoutMaps<AlphUnstakeVaultTypes.Fields, never>, "args">) => Promise<TestContractResultWithoutMaps<null>>;
|
|
4577
4577
|
};
|
|
4578
4578
|
stateForTest(initFields: AlphUnstakeVaultTypes.Fields, asset?: Asset, address?: string): ContractState<AlphUnstakeVaultTypes.Fields> | _alephium_web3.ContractStateWithMaps<AlphUnstakeVaultTypes.Fields, Record<string, Map<_alephium_web3.Val, _alephium_web3.Val>>>;
|
|
@@ -6223,7 +6223,8 @@ declare namespace XAlphTokenTypes {
|
|
|
6223
6223
|
type UnstakeCancelledEvent = ContractEvent<{
|
|
6224
6224
|
to: Address;
|
|
6225
6225
|
xAlphAmount: bigint;
|
|
6226
|
-
|
|
6226
|
+
claimedAlphAmount: bigint;
|
|
6227
|
+
restakedAlphAmount: bigint;
|
|
6227
6228
|
}>;
|
|
6228
6229
|
type RewardDepositedEvent = ContractEvent<{
|
|
6229
6230
|
from: Address;
|
package/lib/index.js
CHANGED
|
@@ -16596,8 +16596,8 @@ var import_web333 = require("@alephium/web3");
|
|
|
16596
16596
|
var AlphUnstakeVault_ral_default = {
|
|
16597
16597
|
version: "v4.3.1",
|
|
16598
16598
|
name: "AlphUnstakeVault",
|
|
16599
|
-
bytecode: "
|
|
16600
|
-
codeHash: "
|
|
16599
|
+
bytecode: "060640ea40f84138417241ac41c60000030901409216020c3013415e7b160016010c0d3687170316001601371704160316043616031604314c020d4a010c36170516050c2f4c04160416022d02160216053313415f7b160016011602871706160516061604334c020d4a010c361705160416063617040c1602361602381707160216072d1702160416072d17040c16073616072d0d351707160416051607373917040f1602370e3a170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e160216083736371708160416083702010000000103d3f10c9d97ce020201000003014020d3223281b2ce040c3313167b5617001600ce033413177b1600ce032b1701ce0217021601ce04314c0516021601ce04000017021602a0002b0201020102011fd30e00e856b417011601ce0077457a4b04181601ce014513147b160000023213157bce011600a8a00016002aa100a000ce022f0201020004021ed34a517d1bb417001600ce00774513147b00021701ce02a0002b1702160216012b170316030c334c04ce00771603a8160116030201020001000bd38e18691cb417001600ce00774513147bce01b0",
|
|
16600
|
+
codeHash: "a065f4a88edfe06c09d65e3c11154fe9d5a5b1cdc42b36adf1a3485ff8a51394",
|
|
16601
16601
|
fieldsSig: {
|
|
16602
16602
|
names: [
|
|
16603
16603
|
"xalphToken",
|
|
@@ -16686,6 +16686,7 @@ var AlphUnstakeVault_ral_default = {
|
|
|
16686
16686
|
paramTypes: [],
|
|
16687
16687
|
paramIsMutable: [],
|
|
16688
16688
|
returnTypes: [
|
|
16689
|
+
"U256",
|
|
16689
16690
|
"U256"
|
|
16690
16691
|
]
|
|
16691
16692
|
},
|
|
@@ -16888,7 +16889,7 @@ var AlphUnstakeVault = new Factory25(
|
|
|
16888
16889
|
import_web333.Contract.fromJson(
|
|
16889
16890
|
AlphUnstakeVault_ral_default,
|
|
16890
16891
|
"",
|
|
16891
|
-
"
|
|
16892
|
+
"a065f4a88edfe06c09d65e3c11154fe9d5a5b1cdc42b36adf1a3485ff8a51394",
|
|
16892
16893
|
AllStructs2
|
|
16893
16894
|
)
|
|
16894
16895
|
);
|
|
@@ -20370,8 +20371,8 @@ var import_web344 = require("@alephium/web3");
|
|
|
20370
20371
|
var XAlphToken_ral_default = {
|
|
20371
20372
|
version: "v4.3.1",
|
|
20372
20373
|
name: "XAlphToken",
|
|
20373
|
-
bytecode: "
|
|
20374
|
-
codeHash: "
|
|
20374
|
+
bytecode: "0a1509121b40244051407a40ac40ca4117414741654173425d426b42c643b243e0441a443c44c54593010000000102ce0002010000000102ce0102010000000102ce0202010000000102a00102010002040115d3cee9319416011600000a311342277b160113202c170216001602160213202a62170316037102010002030114d33cd5e72916004313202e0c2f1342267b16004313202d1702160016010c1602000802010002030119d32cabd28216004313202e0c2f1342267b160016010005170216020b244c031600024a05160016023d00090201000202010ed31bc25d3416004313202e0c2f1342267b160016016b44020000040601402a16021603344c020b02160216032a0e2d17041600160400041705160516012f4c0316043f0216051601314c091600160116040d2a16030008024a061600160116021604000802010002030118d34b2e25b716011600000a311342277b160113202c170216000c1602621600160213202a16004362440201000101010ed30041471116004313202e0c2f1342267b16004313202d02010000000103d3676c3c331400020000030901409216020c3013415e7b160016010c0d3687170316001601371704160316043616031604314c020d4a010c36170516050c2f4c04160416022d02160216053313415f7b160016011602871706160516061604334c020d4a010c361705160416063617040c1602361602381707160216072d1702160416072d17040c16073616072d0d351707160416051607373917040f1602370e3a170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e160216083736371708160416083702010000000103d38719c92ea0000201010103014032d38bbc9beeb41701160148130a7b16000c33130e7ba0010c2f4c0216004a041600a001a000000c170216020c33130f7b1601b11602ab16011600a9a00016002aa100a00116022aa101051601160016026016020201010107014078d33538a49fb41701160148130a7bce050c33130c7b16000c33130e7b1600a000a001000c170216020c3313107ba0020d2aa102140a5f5f6d61705f5f305f5f16014744cbc54c1d0c0d0d140a5f5f6d61705f5f305f5f16014744cb010117031603000ace0431130b7b1603a00200070c0e0c140a5f5f6d61705f5f305f5f16014744cb01024a09ca140a5f5f6d61705f5f305f5f16014744b1a0026bd201011601b11600acb11601160256ce051305640c13016417051704b21602a2160147a0024044ce0316041605c11706a00016022ba100a00116002ba1010616011600160260160602010701020018d3fe1110a1b4170116000c33130e7ba0010c3313117b16011600a9a00016002aa10008160116005f010001010115d38072397d140a5f5f6d61705f5f305f5f16004744cbc5194c021400020c0d0d140a5f5f6d61705f5f305f5f16004744cb010102010002030111d3fd3d3af616004716014044cb17021602c5130d7b0c0d160201020201000206004040d38bb32147b4170216024716004044cb170316010c33130e7b16010d0d16030103170416044c40290c0d0d140a5f5f6d61705f5f305f5f16024744cb01011600000617051605430c2f4c0a16020d0c140a5f5f6d61705f5f305f5f16024744cb01034a0a16050c0e0c140a5f5f6d61705f5f305f5f16024744cb01020c0c160301050102010701406bd30bdc6a97b41701160148130a7b16014716004044cb17021602c5130d7b0c0e16020104170417030c0c160201050c170516040c334c1ca0010c2f4c0216044a041604a001a000000c170516050c33130f7b1601b11605aba00016042aa100a00116052aa1010c0d0d140a5f5f6d61705f5f305f5f16014744cb01011600000617061606430c2f4c0a16010d0c140a5f5f6d61705f5f305f5f16014744cb01034a0a16060c0e0c140a5f5f6d61705f5f305f5f16014744cb010207160116051603160461160502",
|
|
20375
|
+
codeHash: "3329d0319da90857686a9e618c3fa8197226ed9be58b7371314b3247d9fd8e1c",
|
|
20375
20376
|
fieldsSig: {
|
|
20376
20377
|
names: [
|
|
20377
20378
|
"symbol",
|
|
@@ -20442,11 +20443,13 @@ var XAlphToken_ral_default = {
|
|
|
20442
20443
|
fieldNames: [
|
|
20443
20444
|
"to",
|
|
20444
20445
|
"xAlphAmount",
|
|
20445
|
-
"
|
|
20446
|
+
"claimedAlphAmount",
|
|
20447
|
+
"restakedAlphAmount"
|
|
20446
20448
|
],
|
|
20447
20449
|
fieldTypes: [
|
|
20448
20450
|
"Address",
|
|
20449
20451
|
"U256",
|
|
20452
|
+
"U256",
|
|
20450
20453
|
"U256"
|
|
20451
20454
|
]
|
|
20452
20455
|
},
|
|
@@ -21028,8 +21031,8 @@ var Factory33 = class extends import_web344.ContractFactory {
|
|
|
21028
21031
|
var XAlphToken = new Factory33(
|
|
21029
21032
|
import_web344.Contract.fromJson(
|
|
21030
21033
|
XAlphToken_ral_default,
|
|
21031
|
-
"=60+c=1-1=2-6+f9=3-1+3=2-1+5=2+4f74=1-2+
|
|
21032
|
-
"
|
|
21034
|
+
"=60+c=1-1=2-6+f9=3-1+3=2-1+5=2+4f74=1-2+de=1433-1+a=269-1+b=34+7a7e0214696e73657274206174206d617020706174683a2000=443-1+2=79-1+b=69-1+c=40+7a7e021472656d6f7665206174206d617020706174683a2000=83-1+d=273-1+c=40+7a7e021472656d6f7665206174206d617020706174683a2000=84",
|
|
21035
|
+
"1a0bd323d964c45cd5451b7d7d049316f533d194800f0fe76892bddee137f8ce",
|
|
21033
21036
|
AllStructs2
|
|
21034
21037
|
)
|
|
21035
21038
|
);
|
|
@@ -21752,7 +21755,8 @@ var StakingModule = class extends ModuleBase {
|
|
|
21752
21755
|
async cancelUnstake(vaultIndex) {
|
|
21753
21756
|
return this.xAlphTokenContract.transact.cancelUnstake({
|
|
21754
21757
|
signer: this.scope.signer,
|
|
21755
|
-
args: { vaultIndex }
|
|
21758
|
+
args: { vaultIndex },
|
|
21759
|
+
attoAlphAmount: import_web347.DUST_AMOUNT
|
|
21756
21760
|
});
|
|
21757
21761
|
}
|
|
21758
21762
|
async stakeXAlph(amount) {
|