opnet 1.8.11 → 1.8.13
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/CHANGELOG.md +10 -0
- package/browser/_version.d.ts +1 -1
- package/browser/abi/shared/interfaces/motoswap/IMotoChef.d.ts +6 -11
- package/browser/index.js +28 -28
- package/browser/vendors.js +3 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/abi/shared/interfaces/motoswap/IMotoChef.d.ts +6 -11
- package/build/abi/shared/json/motoswap/MOTOCHEF_ABI.js +20 -24
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/abi/shared/interfaces/motoswap/IMotoChef.ts +16 -28
- package/src/abi/shared/json/motoswap/MOTOCHEF_ABI.ts +20 -24
package/CHANGELOG.md
CHANGED
package/browser/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.8.
|
|
1
|
+
export declare const version = "1.8.13";
|
|
@@ -72,13 +72,11 @@ export type EmergencyWithdrawnEvent = {
|
|
|
72
72
|
readonly amount: bigint;
|
|
73
73
|
readonly to: Address;
|
|
74
74
|
};
|
|
75
|
+
export type Update = CallResult<{}, OPNetEvent<never>[]>;
|
|
75
76
|
export type Initialize = CallResult<{}, OPNetEvent<PoolAddedEvent | InitializedEvent>[]>;
|
|
76
77
|
export type TotalAllocPoint = CallResult<{
|
|
77
78
|
totalAllocPoint: bigint;
|
|
78
79
|
}, OPNetEvent<never>[]>;
|
|
79
|
-
export type DevAddress = CallResult<{
|
|
80
|
-
devAddress: Address;
|
|
81
|
-
}, OPNetEvent<never>[]>;
|
|
82
80
|
export type GetMotoPerBlock = CallResult<{
|
|
83
81
|
motoPerBlock: bigint;
|
|
84
82
|
}, OPNetEvent<never>[]>;
|
|
@@ -143,15 +141,13 @@ export type EmergencyWithdraw = CallResult<{}, OPNetEvent<EmergencyWithdrawnEven
|
|
|
143
141
|
export type SetMotoPerBlock = CallResult<{}, OPNetEvent<never>[]>;
|
|
144
142
|
export type SetBonusEndBlock = CallResult<{}, OPNetEvent<never>[]>;
|
|
145
143
|
export type SetBonusMultiplier = CallResult<{}, OPNetEvent<never>[]>;
|
|
146
|
-
export type SetDev = CallResult<{}, OPNetEvent<never>[]>;
|
|
147
144
|
export type OnOP20Received = CallResult<{
|
|
148
145
|
selector: Uint8Array;
|
|
149
|
-
}, [
|
|
150
|
-
]>;
|
|
146
|
+
}, OPNetEvent<never>[]>;
|
|
151
147
|
export interface IMotoChef extends IOwnable {
|
|
152
|
-
|
|
148
|
+
update(sourceAddress: Address, updateCalldata: Uint8Array): Promise<Update>;
|
|
149
|
+
initialize(motoAddress: Address, premineAmount: bigint, premineRecipient: Address, motoPerBlock: bigint, bonusEndBlock: bigint, bonusMultiplier: bigint, treasuryAddress: string, BTCAllocPoint: bigint, MOTOAllocPoint: bigint): Promise<Initialize>;
|
|
153
150
|
totalAllocPoint(): Promise<TotalAllocPoint>;
|
|
154
|
-
devAddress(): Promise<DevAddress>;
|
|
155
151
|
getMotoPerBlock(): Promise<GetMotoPerBlock>;
|
|
156
152
|
getBonusEndBlock(): Promise<GetBonusEndBlock>;
|
|
157
153
|
getBonusMultiplier(): Promise<GetBonusMultiplier>;
|
|
@@ -170,7 +166,7 @@ export interface IMotoChef extends IOwnable {
|
|
|
170
166
|
unstakeBTC(): Promise<UnstakeBTC>;
|
|
171
167
|
removeBTCStake(user: Address): Promise<RemoveBTCStake>;
|
|
172
168
|
add(allocPoint: bigint, lpToken: Address): Promise<Add>;
|
|
173
|
-
set(poolId: number, allocPoint: bigint): Promise<Set>;
|
|
169
|
+
set(poolId: number, allocPoint: bigint, withUpdate: number): Promise<Set>;
|
|
174
170
|
updatePool(poolId: number): Promise<UpdatePool>;
|
|
175
171
|
massUpdatePools(length: number, poolIds: number[]): Promise<MassUpdatePools>;
|
|
176
172
|
deposit(poolId: number, amount: bigint, to: Address): Promise<Deposit>;
|
|
@@ -178,10 +174,9 @@ export interface IMotoChef extends IOwnable {
|
|
|
178
174
|
harvest(poolId: number, to: Address): Promise<Harvest>;
|
|
179
175
|
withdrawAndHarvest(poolId: number, amount: bigint, to: Address): Promise<WithdrawAndHarvest>;
|
|
180
176
|
emergencyWithdraw(poolId: number, to: Address): Promise<EmergencyWithdraw>;
|
|
177
|
+
onOP20Received(operator: Address, from: Address, amount: bigint, data: Uint8Array): Promise<OnOP20Received>;
|
|
181
178
|
setMotoPerBlock(motoPerBlock: bigint): Promise<SetMotoPerBlock>;
|
|
182
179
|
setBonusEndBlock(bonusEndBlock: bigint): Promise<SetBonusEndBlock>;
|
|
183
180
|
setBonusMultiplier(bonusMultiplier: bigint): Promise<SetBonusMultiplier>;
|
|
184
|
-
setDev(devAddress: Address): Promise<SetDev>;
|
|
185
|
-
onOP20Received(operator: Address, from: Address, amount: bigint, data: Uint8Array): Promise<OnOP20Received>;
|
|
186
181
|
}
|
|
187
182
|
export {};
|
package/browser/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { a as __toESM, r as __exportAll } from "./rolldown-runtime.js";
|
|
|
2
2
|
import { A as bitcoin, C as AddressVerificator, D as fromHex, E as toBase64, M as regtest, N as testnet, O as toHex, S as AddressTypes, T as fromBase64, _ as BinaryWriter, a as ABICoder, b as AddressMap, c as isAbiTuple, d as process$1, f as P2MR_MS, g as Logger, h as TransactionFactory, i as NetEvent, j as opnetTestnet, k as fromBech32, l as ABIDataTypes, m as ChallengeSolution, n as Long, o as abiTypeToSelectorString, p as P2TR_MS, r as pLimit, s as isAbiStruct, t as BigNumber, u as init_dist, v as BinaryReader, w as decompile, x as Address, y as BufferHelper } from "./vendors.js";
|
|
3
3
|
import { t as require_protobuf_min } from "./protobuf.js";
|
|
4
4
|
//#region src/_version.ts
|
|
5
|
-
var version = "1.8.
|
|
5
|
+
var version = "1.8.13";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/interfaces/opnet/OPNetTransactionTypes.ts
|
|
8
8
|
var OPNetTransactionTypes = /* @__PURE__ */ function(OPNetTransactionTypes) {
|
|
@@ -6629,6 +6629,18 @@ var MotoChefEvents = [
|
|
|
6629
6629
|
}
|
|
6630
6630
|
];
|
|
6631
6631
|
var MOTOCHEF_ABI = [
|
|
6632
|
+
{
|
|
6633
|
+
name: "update",
|
|
6634
|
+
type: BitcoinAbiTypes.Function,
|
|
6635
|
+
inputs: [{
|
|
6636
|
+
name: "sourceAddress",
|
|
6637
|
+
type: ABIDataTypes.ADDRESS
|
|
6638
|
+
}, {
|
|
6639
|
+
name: "updateCalldata",
|
|
6640
|
+
type: ABIDataTypes.BYTES
|
|
6641
|
+
}],
|
|
6642
|
+
outputs: []
|
|
6643
|
+
},
|
|
6632
6644
|
{
|
|
6633
6645
|
name: "initialize",
|
|
6634
6646
|
type: BitcoinAbiTypes.Function,
|
|
@@ -6642,7 +6654,7 @@ var MOTOCHEF_ABI = [
|
|
|
6642
6654
|
type: ABIDataTypes.UINT256
|
|
6643
6655
|
},
|
|
6644
6656
|
{
|
|
6645
|
-
name: "
|
|
6657
|
+
name: "premineRecipient",
|
|
6646
6658
|
type: ABIDataTypes.ADDRESS
|
|
6647
6659
|
},
|
|
6648
6660
|
{
|
|
@@ -6682,16 +6694,6 @@ var MOTOCHEF_ABI = [
|
|
|
6682
6694
|
type: ABIDataTypes.UINT256
|
|
6683
6695
|
}]
|
|
6684
6696
|
},
|
|
6685
|
-
{
|
|
6686
|
-
name: "devAddress",
|
|
6687
|
-
type: BitcoinAbiTypes.Function,
|
|
6688
|
-
constant: true,
|
|
6689
|
-
inputs: [],
|
|
6690
|
-
outputs: [{
|
|
6691
|
-
name: "devAddress",
|
|
6692
|
-
type: ABIDataTypes.ADDRESS
|
|
6693
|
-
}]
|
|
6694
|
-
},
|
|
6695
6697
|
{
|
|
6696
6698
|
name: "getMotoPerBlock",
|
|
6697
6699
|
type: BitcoinAbiTypes.Function,
|
|
@@ -6914,13 +6916,20 @@ var MOTOCHEF_ABI = [
|
|
|
6914
6916
|
{
|
|
6915
6917
|
name: "set",
|
|
6916
6918
|
type: BitcoinAbiTypes.Function,
|
|
6917
|
-
inputs: [
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6919
|
+
inputs: [
|
|
6920
|
+
{
|
|
6921
|
+
name: "poolId",
|
|
6922
|
+
type: ABIDataTypes.UINT32
|
|
6923
|
+
},
|
|
6924
|
+
{
|
|
6925
|
+
name: "allocPoint",
|
|
6926
|
+
type: ABIDataTypes.UINT256
|
|
6927
|
+
},
|
|
6928
|
+
{
|
|
6929
|
+
name: "withUpdate",
|
|
6930
|
+
type: ABIDataTypes.UINT8
|
|
6931
|
+
}
|
|
6932
|
+
],
|
|
6924
6933
|
outputs: []
|
|
6925
6934
|
},
|
|
6926
6935
|
{
|
|
@@ -7091,15 +7100,6 @@ var MOTOCHEF_ABI = [
|
|
|
7091
7100
|
}],
|
|
7092
7101
|
outputs: []
|
|
7093
7102
|
},
|
|
7094
|
-
{
|
|
7095
|
-
name: "setDev",
|
|
7096
|
-
type: BitcoinAbiTypes.Function,
|
|
7097
|
-
inputs: [{
|
|
7098
|
-
name: "devAddress",
|
|
7099
|
-
type: ABIDataTypes.ADDRESS
|
|
7100
|
-
}],
|
|
7101
|
-
outputs: []
|
|
7102
|
-
},
|
|
7103
7103
|
...OwnableEvents,
|
|
7104
7104
|
...OWNABLE_ABI,
|
|
7105
7105
|
...MotoChefEvents,
|
package/browser/vendors.js
CHANGED
|
@@ -30650,7 +30650,8 @@ var TransactionFactory = class {
|
|
|
30650
30650
|
const total = await tx.estimateTransactionFees() + tx.getTotalOutputValue();
|
|
30651
30651
|
if (interactionParameters.subtractExtraUTXOFromAmountRequired && interactionParameters.optionalInputs && interactionParameters.optionalInputs.length > 0) {
|
|
30652
30652
|
const optionalInputValue = interactionParameters.optionalInputs.reduce((sum, input) => sum + input.value, 0n);
|
|
30653
|
-
|
|
30653
|
+
const adjusted = total > optionalInputValue ? total - optionalInputValue : 0n;
|
|
30654
|
+
return adjusted < TransactionBuilder.MINIMUM_DUST ? TransactionBuilder.MINIMUM_DUST : adjusted;
|
|
30654
30655
|
}
|
|
30655
30656
|
return total;
|
|
30656
30657
|
}, "Interaction");
|
|
@@ -31086,6 +31087,7 @@ var TransactionFactory = class {
|
|
|
31086
31087
|
if (this.debug) console.log(`${debugPrefix} Iteration ${iterations}: Previous=${previousAmount}, New=${estimatedFundingAmount}`);
|
|
31087
31088
|
}
|
|
31088
31089
|
if (!finalPreTransaction) throw new Error(`Failed to converge on ${debugPrefix} funding amount`);
|
|
31090
|
+
if (estimatedFundingAmount === 0n) throw new Error(`Impossible. Transaction cant be free.`);
|
|
31089
31091
|
return {
|
|
31090
31092
|
finalTransaction: finalPreTransaction,
|
|
31091
31093
|
estimatedAmount: estimatedFundingAmount,
|
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.8.
|
|
1
|
+
export declare const version = "1.8.13";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.8.
|
|
1
|
+
export const version = '1.8.13';
|
|
@@ -72,13 +72,11 @@ export type EmergencyWithdrawnEvent = {
|
|
|
72
72
|
readonly amount: bigint;
|
|
73
73
|
readonly to: Address;
|
|
74
74
|
};
|
|
75
|
+
export type Update = CallResult<{}, OPNetEvent<never>[]>;
|
|
75
76
|
export type Initialize = CallResult<{}, OPNetEvent<PoolAddedEvent | InitializedEvent>[]>;
|
|
76
77
|
export type TotalAllocPoint = CallResult<{
|
|
77
78
|
totalAllocPoint: bigint;
|
|
78
79
|
}, OPNetEvent<never>[]>;
|
|
79
|
-
export type DevAddress = CallResult<{
|
|
80
|
-
devAddress: Address;
|
|
81
|
-
}, OPNetEvent<never>[]>;
|
|
82
80
|
export type GetMotoPerBlock = CallResult<{
|
|
83
81
|
motoPerBlock: bigint;
|
|
84
82
|
}, OPNetEvent<never>[]>;
|
|
@@ -143,15 +141,13 @@ export type EmergencyWithdraw = CallResult<{}, OPNetEvent<EmergencyWithdrawnEven
|
|
|
143
141
|
export type SetMotoPerBlock = CallResult<{}, OPNetEvent<never>[]>;
|
|
144
142
|
export type SetBonusEndBlock = CallResult<{}, OPNetEvent<never>[]>;
|
|
145
143
|
export type SetBonusMultiplier = CallResult<{}, OPNetEvent<never>[]>;
|
|
146
|
-
export type SetDev = CallResult<{}, OPNetEvent<never>[]>;
|
|
147
144
|
export type OnOP20Received = CallResult<{
|
|
148
145
|
selector: Uint8Array;
|
|
149
|
-
}, [
|
|
150
|
-
]>;
|
|
146
|
+
}, OPNetEvent<never>[]>;
|
|
151
147
|
export interface IMotoChef extends IOwnable {
|
|
152
|
-
|
|
148
|
+
update(sourceAddress: Address, updateCalldata: Uint8Array): Promise<Update>;
|
|
149
|
+
initialize(motoAddress: Address, premineAmount: bigint, premineRecipient: Address, motoPerBlock: bigint, bonusEndBlock: bigint, bonusMultiplier: bigint, treasuryAddress: string, BTCAllocPoint: bigint, MOTOAllocPoint: bigint): Promise<Initialize>;
|
|
153
150
|
totalAllocPoint(): Promise<TotalAllocPoint>;
|
|
154
|
-
devAddress(): Promise<DevAddress>;
|
|
155
151
|
getMotoPerBlock(): Promise<GetMotoPerBlock>;
|
|
156
152
|
getBonusEndBlock(): Promise<GetBonusEndBlock>;
|
|
157
153
|
getBonusMultiplier(): Promise<GetBonusMultiplier>;
|
|
@@ -170,7 +166,7 @@ export interface IMotoChef extends IOwnable {
|
|
|
170
166
|
unstakeBTC(): Promise<UnstakeBTC>;
|
|
171
167
|
removeBTCStake(user: Address): Promise<RemoveBTCStake>;
|
|
172
168
|
add(allocPoint: bigint, lpToken: Address): Promise<Add>;
|
|
173
|
-
set(poolId: number, allocPoint: bigint): Promise<Set>;
|
|
169
|
+
set(poolId: number, allocPoint: bigint, withUpdate: number): Promise<Set>;
|
|
174
170
|
updatePool(poolId: number): Promise<UpdatePool>;
|
|
175
171
|
massUpdatePools(length: number, poolIds: number[]): Promise<MassUpdatePools>;
|
|
176
172
|
deposit(poolId: number, amount: bigint, to: Address): Promise<Deposit>;
|
|
@@ -178,10 +174,9 @@ export interface IMotoChef extends IOwnable {
|
|
|
178
174
|
harvest(poolId: number, to: Address): Promise<Harvest>;
|
|
179
175
|
withdrawAndHarvest(poolId: number, amount: bigint, to: Address): Promise<WithdrawAndHarvest>;
|
|
180
176
|
emergencyWithdraw(poolId: number, to: Address): Promise<EmergencyWithdraw>;
|
|
177
|
+
onOP20Received(operator: Address, from: Address, amount: bigint, data: Uint8Array): Promise<OnOP20Received>;
|
|
181
178
|
setMotoPerBlock(motoPerBlock: bigint): Promise<SetMotoPerBlock>;
|
|
182
179
|
setBonusEndBlock(bonusEndBlock: bigint): Promise<SetBonusEndBlock>;
|
|
183
180
|
setBonusMultiplier(bonusMultiplier: bigint): Promise<SetBonusMultiplier>;
|
|
184
|
-
setDev(devAddress: Address): Promise<SetDev>;
|
|
185
|
-
onOP20Received(operator: Address, from: Address, amount: bigint, data: Uint8Array): Promise<OnOP20Received>;
|
|
186
181
|
}
|
|
187
182
|
export {};
|
|
@@ -256,6 +256,21 @@ const MotoChefEvents = [
|
|
|
256
256
|
},
|
|
257
257
|
];
|
|
258
258
|
export const MOTOCHEF_ABI = [
|
|
259
|
+
{
|
|
260
|
+
name: 'update',
|
|
261
|
+
type: BitcoinAbiTypes.Function,
|
|
262
|
+
inputs: [
|
|
263
|
+
{
|
|
264
|
+
name: 'sourceAddress',
|
|
265
|
+
type: ABIDataTypes.ADDRESS,
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: 'updateCalldata',
|
|
269
|
+
type: ABIDataTypes.BYTES,
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
outputs: [],
|
|
273
|
+
},
|
|
259
274
|
{
|
|
260
275
|
name: 'initialize',
|
|
261
276
|
type: BitcoinAbiTypes.Function,
|
|
@@ -269,7 +284,7 @@ export const MOTOCHEF_ABI = [
|
|
|
269
284
|
type: ABIDataTypes.UINT256,
|
|
270
285
|
},
|
|
271
286
|
{
|
|
272
|
-
name: '
|
|
287
|
+
name: 'premineRecipient',
|
|
273
288
|
type: ABIDataTypes.ADDRESS,
|
|
274
289
|
},
|
|
275
290
|
{
|
|
@@ -311,18 +326,6 @@ export const MOTOCHEF_ABI = [
|
|
|
311
326
|
},
|
|
312
327
|
],
|
|
313
328
|
},
|
|
314
|
-
{
|
|
315
|
-
name: 'devAddress',
|
|
316
|
-
type: BitcoinAbiTypes.Function,
|
|
317
|
-
constant: true,
|
|
318
|
-
inputs: [],
|
|
319
|
-
outputs: [
|
|
320
|
-
{
|
|
321
|
-
name: 'devAddress',
|
|
322
|
-
type: ABIDataTypes.ADDRESS,
|
|
323
|
-
},
|
|
324
|
-
],
|
|
325
|
-
},
|
|
326
329
|
{
|
|
327
330
|
name: 'getMotoPerBlock',
|
|
328
331
|
type: BitcoinAbiTypes.Function,
|
|
@@ -605,6 +608,10 @@ export const MOTOCHEF_ABI = [
|
|
|
605
608
|
name: 'allocPoint',
|
|
606
609
|
type: ABIDataTypes.UINT256,
|
|
607
610
|
},
|
|
611
|
+
{
|
|
612
|
+
name: 'withUpdate',
|
|
613
|
+
type: ABIDataTypes.UINT8,
|
|
614
|
+
},
|
|
608
615
|
],
|
|
609
616
|
outputs: [],
|
|
610
617
|
},
|
|
@@ -795,17 +802,6 @@ export const MOTOCHEF_ABI = [
|
|
|
795
802
|
],
|
|
796
803
|
outputs: [],
|
|
797
804
|
},
|
|
798
|
-
{
|
|
799
|
-
name: 'setDev',
|
|
800
|
-
type: BitcoinAbiTypes.Function,
|
|
801
|
-
inputs: [
|
|
802
|
-
{
|
|
803
|
-
name: 'devAddress',
|
|
804
|
-
type: ABIDataTypes.ADDRESS,
|
|
805
|
-
},
|
|
806
|
-
],
|
|
807
|
-
outputs: [],
|
|
808
|
-
},
|
|
809
805
|
...OwnableEvents,
|
|
810
806
|
...OWNABLE_ABI,
|
|
811
807
|
...MotoChefEvents,
|