@kippurocks/libticketto-papi
Version:
A Kippu implementation of The Ticketto Protocol with Polkadot-API
1,726 lines • 36.1 kB
JSON
{
"source": {
"hash": "0x1c77210e54f50777fbe114e8d96ca25814ae5419d5a2d760fe771306edd205bf",
"language": "ink! 5.1.1",
"compiler": "rustc 1.86.0-nightly",
"build_info": {
"build_mode": "Release",
"cargo_contract_version": "5.0.3",
"rust_toolchain": "nightly-aarch64-apple-darwin",
"wasm_opt_settings": {
"keep_debug_symbols": false,
"optimization_passes": "Z"
}
}
},
"contract": {
"name": "ticketto_tickets",
"version": "0.1.0",
"authors": [
"The Kippu Authors <contact@kippu.rocks>"
],
"description": "Smart contract that allows ticket holders to mark attendances",
"repository": "https://github.com/kippurocks/kippu-contracts.git",
"license": "Apache-2.0"
},
"image": null,
"spec": {
"constructors": [
{
"args": [],
"default": false,
"docs": [
"Default constructor."
],
"label": "initialize",
"payable": false,
"returnType": {
"displayName": [
"ink_primitives",
"ConstructorResult"
],
"type": 1
},
"selector": "0xffffffff"
}
],
"docs": [],
"environment": {
"accountId": {
"displayName": [
"AccountId"
],
"type": 16
},
"balance": {
"displayName": [
"Balance"
],
"type": 7
},
"blockNumber": {
"displayName": [
"BlockNumber"
],
"type": 4
},
"chainExtension": {
"displayName": [
"ChainExtension"
],
"type": 38
},
"hash": {
"displayName": [
"Hash"
],
"type": 37
},
"maxEventTopics": 4,
"staticBufferSize": 16384,
"timestamp": {
"displayName": [
"Timestamp"
],
"type": 15
}
},
"events": [
{
"args": [
{
"docs": [],
"indexed": false,
"label": "event",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"docs": [],
"indexed": false,
"label": "id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
}
],
"docs": [
"Emits when a ticket is issued."
],
"label": "TicketIssued",
"module_path": "ticketto_tickets::ticketto_tickets",
"signature_topic": "0x86d2e4375972e16c10616fb04fbce68628c2f11e5a258ac9af4524e27c9fa476"
},
{
"args": [
{
"docs": [],
"indexed": false,
"label": "event",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"docs": [],
"indexed": false,
"label": "id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
},
{
"docs": [],
"indexed": false,
"label": "when",
"type": {
"displayName": [
"Timestamp"
],
"type": 15
}
}
],
"docs": [
"Emits when a ticket marks an attendance."
],
"label": "TicketAttendance",
"module_path": "ticketto_tickets::ticketto_tickets",
"signature_topic": "0xa454208b4e81782d51d01fe97dfaff67dfeb6ac5de522ed02b7a9df7c25347d8"
},
{
"args": [
{
"docs": [],
"indexed": false,
"label": "event",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"docs": [],
"indexed": false,
"label": "id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
},
{
"docs": [],
"indexed": false,
"label": "beneficiary",
"type": {
"displayName": [
"AccountId"
],
"type": 16
}
}
],
"docs": [
"Emits when a pending transfer is initiated."
],
"label": "TicketPendingTransferInitiated",
"module_path": "ticketto_tickets::ticketto_tickets",
"signature_topic": "0xdce33445bd559b7aa7c73a22d239c07c9d873744722c1c343b4b4aa1662b69f8"
}
],
"lang_error": {
"displayName": [
"ink",
"LangError"
],
"type": 3
},
"messages": [
{
"args": [
{
"label": "event_id",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
}
],
"default": false,
"docs": [
" Permissionlessly issues a new ticket. The new ticket takes the parameters given by the",
" `EventInfo`. Tickets can only be issued on the [`Sales`][EventState::Sales] and",
" [`Ongoing`][EventState::Ongoing] period, until maximum capacity is reached.",
"",
" Once the event finishes, or the maximum capacity is reached, it won't be longer possible",
" to issue more tickets."
],
"label": "issue_ticket",
"mutates": true,
"payable": true,
"returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 5
},
"selector": "0x3d3b4f52"
},
{
"args": [
{
"label": "event_id",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"label": "id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
}
],
"default": false,
"docs": [
" Marks an attendance on a ticket. Only the ticket holder can mark it, and the success",
" of the attendance"
],
"label": "mark_attendance",
"mutates": true,
"payable": true,
"returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 5
},
"selector": "0xea2e67dc"
},
{
"args": [
{
"label": "event_id",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"label": "ticket_id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
},
{
"label": "beneficiary",
"type": {
"displayName": [
"AccountId"
],
"type": 16
}
}
],
"default": false,
"docs": [
" Allows the ticket owner to initiate a pending transfer."
],
"label": "initiate_pending_transfer",
"mutates": false,
"payable": true,
"returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 5
},
"selector": "0x1cd262c4"
},
{
"args": [
{
"label": "event_id",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"label": "ticket_id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
}
],
"default": false,
"docs": [
" Allows the beneficiary of a pending ticket transfer to accept and receive the",
" ticket."
],
"label": "accept_pending_transfer",
"mutates": false,
"payable": true,
"returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 5
},
"selector": "0x3c64c2d8"
},
{
"args": [
{
"label": "event_id",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"label": "ticket_id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
}
],
"default": false,
"docs": [
" Allows the sender or the beneficiary of a pending ticket transfer to rescind it."
],
"label": "cancel_pending_transfer",
"mutates": false,
"payable": true,
"returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 5
},
"selector": "0x1ce3e4ab"
},
{
"args": [
{
"label": "event_id",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"label": "ticket_id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
}
],
"default": false,
"docs": [],
"label": "get",
"mutates": false,
"payable": false,
"returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 17
},
"selector": "0x2f865bd9"
},
{
"args": [
{
"label": "event_id",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"label": "ticket_id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
}
],
"default": false,
"docs": [],
"label": "attendances",
"mutates": false,
"payable": false,
"returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 34
},
"selector": "0xcfb1dffb"
},
{
"args": [
{
"label": "event_id",
"type": {
"displayName": [
"EventId"
],
"type": 4
}
},
{
"label": "ticket_id",
"type": {
"displayName": [
"TicketId"
],
"type": 15
}
}
],
"default": false,
"docs": [],
"label": "pending_transfer_for",
"mutates": false,
"payable": false,
"returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 35
},
"selector": "0x0016f5ac"
}
]
},
"storage": {
"root": {
"layout": {
"struct": {
"fields": [],
"name": "TickettoTickets"
}
},
"root_key": "0x00000000",
"ty": 0
}
},
"types": [
{
"id": 0,
"type": {
"def": {
"composite": {}
},
"path": [
"ticketto_tickets",
"ticketto_tickets",
"TickettoTickets"
]
}
},
{
"id": 1,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 2
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 3
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 2
},
{
"name": "E",
"type": 3
}
],
"path": [
"Result"
]
}
},
{
"id": 2,
"type": {
"def": {
"tuple": []
}
}
},
{
"id": 3,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 1,
"name": "CouldNotReadInput"
}
]
}
},
"path": [
"ink_primitives",
"LangError"
]
}
},
{
"id": 4,
"type": {
"def": {
"primitive": "u32"
}
}
},
{
"id": 5,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 6
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 3
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 6
},
{
"name": "E",
"type": 3
}
],
"path": [
"Result"
]
}
},
{
"id": 6,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 7
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 8
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 7
},
{
"name": "E",
"type": 8
}
],
"path": [
"Result"
]
}
},
{
"id": 7,
"type": {
"def": {
"primitive": "u128"
}
}
},
{
"id": 8,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "LowBalance"
},
{
"index": 1,
"name": "Overflow"
},
{
"index": 2,
"name": "EventNotFound"
},
{
"index": 3,
"name": "TicketNotFound"
},
{
"index": 4,
"name": "NoPermission"
},
{
"index": 5,
"name": "DatesNotSet"
},
{
"index": 6,
"name": "InvalidState"
},
{
"index": 7,
"name": "MaxCapacity"
},
{
"index": 8,
"name": "AttendanceOutOfDates"
},
{
"index": 9,
"name": "MaxAttendances"
},
{
"index": 10,
"name": "CannotTransfer"
},
{
"index": 11,
"name": "NoPendingTransfer"
},
{
"fields": [
{
"type": 9,
"typeName": "KreivoApisError"
}
],
"index": 12,
"name": "KreivoApiError"
},
{
"fields": [
{
"type": 13,
"typeName": "[u8; 32]"
}
],
"index": 13,
"name": "Other"
}
]
}
},
"path": [
"ticketto_types",
"error",
"Error"
]
}
},
{
"id": 9,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "UnknownError"
},
{
"index": 1,
"name": "ExtQueryError"
},
{
"fields": [
{
"type": 10,
"typeName": "AssetsApiError"
}
],
"index": 2,
"name": "Assets"
},
{
"fields": [
{
"type": 11,
"typeName": "ListingsApiError"
}
],
"index": 3,
"name": "Listings"
},
{
"fields": [
{
"type": 12,
"typeName": "MembershipsApiError"
}
],
"index": 4,
"name": "Memberships"
}
]
}
},
"path": [
"kreivo_apis",
"apis",
"error",
"KreivoApisError"
]
}
},
{
"id": 10,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "CannotDeposit"
},
{
"index": 1,
"name": "CannotTransfer"
}
]
}
},
"path": [
"kreivo_apis",
"apis",
"error",
"assets",
"AssetsApiError"
]
}
},
{
"id": 11,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "NoMerchantId"
},
{
"index": 1,
"name": "UnknownInventory"
},
{
"index": 2,
"name": "FailedToCreateInventory"
},
{
"index": 3,
"name": "ArchivedInventory"
},
{
"index": 4,
"name": "FailedToArchiveInventory"
},
{
"index": 5,
"name": "FailedToPublishItem"
},
{
"index": 6,
"name": "UnknownItem"
},
{
"index": 7,
"name": "NotForResale"
},
{
"index": 8,
"name": "ItemNonTransferable"
},
{
"index": 9,
"name": "FailedToSetNotForResale"
},
{
"index": 10,
"name": "FailedToSetTransferable"
},
{
"index": 11,
"name": "FailedToSetAttribute"
},
{
"index": 12,
"name": "CannotTransfer"
},
{
"index": 13,
"name": "FailedToSetMetadata"
}
]
}
},
"path": [
"kreivo_apis",
"apis",
"error",
"listings",
"ListingsApiError"
]
}
},
{
"id": 12,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "NoGroup"
},
{
"index": 1,
"name": "UnknownMembership"
},
{
"index": 2,
"name": "CannotAddMember"
},
{
"index": 3,
"name": "FailedToSetAttribute"
}
]
}
},
"path": [
"kreivo_apis",
"apis",
"error",
"memberships",
"MembershipsApiError"
]
}
},
{
"id": 13,
"type": {
"def": {
"array": {
"len": 32,
"type": 14
}
}
}
},
{
"id": 14,
"type": {
"def": {
"primitive": "u8"
}
}
},
{
"id": 15,
"type": {
"def": {
"primitive": "u64"
}
}
},
{
"id": 16,
"type": {
"def": {
"composite": {
"fields": [
{
"type": 13,
"typeName": "[u8; 32]"
}
]
}
},
"path": [
"ink_primitives",
"types",
"AccountId"
]
}
},
{
"id": 17,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 18
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 3
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 18
},
{
"name": "E",
"type": 3
}
],
"path": [
"Result"
]
}
},
{
"id": 18,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 19
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 19
}
],
"path": [
"Option"
]
}
},
{
"id": 19,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "name",
"type": 20,
"typeName": "EventName"
},
{
"name": "owner",
"type": 13,
"typeName": "[u8; 32]"
},
{
"name": "attendance_policy",
"type": 21,
"typeName": "crate::AttendancePolicy"
},
{
"name": "attendances",
"type": 23,
"typeName": "Attendances"
},
{
"name": "price",
"type": 24,
"typeName": "Option<ItemPrice>"
},
{
"name": "restrictions",
"type": 31,
"typeName": "TicketRestrictions"
},
{
"name": "pending_transfer",
"type": 33,
"typeName": "Option<[u8; 32]>"
}
]
}
},
"path": [
"ticketto_types",
"ticket",
"TicketInfo"
]
}
},
{
"id": 20,
"type": {
"def": {
"sequence": {
"type": 14
}
}
}
},
{
"id": 21,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "Single"
},
{
"fields": [
{
"name": "max",
"type": 4,
"typeName": "u32"
},
{
"name": "maybe_until",
"type": 22,
"typeName": "Option<Timestamp>"
}
],
"index": 1,
"name": "Multiple"
},
{
"fields": [
{
"name": "maybe_until",
"type": 22,
"typeName": "Option<Timestamp>"
}
],
"index": 2,
"name": "Unlimited"
}
]
}
},
"params": [
{
"name": "Timestamp",
"type": 15
}
],
"path": [
"ticketto_types",
"ticket",
"AttendancePolicy"
]
}
},
{
"id": 22,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 15
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 15
}
],
"path": [
"Option"
]
}
},
{
"id": 23,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "count",
"type": 4,
"typeName": "u32"
},
{
"name": "last",
"type": 15,
"typeName": "Timestamp"
}
]
}
},
"path": [
"ticketto_types",
"ticket",
"Attendances"
]
}
},
{
"id": 24,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 25
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 25
}
],
"path": [
"Option"
]
}
},
{
"id": 25,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "asset",
"type": 26,
"typeName": "Asset"
},
{
"name": "amount",
"type": 7,
"typeName": "Balance"
}
]
}
},
"params": [
{
"name": "Asset",
"type": 26
},
{
"name": "Balance",
"type": 7
}
],
"path": [
"fc_traits_listings",
"item",
"ItemPrice"
]
}
},
{
"id": 26,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 4,
"typeName": "u32"
}
],
"index": 0,
"name": "Here"
},
{
"fields": [
{
"type": 27,
"typeName": "Para"
}
],
"index": 1,
"name": "Sibling"
},
{
"fields": [
{
"name": "network",
"type": 29,
"typeName": "NetworkId"
},
{
"name": "child",
"type": 30,
"typeName": "Option<Para>"
}
],
"index": 2,
"name": "External"
}
]
}
},
"path": [
"virto_common",
"multilocation_asset_id",
"FungibleAssetLocation"
]
}
},
{
"id": 27,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "id",
"type": 28,
"typeName": "u16"
},
{
"name": "pallet",
"type": 14,
"typeName": "u8"
},
{
"name": "index",
"type": 4,
"typeName": "u32"
}
]
}
},
"path": [
"virto_common",
"multilocation_asset_id",
"Para"
]
}
},
{
"id": 28,
"type": {
"def": {
"primitive": "u16"
}
}
},
{
"id": 29,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "Polkadot"
},
{
"index": 1,
"name": "Kusama"
},
{
"fields": [
{
"name": "chain_id",
"type": 15,
"typeName": "u64"
}
],
"index": 2,
"name": "Ethereum"
}
]
}
},
"path": [
"virto_common",
"multilocation_asset_id",
"NetworkId"
]
}
},
{
"id": 30,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 27
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 27
}
],
"path": [
"Option"
]
}
},
{
"id": 31,
"type": {
"def": {
"composite": {
"fields": [
{
"name": "cannot_resale",
"type": 32,
"typeName": "bool"
},
{
"name": "cannot_transfer",
"type": 32,
"typeName": "bool"
}
]
}
},
"path": [
"ticketto_types",
"ticket",
"TicketRestrictions"
]
}
},
{
"id": 32,
"type": {
"def": {
"primitive": "bool"
}
}
},
{
"id": 33,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 13
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 13
}
],
"path": [
"Option"
]
}
},
{
"id": 34,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 23
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 3
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 23
},
{
"name": "E",
"type": 3
}
],
"path": [
"Result"
]
}
},
{
"id": 35,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 36
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 3
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 36
},
{
"name": "E",
"type": 3
}
],
"path": [
"Result"
]
}
},
{
"id": 36,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 0,
"name": "None"
},
{
"fields": [
{
"type": 16
}
],
"index": 1,
"name": "Some"
}
]
}
},
"params": [
{
"name": "T",
"type": 16
}
],
"path": [
"Option"
]
}
},
{
"id": 37,
"type": {
"def": {
"composite": {
"fields": [
{
"type": 13,
"typeName": "[u8; 32]"
}
]
}
},
"path": [
"ink_primitives",
"types",
"Hash"
]
}
},
{
"id": 38,
"type": {
"def": {
"variant": {}
},
"path": [
"kreivo_apis",
"contract",
"chain_extension",
"ChainExtension"
]
}
}
],
"version": 5
}