opnet 1.0.20 → 1.0.22
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/README.md +2 -2
- package/browser/_version.d.ts +1 -1
- package/browser/abi/BitcoinInterface.d.ts +1 -0
- package/browser/abi/interfaces/BaseContractProperties.d.ts +2 -1
- package/browser/abi/interfaces/BitcoinInterfaceAbi.d.ts +10 -5
- package/browser/block/interfaces/BlockWitness.d.ts +11 -0
- package/browser/contracts/CallResult.d.ts +4 -2
- package/browser/contracts/Contract.d.ts +13 -1
- package/browser/contracts/ContractData.d.ts +5 -3
- package/browser/contracts/OPNetEvent.d.ts +15 -0
- package/browser/contracts/interfaces/IContract.d.ts +5 -0
- package/browser/contracts/interfaces/IRawContract.d.ts +5 -3
- package/browser/generator/WrappedGenerationParameters.d.ts +9 -0
- package/browser/index.js +1 -1
- package/browser/index.js.LICENSE.txt +2 -0
- package/browser/interfaces/opnet/OPNetTransactionTypes.d.ts +4 -1
- package/browser/opnet.d.ts +18 -7
- package/browser/providers/AbstractRpcProvider.d.ts +10 -2
- package/browser/providers/interfaces/Generate.d.ts +19 -0
- package/browser/providers/interfaces/ReorgInformation.d.ts +5 -0
- package/browser/scripts/ITestContract.d.ts +9 -0
- package/browser/scripts/testMethodsReg.d.ts +1 -0
- package/browser/transactions/DeploymentTransaction.d.ts +1 -0
- package/browser/transactions/InteractionTransaction.d.ts +2 -4
- package/browser/transactions/Transaction.d.ts +5 -5
- package/browser/transactions/TransactionReceipt.d.ts +5 -4
- package/browser/transactions/decoders/DeploymentTransaction.d.ts +17 -0
- package/browser/transactions/decoders/GenericTransaction.d.ts +6 -0
- package/browser/transactions/decoders/InteractionTransaction.d.ts +15 -0
- package/browser/transactions/decoders/WrapTransaction.d.ts +15 -0
- package/browser/transactions/interfaces/BroadcastedTransaction.d.ts +7 -0
- package/browser/transactions/interfaces/ITransaction.d.ts +9 -25
- package/browser/transactions/interfaces/ITransactionReceipt.d.ts +16 -3
- package/browser/transactions/interfaces/transactions/ICommonTransaction.d.ts +7 -0
- package/browser/transactions/interfaces/transactions/IDeploymentTransaction.d.ts +13 -0
- package/browser/transactions/interfaces/transactions/IInteractionTransaction.d.ts +14 -0
- package/browser/transactions/interfaces/transactions/IWrapTransaction.d.ts +10 -0
- package/browser/transactions/metadata/TransactionInput.d.ts +16 -0
- package/browser/transactions/metadata/TransactionOutput.d.ts +19 -0
- package/browser/transactions/metadata/TransactionReceipt.d.ts +11 -0
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/contracts/ContractData.d.ts +5 -3
- package/build/contracts/ContractData.js +2 -0
- package/build/contracts/interfaces/IRawContract.d.ts +5 -3
- package/build/interfaces/opnet/OPNetTransactionTypes.d.ts +4 -1
- package/build/interfaces/opnet/OPNetTransactionTypes.js +2 -0
- package/build/opnet.d.ts +11 -6
- package/build/opnet.js +11 -6
- package/build/providers/AbstractRpcProvider.d.ts +1 -1
- package/build/providers/AbstractRpcProvider.js +1 -1
- package/build/scripts/ITestContract.d.ts +2 -2
- package/build/scripts/ITestContract.js +1 -1
- package/build/scripts/testContract.js +2 -2
- package/build/scripts/testMethods.js +9 -24
- package/build/scripts/testMethodsReg.d.ts +1 -0
- package/build/scripts/testMethodsReg.js +10 -0
- package/build/transactions/Transaction.d.ts +4 -3
- package/build/transactions/Transaction.js +5 -3
- package/build/transactions/TransactionParser.js +8 -4
- package/build/transactions/decoders/DeploymentTransaction.d.ts +17 -0
- package/build/transactions/decoders/DeploymentTransaction.js +26 -0
- package/build/transactions/decoders/GenericTransaction.d.ts +6 -0
- package/build/transactions/decoders/GenericTransaction.js +6 -0
- package/build/transactions/decoders/InteractionTransaction.d.ts +15 -0
- package/build/transactions/decoders/InteractionTransaction.js +21 -0
- package/build/transactions/decoders/WrapInteractionTransaction.d.ts +15 -0
- package/build/transactions/decoders/WrapInteractionTransaction.js +21 -0
- package/build/transactions/decoders/WrapTransaction.d.ts +15 -0
- package/build/transactions/decoders/WrapTransaction.js +30 -0
- package/build/transactions/interfaces/ITransaction.d.ts +8 -27
- package/build/transactions/interfaces/IWrapTransaction.d.ts +3 -0
- package/build/transactions/interfaces/IWrapTransaction.js +1 -0
- package/build/transactions/interfaces/transactions/ICommonTransaction.d.ts +7 -0
- package/build/transactions/interfaces/transactions/ICommonTransaction.js +1 -0
- package/build/transactions/interfaces/transactions/IDeploymentTransaction.d.ts +13 -0
- package/build/transactions/interfaces/transactions/IDeploymentTransaction.js +1 -0
- package/build/transactions/interfaces/transactions/IInteractionTransaction.d.ts +14 -0
- package/build/transactions/interfaces/transactions/IInteractionTransaction.js +1 -0
- package/build/transactions/interfaces/transactions/IWrapTransaction.d.ts +10 -0
- package/build/transactions/interfaces/transactions/IWrapTransaction.js +1 -0
- package/build/transactions/metadata/TransactionInput.d.ts +16 -0
- package/build/transactions/metadata/TransactionInput.js +14 -0
- package/build/transactions/metadata/TransactionOutput.d.ts +19 -0
- package/build/transactions/metadata/TransactionOutput.js +16 -0
- package/build/transactions/metadata/TransactionReceipt.d.ts +11 -0
- package/build/transactions/metadata/TransactionReceipt.js +53 -0
- package/build/transactions/types/DeploymentTransaction.d.ts +16 -0
- package/build/transactions/types/DeploymentTransaction.js +24 -0
- package/build/transactions/types/GenericTransaction.d.ts +6 -0
- package/build/transactions/types/GenericTransaction.js +6 -0
- package/build/transactions/types/InteractionTransaction.d.ts +15 -0
- package/build/transactions/types/InteractionTransaction.js +21 -0
- package/cjs/_version.d.ts +1 -1
- package/cjs/_version.js +1 -1
- package/cjs/block/interfaces/BlockWitness.d.ts +11 -0
- package/cjs/block/interfaces/BlockWitness.js +2 -0
- package/cjs/contracts/Contract.d.ts +3 -1
- package/cjs/contracts/Contract.js +18 -12
- package/cjs/contracts/interfaces/IContract.d.ts +3 -1
- package/cjs/generator/WrappedGenerationParameters.d.ts +9 -0
- package/cjs/generator/WrappedGenerationParameters.js +18 -0
- package/cjs/opnet.d.ts +6 -1
- package/cjs/opnet.js +6 -1
- package/cjs/providers/AbstractRpcProvider.d.ts +8 -0
- package/cjs/providers/AbstractRpcProvider.js +63 -0
- package/cjs/providers/interfaces/Generate.d.ts +19 -0
- package/cjs/providers/interfaces/Generate.js +7 -0
- package/cjs/providers/interfaces/ReorgInformation.d.ts +5 -0
- package/cjs/providers/interfaces/ReorgInformation.js +2 -0
- package/cjs/scripts/ITestContract.d.ts +2 -2
- package/cjs/scripts/ITestContract.js +2 -2
- package/cjs/scripts/testContract.js +1 -1
- package/cjs/scripts/testMethods.js +8 -15
- package/cjs/transactions/TransactionReceipt.d.ts +3 -3
- package/cjs/transactions/TransactionReceipt.js +35 -16
- package/cjs/transactions/interfaces/BroadcastedTransaction.d.ts +7 -0
- package/cjs/transactions/interfaces/BroadcastedTransaction.js +2 -0
- package/cjs/transactions/interfaces/ITransaction.d.ts +2 -3
- package/cjs/transactions/interfaces/ITransactionReceipt.d.ts +9 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AbstractRpcProvider.html +18 -18
- package/docs/classes/BaseContract.html +7 -7
- package/docs/classes/BitcoinAddress.html +2 -2
- package/docs/classes/BitcoinInterface.html +2 -2
- package/docs/classes/BitcoinUtils.html +2 -2
- package/docs/classes/Block.html +3 -3
- package/docs/classes/CallResult.html +2 -2
- package/docs/classes/ContractData.html +3 -2
- package/docs/classes/DeploymentTransaction.html +26 -22
- package/docs/classes/GenericTransaction.html +15 -13
- package/docs/classes/IBaseContract.html +7 -7
- package/docs/classes/InteractionTransaction.html +22 -20
- package/docs/classes/JSONRpcProvider.html +17 -17
- package/docs/classes/OPNetEvent.html +2 -2
- package/docs/classes/StoredValue.html +2 -2
- package/docs/classes/TransactionBase.html +15 -13
- package/docs/classes/TransactionInput.html +2 -2
- package/docs/classes/TransactionOutput.html +2 -2
- package/docs/classes/TransactionParser.html +2 -2
- package/docs/classes/TransactionReceipt.html +7 -7
- package/docs/classes/UTXO.html +2 -2
- package/docs/classes/WebSocketRpcProvider.html +17 -17
- package/docs/classes/WrapTransaction.html +229 -0
- package/docs/classes/WrappedGeneration.html +7 -7
- package/docs/enums/BitcoinAbiTypes.html +2 -2
- package/docs/enums/GenerateTarget.html +2 -2
- package/docs/enums/OPNetTransactionTypes.html +4 -2
- package/docs/functions/getContract.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +3 -3
- package/docs/interfaces/BaseContractProperties.html +2 -2
- package/docs/interfaces/BitcoinAbiValue.html +3 -3
- package/docs/interfaces/BitcoinInterfaceAbiBase.html +2 -2
- package/docs/interfaces/BroadcastedTransaction.html +6 -6
- package/docs/interfaces/ContractEvents.html +1 -1
- package/docs/interfaces/EventBaseData.html +2 -2
- package/docs/interfaces/FunctionBaseData.html +2 -2
- package/docs/interfaces/GenerationConstraints.html +7 -7
- package/docs/interfaces/IAccessList.html +1 -1
- package/docs/interfaces/IAccessListItem.html +1 -1
- package/docs/interfaces/IBlock.html +3 -3
- package/docs/interfaces/IBlockCommon.html +3 -3
- package/docs/interfaces/IBlockWitness.html +2 -2
- package/docs/interfaces/IBlockWitnessAPI.html +2 -2
- package/docs/interfaces/ICallRequestError.html +2 -2
- package/docs/interfaces/ICallResultData.html +2 -2
- package/docs/interfaces/ICommonTransaction.html +17 -15
- package/docs/interfaces/IContract.html +2 -2
- package/docs/interfaces/IDecodedEvent.html +2 -2
- package/docs/interfaces/IDeploymentTransaction.html +26 -22
- package/docs/interfaces/IGenericTransaction.html +14 -12
- package/docs/interfaces/IInteractionTransaction.html +22 -20
- package/docs/interfaces/IRawContract.html +3 -2
- package/docs/interfaces/IRawContractEvents.html +1 -1
- package/docs/interfaces/IStorageValue.html +2 -2
- package/docs/interfaces/ITransactionBase.html +14 -12
- package/docs/interfaces/ITransactionInput.html +2 -2
- package/docs/interfaces/ITransactionOutput.html +2 -2
- package/docs/interfaces/ITransactionReceipt.html +5 -5
- package/docs/interfaces/IUTXO.html +2 -2
- package/docs/interfaces/IWrapTransaction.html +228 -0
- package/docs/interfaces/NetEventDocument.html +5 -5
- package/docs/interfaces/ReorgInformation.html +2 -2
- package/docs/interfaces/WrappedGenerationParameters.html +6 -6
- package/docs/modules.html +3 -0
- package/docs/types/BaseContractProperty.html +1 -1
- package/docs/types/BitcoinAddressLike.html +1 -1
- package/docs/types/BitcoinInterfaceAbi.html +1 -1
- package/docs/types/BlockHeaderChecksumProof.html +1 -1
- package/docs/types/BlockWitnesses.html +1 -1
- package/docs/types/ContractDecodedObjectResult.html +1 -1
- package/docs/types/DecodedCallResult.html +1 -1
- package/docs/types/DecodedOutput.html +1 -1
- package/docs/types/GenerationParameters.html +1 -1
- package/docs/types/ICallResult.html +1 -1
- package/docs/types/ITransaction.html +2 -2
- package/docs/types/InteractionType.html +174 -0
- package/docs/types/PointerLike.html +1 -1
- package/docs/types/RawContractEvents.html +1 -1
- package/docs/types/UTXOs.html +1 -1
- package/docs/variables/version.html +1 -1
- package/jest.config.ts +51 -43
- package/package.json +6 -5
- package/src/_version.ts +1 -1
- package/src/contracts/ContractData.ts +11 -3
- package/src/contracts/interfaces/IRawContract.ts +7 -3
- package/src/interfaces/opnet/OPNetTransactionTypes.ts +7 -0
- package/src/opnet.ts +13 -6
- package/src/providers/AbstractRpcProvider.ts +1 -1
- package/src/scripts/ITestContract.ts +2 -2
- package/src/scripts/testContract.ts +3 -3
- package/src/scripts/testMethods.ts +78 -59
- package/src/scripts/testMethodsReg.ts +20 -0
- package/src/transactions/Transaction.ts +10 -3
- package/src/transactions/TransactionParser.ts +13 -10
- package/src/transactions/{DeploymentTransaction.ts → decoders/DeploymentTransaction.ts} +6 -3
- package/src/transactions/{GenericTransaction.ts → decoders/GenericTransaction.ts} +3 -3
- package/src/transactions/{InteractionTransaction.ts → decoders/InteractionTransaction.ts} +4 -4
- package/src/transactions/decoders/WrapTransaction.ts +69 -0
- package/src/transactions/interfaces/ITransaction.ts +16 -107
- package/src/transactions/interfaces/transactions/ICommonTransaction.ts +19 -0
- package/src/transactions/interfaces/transactions/IDeploymentTransaction.ts +50 -0
- package/src/transactions/interfaces/transactions/IInteractionTransaction.ts +50 -0
- package/src/transactions/interfaces/transactions/IWrapTransaction.ts +43 -0
- package/src/transactions/{TransactionReceipt.ts → metadata/TransactionReceipt.ts} +1 -1
- package/tsconfig.webpack.json +8 -0
- /package/src/transactions/{TransactionInput.ts → metadata/TransactionInput.ts} +0 -0
- /package/src/transactions/{TransactionOutput.ts → metadata/TransactionOutput.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OP_NET - Smart Contracts on Bitcoin L1
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
@@ -55,7 +55,7 @@ the `docs/` directory of the repository.
|
|
|
55
55
|
|
|
56
56
|
Contributions are welcome! Please read through the `CONTRIBUTING.md` file for
|
|
57
57
|
guidelines on how to submit issues, feature requests, and pull requests. We
|
|
58
|
-
appreciate your input and encourage you to help us improve
|
|
58
|
+
appreciate your input and encourage you to help us improve OP_NET.
|
|
59
59
|
|
|
60
60
|
## License
|
|
61
61
|
|
package/browser/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.22";
|
|
@@ -4,6 +4,7 @@ export declare class BitcoinInterface {
|
|
|
4
4
|
constructor(abi: BitcoinInterfaceAbi);
|
|
5
5
|
static from(abi: BitcoinInterface | BitcoinInterfaceAbi): BitcoinInterface;
|
|
6
6
|
hasFunction(name: string): boolean;
|
|
7
|
+
hasEvent(name: string): boolean;
|
|
7
8
|
private verifyAbi;
|
|
8
9
|
private verifyAbiValues;
|
|
9
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { IContract } from '../../contracts/interfaces/IContract.js';
|
|
1
2
|
import { BaseContractProperty } from '../BaseContractProperty.js';
|
|
2
|
-
export interface BaseContractProperties {
|
|
3
|
+
export interface BaseContractProperties extends IContract {
|
|
3
4
|
[key: symbol]: BaseContractProperty;
|
|
4
5
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { BitcoinAbiTypes } from '../BitcoinAbiTypes.js';
|
|
2
2
|
import { BitcoinAbiValue } from './BitcoinAbiValue.js';
|
|
3
|
-
export interface BitcoinInterfaceAbiBase {
|
|
4
|
-
readonly constant?: boolean;
|
|
3
|
+
export interface BitcoinInterfaceAbiBase<T extends BitcoinAbiTypes> {
|
|
5
4
|
readonly name: string;
|
|
5
|
+
readonly type: T;
|
|
6
|
+
}
|
|
7
|
+
export interface FunctionBaseData extends BitcoinInterfaceAbiBase<BitcoinAbiTypes.Function> {
|
|
8
|
+
readonly constant?: boolean;
|
|
9
|
+
readonly payable?: boolean;
|
|
6
10
|
readonly inputs?: BitcoinAbiValue[];
|
|
7
11
|
readonly outputs?: BitcoinAbiValue[];
|
|
8
|
-
readonly type: BitcoinAbiTypes;
|
|
9
|
-
readonly payable?: boolean;
|
|
10
12
|
}
|
|
11
|
-
export
|
|
13
|
+
export interface EventBaseData extends BitcoinInterfaceAbiBase<BitcoinAbiTypes.Event> {
|
|
14
|
+
readonly values: BitcoinAbiValue[];
|
|
15
|
+
}
|
|
16
|
+
export type BitcoinInterfaceAbi = (FunctionBaseData | EventBaseData)[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface IBlockWitnessAPI {
|
|
2
|
+
readonly trusted: boolean;
|
|
3
|
+
readonly signature: string;
|
|
4
|
+
readonly identity?: string;
|
|
5
|
+
readonly opnetPubKey?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IBlockWitness {
|
|
8
|
+
blockNumber: bigint | string;
|
|
9
|
+
readonly witnesses: IBlockWitnessAPI[];
|
|
10
|
+
}
|
|
11
|
+
export type BlockWitnesses = IBlockWitness[];
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { BinaryReader, NetEvent } from '@btc-vision/bsi-binary';
|
|
2
2
|
import { DecodedCallResult } from '../common/CommonTypes.js';
|
|
3
|
+
import { ContractDecodedObjectResult, DecodedOutput } from './Contract.js';
|
|
3
4
|
import { IAccessList } from './interfaces/IAccessList.js';
|
|
4
5
|
import { ICallResultData } from './interfaces/ICallResult.js';
|
|
5
|
-
export declare class CallResult implements ICallResultData {
|
|
6
|
+
export declare class CallResult<T extends ContractDecodedObjectResult = {}> implements ICallResultData {
|
|
6
7
|
readonly result: BinaryReader;
|
|
7
8
|
readonly events: NetEvent[];
|
|
8
9
|
readonly accessList: IAccessList;
|
|
9
10
|
readonly decoded: Array<DecodedCallResult>;
|
|
11
|
+
properties: T;
|
|
10
12
|
constructor(iCallResult: ICallResultData);
|
|
11
|
-
setDecoded(decoded:
|
|
13
|
+
setDecoded(decoded: DecodedOutput): void;
|
|
12
14
|
private base64ToUint8Array;
|
|
13
15
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
import { NetEvent } from '@btc-vision/bsi-binary';
|
|
1
2
|
import { BaseContractProperty } from '../abi/BaseContractProperty.js';
|
|
2
3
|
import { BitcoinInterface } from '../abi/BitcoinInterface.js';
|
|
3
4
|
import { BaseContractProperties } from '../abi/interfaces/BaseContractProperties.js';
|
|
4
5
|
import { BitcoinInterfaceAbi } from '../abi/interfaces/BitcoinInterfaceAbi.js';
|
|
5
|
-
import { BitcoinAddressLike } from '../common/CommonTypes.js';
|
|
6
|
+
import { BitcoinAddressLike, DecodedCallResult } from '../common/CommonTypes.js';
|
|
6
7
|
import { AbstractRpcProvider } from '../providers/AbstractRpcProvider.js';
|
|
8
|
+
import { ContractEvents } from '../transactions/interfaces/ITransactionReceipt.js';
|
|
7
9
|
import { IContract } from './interfaces/IContract.js';
|
|
10
|
+
import { OPNetEvent } from './OPNetEvent.js';
|
|
8
11
|
declare const internal: unique symbol;
|
|
12
|
+
export type ContractDecodedObjectResult = {
|
|
13
|
+
[key: string]: DecodedCallResult;
|
|
14
|
+
};
|
|
15
|
+
export type DecodedOutput = {
|
|
16
|
+
values: Array<DecodedCallResult>;
|
|
17
|
+
obj: ContractDecodedObjectResult;
|
|
18
|
+
};
|
|
9
19
|
export declare abstract class IBaseContract<T extends BaseContractProperties> implements IContract {
|
|
10
20
|
readonly address: BitcoinAddressLike;
|
|
11
21
|
readonly interface: BitcoinInterface;
|
|
@@ -13,6 +23,8 @@ export declare abstract class IBaseContract<T extends BaseContractProperties> im
|
|
|
13
23
|
readonly [internal]: keyof T | undefined;
|
|
14
24
|
private events;
|
|
15
25
|
protected constructor(address: BitcoinAddressLike, abi: BitcoinInterface | BitcoinInterfaceAbi, provider: AbstractRpcProvider);
|
|
26
|
+
decodeEvents(events: NetEvent[] | ContractEvents): OPNetEvent[];
|
|
27
|
+
decodeEvent(event: NetEvent): OPNetEvent;
|
|
16
28
|
protected getFunction(name: symbol): BaseContractProperty | undefined | string | number | symbol;
|
|
17
29
|
private defineInternalFunctions;
|
|
18
30
|
private encodeFunctionData;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { Address } from '@btc-vision/bsi-binary';
|
|
2
3
|
import { IRawContract } from './interfaces/IRawContract.js';
|
|
3
4
|
export declare class ContractData implements IRawContract {
|
|
4
|
-
readonly contractAddress:
|
|
5
|
-
readonly virtualAddress:
|
|
5
|
+
readonly contractAddress: Address;
|
|
6
|
+
readonly virtualAddress: Address;
|
|
7
|
+
readonly p2trAddress: Address;
|
|
6
8
|
readonly bytecode: Buffer;
|
|
7
9
|
readonly wasCompressed: boolean;
|
|
8
10
|
readonly deployedTransactionId: string;
|
|
@@ -10,6 +12,6 @@ export declare class ContractData implements IRawContract {
|
|
|
10
12
|
readonly deployerPubKey: Buffer;
|
|
11
13
|
readonly contractSeed: Buffer;
|
|
12
14
|
readonly contractSaltHash: Buffer;
|
|
13
|
-
readonly deployerAddress:
|
|
15
|
+
readonly deployerAddress: Address;
|
|
14
16
|
constructor(raw: IRawContract);
|
|
15
17
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NetEvent } from '@btc-vision/bsi-binary';
|
|
2
|
+
import { DecodedCallResult } from '../common/CommonTypes.js';
|
|
3
|
+
import { ContractDecodedObjectResult, DecodedOutput } from './Contract.js';
|
|
4
|
+
export interface IDecodedEvent extends NetEvent {
|
|
5
|
+
readonly values: Array<DecodedCallResult>;
|
|
6
|
+
}
|
|
7
|
+
export declare class OPNetEvent<T extends ContractDecodedObjectResult = {}> extends NetEvent implements IDecodedEvent {
|
|
8
|
+
readonly eventType: string;
|
|
9
|
+
readonly eventDataSelector: bigint;
|
|
10
|
+
readonly eventData: Uint8Array;
|
|
11
|
+
properties: T;
|
|
12
|
+
values: Array<DecodedCallResult>;
|
|
13
|
+
constructor(eventType: string, eventDataSelector: bigint, eventData: Uint8Array);
|
|
14
|
+
setDecoded(decoded: DecodedOutput): void;
|
|
15
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { NetEvent } from '@btc-vision/bsi-binary';
|
|
1
2
|
import { BitcoinAddressLike } from '../../common/CommonTypes.js';
|
|
3
|
+
import { ContractEvents } from '../../transactions/interfaces/ITransactionReceipt.js';
|
|
4
|
+
import { OPNetEvent } from '../OPNetEvent.js';
|
|
2
5
|
export interface IContract {
|
|
3
6
|
readonly address: BitcoinAddressLike;
|
|
7
|
+
decodeEvents(events: NetEvent[] | ContractEvents): OPNetEvent[];
|
|
8
|
+
decodeEvent(event: NetEvent): OPNetEvent;
|
|
4
9
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { Address } from '@btc-vision/bsi-binary';
|
|
2
3
|
export interface IRawContract {
|
|
3
|
-
readonly contractAddress:
|
|
4
|
-
readonly virtualAddress:
|
|
4
|
+
readonly contractAddress: Address;
|
|
5
|
+
readonly virtualAddress: Address;
|
|
6
|
+
readonly p2trAddress: Address;
|
|
5
7
|
readonly bytecode: Buffer | string;
|
|
6
8
|
readonly wasCompressed: boolean;
|
|
7
9
|
readonly deployedTransactionId: string;
|
|
@@ -9,5 +11,5 @@ export interface IRawContract {
|
|
|
9
11
|
readonly deployerPubKey: Buffer | string;
|
|
10
12
|
readonly contractSeed: Buffer | string;
|
|
11
13
|
readonly contractSaltHash: Buffer | string;
|
|
12
|
-
readonly deployerAddress:
|
|
14
|
+
readonly deployerAddress: Address;
|
|
13
15
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GenerationConstraints, WrappedGenerationParameters } from '../providers/interfaces/Generate.js';
|
|
2
|
+
export declare class WrappedGeneration implements WrappedGenerationParameters {
|
|
3
|
+
readonly constraints: GenerationConstraints;
|
|
4
|
+
readonly entities: string[];
|
|
5
|
+
readonly keys: string[];
|
|
6
|
+
readonly signature: string;
|
|
7
|
+
readonly vault: string;
|
|
8
|
+
constructor(params: WrappedGenerationParameters);
|
|
9
|
+
}
|