Skip to content

Instantly share code, notes, and snippets.

@stackup-dev
Last active April 23, 2024 18:33
Show Gist options
  • Save stackup-dev/9b751c2d5cf62dd5eb70aaa54a56ba24 to your computer and use it in GitHub Desktop.
Save stackup-dev/9b751c2d5cf62dd5eb70aaa54a56ba24 to your computer and use it in GitHub Desktop.
lib.rs
// Copyright (c) Zefchain Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
use async_graphql::{InputObject, Request, Response};
use linera_sdk::base::{Amount, ChainId, ContractAbi, Owner, ServiceAbi};
use linera_sdk::graphql::GraphQLMutationRoot;
use serde::{Deserialize, Serialize};
pub struct FungibleAbi;
impl ContractAbi for FungibleAbi {
type Parameters = ();
type InitializationArgument = Amount;
type Operation = Operation;
type Response = ();
}
impl ServiceAbi for FungibleAbi {
type Parameters = ();
type Query = Request;
type QueryResponse = Response;
}
// INSERT OPERATION CODE HERE
// INSERT MESSAGE CODE HERE
#[derive(
Clone, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize, InputObject,
)]
pub struct Account {
pub chain_id: ChainId,
pub owner: Owner,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment