Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment solution field added to program and instance #158

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/messages/instance/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseExecutableContent, ParentVolume, VolumePersistence } from "../types";
import { BaseExecutableContent, ParentVolume, VolumePersistence, Chain, PaymentType } from "../types";

/**
* Root file system of a VM instance.
Expand All @@ -10,6 +10,12 @@ export type RootfsVolume = {
size_mib: number; //Limit to 1 GiB
};

export type Payment = {
chain: Chain;
receiver: string;
type: PaymentType;
MHHukiewitz marked this conversation as resolved.
Show resolved Hide resolved
};

/**
* Message content for scheduling a VM instance on the network.
*
Expand Down
14 changes: 13 additions & 1 deletion src/messages/program/programModel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseContent, MachineVolume } from "../types";
import { FunctionEnvironment, MachineResources } from "../types";
import { FunctionEnvironment, MachineResources, Chain, PaymentType } from "../types";

/**
* Type of Encoding
Expand All @@ -25,6 +25,8 @@ export type CodeContent = {
entrypoint: string;
ref: string;
use_latest: boolean;
interface: string;
args: string[];
};

/**
Expand Down Expand Up @@ -63,6 +65,15 @@ export type FunctionRuntime = {
comment: string;
};

/**
* Payment solution
*/
export type Payment = {
chain: Chain;
receiver?: string;
type: PaymentType;
};

MHHukiewitz marked this conversation as resolved.
Show resolved Hide resolved
export type ProgramContent = BaseContent & {
type: MachineType;
allow_amend: boolean;
Expand All @@ -76,5 +87,6 @@ export type ProgramContent = BaseContent & {
resources: MachineResources;
runtime: FunctionRuntime;
volumes: MachineVolume[];
payment?: Payment;
replaces?: string;
};
8 changes: 8 additions & 0 deletions src/messages/types/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export enum Chain {
TEZOS = "TEZOS",
}

/**
* Payment Type concerning payment solution
*/
export enum PaymentType {
hold = "hold",
superfluid = "superfluid",
}

/**
* Supported hash functions
*/
Expand Down
Loading