@orao-network/fuel-vrf
Version:
ORAO VRF SDK Verifiable Random Function for the Fuel Network
326 lines (325 loc) • 9.93 kB
TypeScript
import { Contract as __Contract, Interface } from "fuels";
import type { Provider, Account, StorageSlot, Address, BigNumberish, BN, FunctionFragment, InvokeFunction } from 'fuels';
import type { Option, Enum, Vec } from "./common";
export declare enum AccessErrorInput {
NotOwner = "NotOwner"
}
export declare enum AccessErrorOutput {
NotOwner = "NotOwner"
}
export declare enum ErrorInput {
ContractNotConfigured = "ContractNotConfigured",
AssetNotConfigured = "AssetNotConfigured",
NotAuthorized = "NotAuthorized",
RemainingAssets = "RemainingAssets",
NonZeroFee = "NonZeroFee",
ZeroAuthority = "ZeroAuthority",
ZeroFee = "ZeroFee",
NoFeePaid = "NoFeePaid",
WrongFeePaid = "WrongFeePaid",
SeedInUse = "SeedInUse",
NoAmountSpecified = "NoAmountSpecified",
NotEnoughFunds = "NotEnoughFunds",
UnknownRequest = "UnknownRequest",
InvalidResponse = "InvalidResponse",
Responded = "Responded",
Fulfilled = "Fulfilled",
UnFulfilled = "UnFulfilled"
}
export declare enum ErrorOutput {
ContractNotConfigured = "ContractNotConfigured",
AssetNotConfigured = "AssetNotConfigured",
NotAuthorized = "NotAuthorized",
RemainingAssets = "RemainingAssets",
NonZeroFee = "NonZeroFee",
ZeroAuthority = "ZeroAuthority",
ZeroFee = "ZeroFee",
NoFeePaid = "NoFeePaid",
WrongFeePaid = "WrongFeePaid",
SeedInUse = "SeedInUse",
NoAmountSpecified = "NoAmountSpecified",
NotEnoughFunds = "NotEnoughFunds",
UnknownRequest = "UnknownRequest",
InvalidResponse = "InvalidResponse",
Responded = "Responded",
Fulfilled = "Fulfilled",
UnFulfilled = "UnFulfilled"
}
export type EventInput = Enum<{
Fulfill: FulfillInput;
Response: ResponseInput;
Request: RequestInput;
Reset: ResetInput;
Callback: CallbackInput;
}>;
export type EventOutput = Enum<{
Fulfill: FulfillOutput;
Response: ResponseOutput;
Request: RequestOutput;
Reset: ResetOutput;
Callback: CallbackOutput;
}>;
export type IdentityInput = Enum<{
Address: AddressInput;
ContractId: ContractIdInput;
}>;
export type IdentityOutput = Enum<{
Address: AddressOutput;
ContractId: ContractIdOutput;
}>;
export declare enum InitializationErrorInput {
CannotReinitialized = "CannotReinitialized"
}
export declare enum InitializationErrorOutput {
CannotReinitialized = "CannotReinitialized"
}
export type RandomnessStateInput = Enum<{
Unfulfilled: UnfulfilledInput;
Fulfilled: FulfilledInput;
}>;
export type RandomnessStateOutput = Enum<{
Unfulfilled: UnfulfilledOutput;
Fulfilled: FulfilledOutput;
}>;
export type StateInput = Enum<{
Uninitialized: undefined;
Initialized: IdentityInput;
Revoked: undefined;
}>;
export type StateOutput = Enum<{
Uninitialized: void;
Initialized: IdentityOutput;
Revoked: void;
}>;
export type AddressInput = {
bits: string;
};
export type AddressOutput = AddressInput;
export type AssetIdInput = {
bits: string;
};
export type AssetIdOutput = AssetIdInput;
export type CallbackInput = {
seed: string;
randomness: string;
client: ContractIdInput;
};
export type CallbackOutput = {
seed: string;
randomness: string;
client: ContractIdOutput;
};
export type ContractIdInput = {
bits: string;
};
export type ContractIdOutput = ContractIdInput;
export type FulfillInput = {
seed: string;
randomness: string;
};
export type FulfillOutput = FulfillInput;
export type FulfilledInput = {
randomness: string;
keys: FulfillersKeysInput;
};
export type FulfilledOutput = {
randomness: string;
keys: FulfillersKeysOutput;
};
export type FulfillersKeysInput = {
keys: [AddressInput, AddressInput, AddressInput, AddressInput, AddressInput, AddressInput, AddressInput];
};
export type FulfillersKeysOutput = {
keys: [AddressOutput, AddressOutput, AddressOutput, AddressOutput, AddressOutput, AddressOutput, AddressOutput];
};
export type OwnershipSetInput = {
new_owner: IdentityInput;
};
export type OwnershipSetOutput = {
new_owner: IdentityOutput;
};
export type OwnershipTransferredInput = {
new_owner: IdentityInput;
previous_owner: IdentityInput;
};
export type OwnershipTransferredOutput = {
new_owner: IdentityOutput;
previous_owner: IdentityOutput;
};
export type RandomnessInput = {
sender: IdentityInput;
seed: string;
callback_fee: BigNumberish;
state: RandomnessStateInput;
};
export type RandomnessOutput = {
sender: IdentityOutput;
seed: string;
callback_fee: BN;
state: RandomnessStateOutput;
};
export type RequestInput = {
seed: string;
client: IdentityInput;
no: BigNumberish;
};
export type RequestOutput = {
seed: string;
client: IdentityOutput;
no: BN;
};
export type ResetInput = {
seed: string;
};
export type ResetOutput = ResetInput;
export type ResponseInput = {
seed: string;
authority: AddressInput;
randomness: string;
};
export type ResponseOutput = {
seed: string;
authority: AddressOutput;
randomness: string;
};
export type UnfulfilledInput = {
randomness: string;
keys: FulfillersKeysInput;
};
export type UnfulfilledOutput = {
randomness: string;
keys: FulfillersKeysOutput;
};
export declare class VrfImplInterface extends Interface {
constructor();
functions: {
owner: FunctionFragment;
configure: FunctionFragment;
configure_asset: FunctionFragment;
execute_callback: FunctionFragment;
fulfill: FunctionFragment;
get_asset: FunctionFragment;
get_balance: FunctionFragment;
get_fee: FunctionFragment;
get_fulfillment_authorities: FunctionFragment;
get_num_requests: FunctionFragment;
get_request_by_num: FunctionFragment;
get_request_by_seed: FunctionFragment;
get_requests: FunctionFragment;
request: FunctionFragment;
withdraw_fees: FunctionFragment;
};
}
export declare class VrfImpl extends __Contract {
static readonly abi: {
programType: string;
specVersion: string;
encodingVersion: string;
concreteTypes: ({
type: string;
concreteTypeId: string;
metadataTypeId?: undefined;
typeArguments?: undefined;
} | {
type: string;
concreteTypeId: string;
metadataTypeId: number;
typeArguments?: undefined;
} | {
type: string;
concreteTypeId: string;
metadataTypeId: number;
typeArguments: string[];
})[];
metadataTypes: ({
type: string;
metadataTypeId: number;
components: ({
name: string;
typeId: string;
} | {
name: string;
typeId: number;
})[];
typeParameters?: undefined;
} | {
type: string;
metadataTypeId: number;
components: ({
name: string;
typeId: string;
} | {
name: string;
typeId: number;
})[];
typeParameters: number[];
} | {
type: string;
metadataTypeId: number;
components?: undefined;
typeParameters?: undefined;
} | {
type: string;
metadataTypeId: number;
components: ({
name: string;
typeId: number;
typeArguments: {
name: string;
typeId: number;
}[];
} | {
name: string;
typeId: string;
typeArguments?: undefined;
})[];
typeParameters: number[];
})[];
functions: ({
inputs: {
name: string;
concreteTypeId: string;
}[];
name: string;
output: string;
attributes: {
name: string;
arguments: string[];
}[];
} | {
inputs: {
name: string;
concreteTypeId: string;
}[];
name: string;
output: string;
attributes: null;
})[];
loggedTypes: {
logId: string;
concreteTypeId: string;
}[];
messagesTypes: never[];
configurables: never[];
};
static readonly storageSlots: StorageSlot[];
interface: VrfImplInterface;
functions: {
owner: InvokeFunction<[], StateOutput>;
configure: InvokeFunction<[authority: IdentityInput, fee: BigNumberish, fulfillment_authorities: Vec<AddressInput>], void>;
configure_asset: InvokeFunction<[asset: AssetIdInput, fee: BigNumberish], void>;
execute_callback: InvokeFunction<[seed: string], void>;
fulfill: InvokeFunction<[seed: string, signature: string], void>;
get_asset: InvokeFunction<[], AssetIdOutput>;
get_balance: InvokeFunction<[asset: AssetIdInput], BN>;
get_fee: InvokeFunction<[asset: AssetIdInput], BN>;
get_fulfillment_authorities: InvokeFunction<[], Vec<AddressOutput>>;
get_num_requests: InvokeFunction<[], BN>;
get_request_by_num: InvokeFunction<[num: BigNumberish], Option<RandomnessOutput>>;
get_request_by_seed: InvokeFunction<[seed: string], Option<RandomnessOutput>>;
get_requests: InvokeFunction<[offset: BigNumberish], Vec<RandomnessOutput>>;
request: InvokeFunction<[seed: string], BN>;
withdraw_fees: InvokeFunction<[asset: AssetIdInput, amount: BigNumberish, recipient_address: AddressInput], void>;
};
constructor(id: string | Address, accountOrProvider: Account | Provider);
}