-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
341 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ opt-level = 's' | |
strip = "debuginfo" | ||
|
||
[workspace.package] | ||
version = "0.3.1" | ||
version = "0.3.2" | ||
edition = "2021" | ||
description = "Substreams development kit for Antelope chains, contains Firehose Block model and helpers." | ||
authors = ["Fred <[email protected]>", "Denis <[email protected]>", "Yaro <[email protected]>"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
{ | ||
"account_name": "eosio.token", | ||
"abi": { | ||
"version": "eosio::abi/1.1", | ||
"types": [], | ||
"structs": [{ | ||
"name": "account", | ||
"base": "", | ||
"fields": [{ | ||
"name": "balance", | ||
"type": "asset" | ||
}] | ||
}, { | ||
"name": "close", | ||
"base": "", | ||
"fields": [{ | ||
"name": "owner", | ||
"type": "name" | ||
}, { | ||
"name": "symbol", | ||
"type": "symbol" | ||
}] | ||
}, { | ||
"name": "create", | ||
"base": "", | ||
"fields": [{ | ||
"name": "issuer", | ||
"type": "name" | ||
}, { | ||
"name": "maximum_supply", | ||
"type": "asset" | ||
}] | ||
}, { | ||
"name": "currency_stats", | ||
"base": "", | ||
"fields": [{ | ||
"name": "supply", | ||
"type": "asset" | ||
}, { | ||
"name": "max_supply", | ||
"type": "asset" | ||
}, { | ||
"name": "issuer", | ||
"type": "name" | ||
}] | ||
}, { | ||
"name": "issue", | ||
"base": "", | ||
"fields": [{ | ||
"name": "to", | ||
"type": "name" | ||
}, { | ||
"name": "quantity", | ||
"type": "asset" | ||
}, { | ||
"name": "memo", | ||
"type": "string" | ||
}] | ||
}, { | ||
"name": "open", | ||
"base": "", | ||
"fields": [{ | ||
"name": "owner", | ||
"type": "name" | ||
}, { | ||
"name": "symbol", | ||
"type": "symbol" | ||
}, { | ||
"name": "ram_payer", | ||
"type": "name" | ||
}] | ||
}, { | ||
"name": "retire", | ||
"base": "", | ||
"fields": [{ | ||
"name": "quantity", | ||
"type": "asset" | ||
}, { | ||
"name": "memo", | ||
"type": "string" | ||
}] | ||
}, { | ||
"name": "transfer", | ||
"base": "", | ||
"fields": [{ | ||
"name": "from", | ||
"type": "name" | ||
}, { | ||
"name": "to", | ||
"type": "name" | ||
}, { | ||
"name": "quantity", | ||
"type": "asset" | ||
}, { | ||
"name": "memo", | ||
"type": "string" | ||
}] | ||
}], | ||
"actions": [{ | ||
"name": "close", | ||
"type": "close", | ||
"ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Close Token Balance\nsummary: 'Close {{nowrap owner}}’s zero quantity balance'\nicon: https://raw.githubusercontent.com/cryptokylin/eosio.contracts/v1.7.0/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654\n---\n\n{{owner}} agrees to close their zero quantity balance for the {{symbol_to_symbol_code symbol}} token.\n\nRAM will be refunded to the RAM payer of the {{symbol_to_symbol_code symbol}} token balance for {{owner}}." | ||
}, { | ||
"name": "create", | ||
"type": "create", | ||
"ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Create New Token\nsummary: 'Create a new token'\nicon: https://raw.githubusercontent.com/cryptokylin/eosio.contracts/v1.7.0/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654\n---\n\n{{$action.account}} agrees to create a new token with symbol {{asset_to_symbol_code maximum_supply}} to be managed by {{issuer}}.\n\nThis action will not result any any tokens being issued into circulation.\n\n{{issuer}} will be allowed to issue tokens into circulation, up to a maximum supply of {{maximum_supply}}.\n\nRAM will deducted from {{$action.account}}’s resources to create the necessary records." | ||
}, { | ||
"name": "issue", | ||
"type": "issue", | ||
"ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Issue Tokens into Circulation\nsummary: 'Issue {{nowrap quantity}} into circulation and transfer into {{nowrap to}}’s account'\nicon: https://raw.githubusercontent.com/cryptokylin/eosio.contracts/v1.7.0/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654\n---\n\nThe token manager agrees to issue {{quantity}} into circulation, and transfer it into {{to}}’s account.\n\n{{#if memo}}There is a memo attached to the transfer stating:\n{{memo}}\n{{/if}}\n\nIf {{to}} does not have a balance for {{asset_to_symbol_code quantity}}, or the token manager does not have a balance for {{asset_to_symbol_code quantity}}, the token manager will be designated as the RAM payer of the {{asset_to_symbol_code quantity}} token balance for {{to}}. As a result, RAM will be deducted from the token manager’s resources to create the necessary records.\n\nThis action does not allow the total quantity to exceed the max allowed supply of the token." | ||
}, { | ||
"name": "open", | ||
"type": "open", | ||
"ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Open Token Balance\nsummary: 'Open a zero quantity balance for {{nowrap owner}}'\nicon: https://raw.githubusercontent.com/cryptokylin/eosio.contracts/v1.7.0/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654\n---\n\n{{ram_payer}} agrees to establish a zero quantity balance for {{owner}} for the {{symbol_to_symbol_code symbol}} token.\n\nIf {{owner}} does not have a balance for {{symbol_to_symbol_code symbol}}, {{ram_payer}} will be designated as the RAM payer of the {{symbol_to_symbol_code symbol}} token balance for {{owner}}. As a result, RAM will be deducted from {{ram_payer}}’s resources to create the necessary records." | ||
}, { | ||
"name": "retire", | ||
"type": "retire", | ||
"ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Remove Tokens from Circulation\nsummary: 'Remove {{nowrap quantity}} from circulation'\nicon: https://raw.githubusercontent.com/cryptokylin/eosio.contracts/v1.7.0/contracts/icons/token.png#207ff68b0406eaa56618b08bda81d6a0954543f36adc328ab3065f31a5c5d654\n---\n\nThe token manager agrees to remove {{quantity}} from circulation, taken from their own account.\n\n{{#if memo}} There is a memo attached to the action stating:\n{{memo}}\n{{/if}}" | ||
}, { | ||
"name": "transfer", | ||
"type": "transfer", | ||
"ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Transfer Tokens\nsummary: 'Send {{nowrap quantity}} from {{nowrap from}} to {{nowrap to}}'\nicon: https://raw.githubusercontent.com/cryptokylin/eosio.contracts/v1.7.0/contracts/icons/transfer.png#5dfad0df72772ee1ccc155e670c1d124f5c5122f1d5027565df38b418042d1dd\n---\n\n{{from}} agrees to send {{quantity}} to {{to}}.\n\n{{#if memo}}There is a memo attached to the transfer stating:\n{{memo}}\n{{/if}}\n\nIf {{from}} is not already the RAM payer of their {{asset_to_symbol_code quantity}} token balance, {{from}} will be designated as such. As a result, RAM will be deducted from {{from}}’s resources to refund the original RAM payer.\n\nIf {{to}} does not have a balance for {{asset_to_symbol_code quantity}}, {{from}} will be designated as the RAM payer of the {{asset_to_symbol_code quantity}} token balance for {{to}}. As a result, RAM will be deducted from {{from}}’s resources to create the necessary records." | ||
}], | ||
"tables": [{ | ||
"name": "accounts", | ||
"index_type": "i64", | ||
"key_names": [], | ||
"key_types": [], | ||
"type": "account" | ||
}, { | ||
"name": "stat", | ||
"index_type": "i64", | ||
"key_names": [], | ||
"key_types": [], | ||
"type": "currency_stats" | ||
}], | ||
"ricardian_clauses": [], | ||
"error_messages": [], | ||
"abi_extensions": [], | ||
"variants": [], | ||
"action_results": [], | ||
"kv_tables": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#[allow(dead_code)] | ||
pub const ACCOUNT: Option<&'static str> = Some("eosio.token"); | ||
pub mod types { | ||
use substreams_antelope::types::*; | ||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Account { | ||
pub balance: Asset, | ||
} | ||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct CurrencyStats { | ||
pub supply: Asset, | ||
pub max_supply: Asset, | ||
pub issuer: Name, | ||
} | ||
} | ||
pub mod actions { | ||
use substreams_antelope::types::*; | ||
use substreams_antelope::decoder::decode; | ||
#[allow(unused_imports)] | ||
use super::types::*; | ||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Close { | ||
pub owner: Name, | ||
pub symbol: Symbol, | ||
} | ||
impl substreams_antelope::Action for Close { | ||
const NAME: &'static str = "close"; | ||
fn decode( | ||
trace: &substreams_antelope::pb::ActionTrace, | ||
) -> Result<Self, substreams_antelope::Error> { | ||
Ok(decode::<Self>(&trace.action.as_ref().unwrap().json_data)?) | ||
} | ||
} | ||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Create { | ||
pub issuer: Name, | ||
pub maximum_supply: Asset, | ||
} | ||
impl substreams_antelope::Action for Create { | ||
const NAME: &'static str = "create"; | ||
fn decode( | ||
trace: &substreams_antelope::pb::ActionTrace, | ||
) -> Result<Self, substreams_antelope::Error> { | ||
Ok(decode::<Self>(&trace.action.as_ref().unwrap().json_data)?) | ||
} | ||
} | ||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Issue { | ||
pub to: Name, | ||
pub quantity: Asset, | ||
pub memo: String, | ||
} | ||
impl substreams_antelope::Action for Issue { | ||
const NAME: &'static str = "issue"; | ||
fn decode( | ||
trace: &substreams_antelope::pb::ActionTrace, | ||
) -> Result<Self, substreams_antelope::Error> { | ||
Ok(decode::<Self>(&trace.action.as_ref().unwrap().json_data)?) | ||
} | ||
} | ||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Open { | ||
pub owner: Name, | ||
pub symbol: Symbol, | ||
pub ram_payer: Name, | ||
} | ||
impl substreams_antelope::Action for Open { | ||
const NAME: &'static str = "open"; | ||
fn decode( | ||
trace: &substreams_antelope::pb::ActionTrace, | ||
) -> Result<Self, substreams_antelope::Error> { | ||
Ok(decode::<Self>(&trace.action.as_ref().unwrap().json_data)?) | ||
} | ||
} | ||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Retire { | ||
pub quantity: Asset, | ||
pub memo: String, | ||
} | ||
impl substreams_antelope::Action for Retire { | ||
const NAME: &'static str = "retire"; | ||
fn decode( | ||
trace: &substreams_antelope::pb::ActionTrace, | ||
) -> Result<Self, substreams_antelope::Error> { | ||
Ok(decode::<Self>(&trace.action.as_ref().unwrap().json_data)?) | ||
} | ||
} | ||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Transfer { | ||
pub from: Name, | ||
pub to: Name, | ||
pub quantity: Asset, | ||
pub memo: String, | ||
} | ||
impl substreams_antelope::Action for Transfer { | ||
const NAME: &'static str = "transfer"; | ||
fn decode( | ||
trace: &substreams_antelope::pb::ActionTrace, | ||
) -> Result<Self, substreams_antelope::Error> { | ||
Ok(decode::<Self>(&trace.action.as_ref().unwrap().json_data)?) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.