From a84b9e635d88d97d47047f9e25c1c890dc0063b2 Mon Sep 17 00:00:00 2001 From: BotchM Date: Sat, 13 Nov 2021 08:42:26 +0200 Subject: [PATCH] upgrade interfaces for depart, icpunks, ext --- src/idls/departure_labs.did.ts | 470 +++++++++++++++++++++++++++---- src/idls/ext.did.ts | 233 ++++++++++++--- src/idls/icpunks.did.ts | 170 +++++++++-- src/interfaces/departure_labs.ts | 415 +++++++++++++++++++++------ src/interfaces/ext.ts | 268 +++++++++++------- src/interfaces/icpunks.ts | 146 ++++++++-- 6 files changed, 1383 insertions(+), 319 deletions(-) diff --git a/src/idls/departure_labs.did.ts b/src/idls/departure_labs.did.ts index b31c7b2..d4dd814 100644 --- a/src/idls/departure_labs.did.ts +++ b/src/idls/departure_labs.did.ts @@ -1,27 +1,17 @@ +/* eslint-disable @typescript-eslint/naming-convention */ export default ({ IDL }) => { - const Property = IDL.Rec(); + const CandyValue = IDL.Rec(); + const Property__1 = IDL.Rec(); const Query = IDL.Rec(); const Update = IDL.Rec(); - const Callback = IDL.Func([], [], []); - const StagedWrite = IDL.Variant({ - 'Init' : IDL.Record({ 'size' : IDL.Nat, 'callback' : IDL.Opt(Callback) }), - 'Chunk' : IDL.Record({ - 'chunk' : IDL.Vec(IDL.Nat8), - 'callback' : IDL.Opt(Callback), - }), - }); - const AssetRequest = IDL.Variant({ - 'Put' : IDL.Record({ - 'key' : IDL.Text, - 'contentType' : IDL.Text, - 'callback' : IDL.Opt(Callback), - 'payload' : IDL.Variant({ - 'StagedData' : IDL.Null, - 'Payload' : IDL.Vec(IDL.Nat8), - }), - }), - 'Remove' : IDL.Record({ 'key' : IDL.Text, 'callback' : IDL.Opt(Callback) }), - 'StagedWrite' : StagedWrite, + const CodeLine = IDL.Record({ + 'order' : IDL.Nat, + 'line' : IDL.Text, + 'lineNumber' : IDL.Nat, + 'nftID' : IDL.Opt(IDL.Text), + 'image' : IDL.Vec(IDL.Vec(IDL.Nat8)), + 'isNFT' : IDL.Bool, + 'sourceImage' : IDL.Nat, }); const AuthorizeRequest = IDL.Record({ 'p' : IDL.Principal, @@ -32,16 +22,129 @@ export default ({ IDL }) => { 'Immutable' : IDL.Null, 'NotFound' : IDL.Null, 'Unauthorized' : IDL.Null, + 'Restricted' : IDL.Null, 'InvalidRequest' : IDL.Null, 'AuthorizedPrincipalLimitReached' : IDL.Nat, }); const Result_1 = IDL.Variant({ 'ok' : IDL.Null, 'err' : Error }); + const TokenIdentifier__1 = IDL.Text; + const AccountIdentifier = IDL.Text; + const User = IDL.Variant({ + 'principal' : IDL.Principal, + 'address' : AccountIdentifier, + }); + const BalanceRequest = IDL.Record({ + 'token' : TokenIdentifier__1, + 'user' : User, + }); + const Balance = IDL.Nat; + const CommonError__1 = IDL.Variant({ + 'InvalidToken' : TokenIdentifier__1, + 'Other' : IDL.Text, + }); + const BalanceResponse = IDL.Variant({ + 'ok' : Balance, + 'err' : CommonError__1, + }); + const TokenIdentifier = IDL.Text; + const EXTAccountIdentifier = IDL.Text; + const CommonError = IDL.Variant({ + 'InvalidToken' : TokenIdentifier__1, + 'Other' : IDL.Text, + }); + const Result_10 = IDL.Variant({ + 'ok' : EXTAccountIdentifier, + 'err' : CommonError, + }); + const Property = IDL.Record({ + 'value' : CandyValue, + 'name' : IDL.Text, + 'immutable' : IDL.Bool, + }); + CandyValue.fill( + IDL.Variant({ + 'Int' : IDL.Int, + 'Nat' : IDL.Nat, + 'Empty' : IDL.Null, + 'Nat16' : IDL.Nat16, + 'Nat32' : IDL.Nat32, + 'Nat64' : IDL.Nat64, + 'Blob' : IDL.Vec(IDL.Nat8), + 'Bool' : IDL.Bool, + 'Int8' : IDL.Int8, + 'Nat8' : IDL.Nat8, + 'Text' : IDL.Text, + 'Bytes' : IDL.Variant({ + 'thawed' : IDL.Vec(IDL.Nat8), + 'frozen' : IDL.Vec(IDL.Nat8), + }), + 'Int16' : IDL.Int16, + 'Int32' : IDL.Int32, + 'Int64' : IDL.Int64, + 'Option' : IDL.Opt(CandyValue), + 'Floats' : IDL.Variant({ + 'thawed' : IDL.Vec(IDL.Float64), + 'frozen' : IDL.Vec(IDL.Float64), + }), + 'Float' : IDL.Float64, + 'Principal' : IDL.Principal, + 'Array' : IDL.Variant({ + 'thawed' : IDL.Vec(CandyValue), + 'frozen' : IDL.Vec(CandyValue), + }), + 'Class' : IDL.Vec(Property), + }) + ); + const AddressedChunk = IDL.Tuple(IDL.Nat, IDL.Nat, CandyValue); + const AddressedChunkArray = IDL.Vec(AddressedChunk); + const CandyValue__1 = IDL.Variant({ + 'Int' : IDL.Int, + 'Nat' : IDL.Nat, + 'Empty' : IDL.Null, + 'Nat16' : IDL.Nat16, + 'Nat32' : IDL.Nat32, + 'Nat64' : IDL.Nat64, + 'Blob' : IDL.Vec(IDL.Nat8), + 'Bool' : IDL.Bool, + 'Int8' : IDL.Int8, + 'Nat8' : IDL.Nat8, + 'Text' : IDL.Text, + 'Bytes' : IDL.Variant({ + 'thawed' : IDL.Vec(IDL.Nat8), + 'frozen' : IDL.Vec(IDL.Nat8), + }), + 'Int16' : IDL.Int16, + 'Int32' : IDL.Int32, + 'Int64' : IDL.Int64, + 'Option' : IDL.Opt(CandyValue), + 'Floats' : IDL.Variant({ + 'thawed' : IDL.Vec(IDL.Float64), + 'frozen' : IDL.Vec(IDL.Float64), + }), + 'Float' : IDL.Float64, + 'Principal' : IDL.Principal, + 'Array' : IDL.Variant({ + 'thawed' : IDL.Vec(CandyValue), + 'frozen' : IDL.Vec(CandyValue), + }), + 'Class' : IDL.Vec(Property), + }); + const Result_9 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text }); + const CandyProperty = IDL.Record({ + 'value' : CandyValue, + 'name' : IDL.Text, + 'immutable' : IDL.Bool, + }); + const Extension = IDL.Text; const ContractInfo = IDL.Record({ 'nft_payload_size' : IDL.Nat, 'memory_size' : IDL.Nat, 'max_live_size' : IDL.Nat, 'cycles' : IDL.Nat, + 'availableNFTs' : IDL.Nat, + 'lastTimeAwarded' : IDL.Int, 'total_minted' : IDL.Nat, + 'currentFee' : IDL.Nat, 'heap_size' : IDL.Nat, 'authorized_users' : IDL.Vec(IDL.Principal), }); @@ -71,11 +174,11 @@ export default ({ IDL }) => { 'topupAmount' : IDL.Nat, 'event' : IDL.Variant({ 'ContractEvent' : Contract, 'TokenEvent' : Token }), }); - const Callback__1 = IDL.Func([Message], [], []); + const Callback = IDL.Func([Message], [], []); const CallbackStatus = IDL.Record({ 'failedCalls' : IDL.Nat, 'failedCallsLimit' : IDL.Nat, - 'callback' : IDL.Opt(Callback__1), + 'callback' : IDL.Opt(Callback), 'noTopupCallLimit' : IDL.Nat, 'callsSinceLastTopup' : IDL.Nat, }); @@ -83,6 +186,14 @@ export default ({ IDL }) => { 'name' : IDL.Text, 'symbol' : IDL.Text, }); + const Properties = IDL.Vec(Property); + const Token__1 = IDL.Record({ + 'contentType' : IDL.Text, + 'createdAt' : IDL.Int, + 'properties' : Properties, + 'isPrivate' : IDL.Bool, + 'payload' : IDL.Vec(IDL.Vec(IDL.Nat8)), + }); const HeaderField = IDL.Tuple(IDL.Text, IDL.Text); const Request = IDL.Record({ 'url' : IDL.Text, @@ -116,35 +227,32 @@ export default ({ IDL }) => { 'streaming_strategy' : IDL.Opt(StreamingStrategy), 'status_code' : IDL.Nat16, }); - const Value = IDL.Variant({ - 'Int' : IDL.Int, - 'Nat' : IDL.Nat, - 'Empty' : IDL.Null, - 'Bool' : IDL.Bool, - 'Text' : IDL.Text, - 'Float' : IDL.Float64, - 'Principal' : IDL.Principal, - 'Class' : IDL.Vec(Property), - }); - Property.fill( - IDL.Record({ 'value' : Value, 'name' : IDL.Text, 'immutable' : IDL.Bool }) - ); - const Properties = IDL.Vec(Property); const Egg = IDL.Record({ 'contentType' : IDL.Text, 'owner' : IDL.Opt(IDL.Principal), 'properties' : Properties, + 'desiredID' : IDL.Opt(IDL.Text), 'isPrivate' : IDL.Bool, 'payload' : IDL.Variant({ 'StagedData' : IDL.Null, 'Payload' : IDL.Vec(IDL.Nat8), }), }); - const Result_5 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error }); + const MintRequest = IDL.Record({ + 'to' : User, + 'metadata' : IDL.Opt(IDL.Vec(IDL.Nat8)), + }); + const Result_8 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error }); + const Result_7 = IDL.Variant({ 'ok' : IDL.Vec(IDL.Text), 'err' : Error }); Query.fill(IDL.Record({ 'name' : IDL.Text, 'next' : IDL.Vec(Query) })); const QueryMode = IDL.Variant({ 'All' : IDL.Null, 'Some' : IDL.Vec(Query) }); const QueryRequest = IDL.Record({ 'id' : IDL.Text, 'mode' : QueryMode }); const Result = IDL.Variant({ 'ok' : Properties, 'err' : Error }); + const Result_6 = IDL.Variant({ + 'ok' : IDL.Tuple(IDL.Nat, IDL.Vec(IDL.Text)), + 'err' : IDL.Text, + }); + const Result_5 = IDL.Variant({ 'ok' : IDL.Bool, 'err' : IDL.Text }); const Chunk = IDL.Record({ 'data' : IDL.Vec(IDL.Nat8), 'totalPages' : IDL.Nat, @@ -164,73 +272,325 @@ export default ({ IDL }) => { }); const Result_4 = IDL.Variant({ 'ok' : PublicToken, 'err' : Error }); const Result_3 = IDL.Variant({ 'ok' : Chunk, 'err' : Error }); + const Value = IDL.Variant({ + 'Int' : IDL.Int, + 'Nat' : IDL.Nat, + 'Empty' : IDL.Null, + 'Bool' : IDL.Bool, + 'Text' : IDL.Text, + 'Float' : IDL.Float64, + 'Principal' : IDL.Principal, + 'Class' : IDL.Vec(Property__1), + }); + Property__1.fill( + IDL.Record({ 'value' : Value, 'name' : IDL.Text, 'immutable' : IDL.Bool }) + ); const Metadata = IDL.Record({ 'id' : IDL.Text, 'contentType' : IDL.Text, 'owner' : IDL.Principal, 'createdAt' : IDL.Int, - 'properties' : Properties, + 'properties' : IDL.Vec(Property__1), }); const Result_2 = IDL.Variant({ 'ok' : Metadata, 'err' : Error }); const UpdateEventCallback = IDL.Variant({ - 'Set' : Callback__1, + 'Set' : Callback, 'Remove' : IDL.Null, }); - const UpdateMode = IDL.Variant({ 'Set' : Value, 'Next' : IDL.Vec(Update) }); + const UpdateMode = IDL.Variant({ + 'Set' : CandyValue, + 'Next' : IDL.Vec(Update), + }); Update.fill(IDL.Record({ 'mode' : UpdateMode, 'name' : IDL.Text })); const UpdateRequest = IDL.Record({ 'id' : IDL.Text, 'update' : IDL.Vec(Update), }); - const Hub = IDL.Service({ - 'assetRequest' : IDL.Func([AssetRequest], [], []), + return IDL.Service({ + '__updateLicense' : IDL.Func([IDL.Nat, IDL.Opt(IDL.Text)], [IDL.Bool], []), + 'addCodeLine' : IDL.Func([CodeLine], [IDL.Bool], []), + 'adminClaim' : IDL.Func([IDL.Nat, IDL.Text], [IDL.Bool], []), + 'adminGiveCycles' : IDL.Func([IDL.Text, IDL.Nat], [IDL.Bool], []), 'authorize' : IDL.Func([AuthorizeRequest], [Result_1], []), - 'balanceOf' : IDL.Func([IDL.Principal], [IDL.Vec(IDL.Text)], []), + 'balance' : IDL.Func([BalanceRequest], [BalanceResponse], ['query']), + 'balanceOf' : IDL.Func([IDL.Principal], [IDL.Vec(IDL.Text)], ['query']), + 'bearer' : IDL.Func([TokenIdentifier], [Result_10], ['query']), + 'boolToBytes' : IDL.Func([IDL.Bool], [IDL.Vec(IDL.Nat8)], ['query']), + 'byteBufferChunksToValueUnstableBufferDataZone' : IDL.Func( + [IDL.Vec(IDL.Vec(IDL.Nat8))], + [AddressedChunkArray], + ['query'], + ), + 'byteBufferDataZoneToBuffer' : IDL.Func( + [AddressedChunkArray], + [IDL.Vec(IDL.Vec(IDL.Nat8))], + ['query'], + ), + 'bytesToBool' : IDL.Func([IDL.Vec(IDL.Nat8)], [IDL.Bool], ['query']), + 'bytesToInt' : IDL.Func([IDL.Vec(IDL.Nat8)], [IDL.Int], ['query']), + 'bytesToNat' : IDL.Func([IDL.Vec(IDL.Nat8)], [IDL.Nat], ['query']), + 'bytesToNat16' : IDL.Func([IDL.Vec(IDL.Nat8)], [IDL.Nat16], ['query']), + 'bytesToNat32' : IDL.Func([IDL.Vec(IDL.Nat8)], [IDL.Nat32], ['query']), + 'bytesToNat64' : IDL.Func([IDL.Vec(IDL.Nat8)], [IDL.Nat64], ['query']), + 'bytesToPrincipal' : IDL.Func( + [IDL.Vec(IDL.Nat8)], + [IDL.Principal], + ['query'], + ), + 'bytesToText' : IDL.Func([IDL.Vec(IDL.Nat8)], [IDL.Text], ['query']), + 'changeOwner' : IDL.Func([IDL.Text], [], []), + 'clear102' : IDL.Func([], [IDL.Bool], []), + 'clearCodeLines' : IDL.Func([], [IDL.Bool], []), + 'clearNFTs' : IDL.Func([], [IDL.Bool], []), + 'cloneValueUnstable' : IDL.Func( + [CandyValue__1], + [CandyValue__1], + ['query'], + ), + 'collect_share' : IDL.Func([IDL.Text, IDL.Opt(IDL.Nat)], [Result_9], []), + 'countAddressedChunksInWorkspace' : IDL.Func( + [AddressedChunkArray], + [IDL.Nat], + ['query'], + ), + 'creditBalanceOf' : IDL.Func([IDL.Text], [IDL.Opt(IDL.Nat)], ['query']), + 'cyclesBalanceOf' : IDL.Func([IDL.Text], [IDL.Opt(IDL.Nat)], ['query']), + 'destabalizeProperty' : IDL.Func( + [CandyProperty], + [CandyProperty], + ['query'], + ), + 'destabalizeValue' : IDL.Func([CandyValue__1], [CandyValue__1], ['query']), + 'destabalizeValueArray' : IDL.Func( + [IDL.Vec(CandyValue__1)], + [IDL.Vec(CandyValue__1)], + ['query'], + ), + 'emptyWorkspace' : IDL.Func([], [AddressedChunkArray], ['query']), + 'extensions' : IDL.Func([], [IDL.Vec(Extension)], ['query']), + 'fileAddressedChunks' : IDL.Func( + [AddressedChunkArray, AddressedChunkArray], + [AddressedChunkArray], + ['query'], + ), + 'flattenAddressedChunkArray' : IDL.Func( + [AddressedChunkArray], + [IDL.Vec(IDL.Nat8)], + ['query'], + ), + 'forceCodeUpdate' : IDL.Func([], [], []), + 'fromAddressedChunks' : IDL.Func( + [AddressedChunkArray], + [AddressedChunkArray], + ['query'], + ), + 'getAddressedChunkArraySize' : IDL.Func( + [AddressedChunkArray], + [IDL.Nat], + ['query'], + ), 'getAuthorized' : IDL.Func([IDL.Text], [IDL.Vec(IDL.Principal)], ['query']), - 'getContractInfo' : IDL.Func([], [ContractInfo], []), + 'getClassProperty' : IDL.Func( + [CandyValue__1, IDL.Text], + [CandyProperty], + ['query'], + ), + 'getCode' : IDL.Func([], [IDL.Text], ['query']), + 'getCodeLines' : IDL.Func([], [IDL.Vec(CodeLine)], ['query']), + 'getContractInfo' : IDL.Func([], [ContractInfo], ['query']), + 'getCurrentLog' : IDL.Func([], [IDL.Vec(CandyValue__1)], []), + 'getDataChunkFromAddressedChunkArray' : IDL.Func( + [AddressedChunkArray, IDL.Nat, IDL.Nat], + [CandyValue__1], + ['query'], + ), + 'getDataZoneSize' : IDL.Func([AddressedChunkArray], [IDL.Nat], ['query']), + 'getDefaultAccountID' : IDL.Func([], [IDL.Text], ['query']), 'getEventCallbackStatus' : IDL.Func([], [CallbackStatus], []), + 'getFeeInfo' : IDL.Func([], [IDL.Nat, IDL.Nat, IDL.Nat], ['query']), + 'getLogHistory' : IDL.Func( + [IDL.Nat], + [IDL.Vec(CandyValue__1), IDL.Nat], + [], + ), 'getMetadata' : IDL.Func([], [ContractMetadata], ['query']), + 'getNFTs' : IDL.Func( + [], + [ + IDL.Vec( + IDL.Tuple( + IDL.Text, + IDL.Tuple(IDL.Opt(IDL.Principal), IDL.Vec(IDL.Principal)), + Token__1, + ) + ), + ], + ['query'], + ), + 'getOwner' : IDL.Func([], [IDL.Principal], ['query']), + 'getTargetAccount' : IDL.Func([], [IDL.Text], ['query']), 'getTotalMinted' : IDL.Func([], [IDL.Nat], ['query']), + 'getValueSize' : IDL.Func([CandyValue__1], [IDL.Nat], ['query']), + 'getValueUnstableSize' : IDL.Func([CandyValue__1], [IDL.Nat], ['query']), + 'getWorkspaceChunk' : IDL.Func( + [AddressedChunkArray, IDL.Nat, IDL.Nat], + [ + IDL.Variant({ 'eof' : IDL.Null, 'chunk' : IDL.Null }), + AddressedChunkArray, + ], + ['query'], + ), + 'getWorkspaceChunkSize' : IDL.Func( + [AddressedChunkArray, IDL.Nat], + [IDL.Nat], + ['query'], + ), 'http_request' : IDL.Func([Request], [Response], ['query']), 'http_request_streaming_callback' : IDL.Func( [StreamingCallbackToken], [StreamingCallbackResponse], ['query'], ), - 'init' : IDL.Func([IDL.Vec(IDL.Principal), ContractMetadata], [], []), - 'isAuthorized' : IDL.Func([IDL.Text, IDL.Principal], [IDL.Bool], ['query']), - 'listAssets' : IDL.Func( - [], - [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, IDL.Nat))], + 'initDataZone' : IDL.Func( + [CandyValue__1], + [AddressedChunkArray], ['query'], ), + 'initNFTs' : IDL.Func([ContractMetadata], [], []), + 'initWorkspace' : IDL.Func([IDL.Nat], [AddressedChunkArray], ['query']), + 'intToBytes' : IDL.Func([IDL.Int], [IDL.Vec(IDL.Nat8)], ['query']), + 'isAuthorized' : IDL.Func([IDL.Text, IDL.Principal], [IDL.Bool], ['query']), 'mint' : IDL.Func([Egg], [IDL.Text], []), + 'mintNFT' : IDL.Func([MintRequest], [], []), + 'nat16ToBytes' : IDL.Func([IDL.Nat16], [IDL.Vec(IDL.Nat8)], ['query']), + 'nat32ToBytes' : IDL.Func([IDL.Nat32], [IDL.Vec(IDL.Nat8)], ['query']), + 'nat64ToBytes' : IDL.Func([IDL.Nat64], [IDL.Vec(IDL.Nat8)], ['query']), + 'natToBytes' : IDL.Func([IDL.Nat], [IDL.Vec(IDL.Nat8)], ['query']), 'nftStreamingCallback' : IDL.Func( [StreamingCallbackToken], [StreamingCallbackResponse], ['query'], ), - 'ownerOf' : IDL.Func([IDL.Text], [Result_5], ['query']), + 'ownerOf' : IDL.Func([IDL.Text], [Result_8], ['query']), + 'owns' : IDL.Func([], [Result_7], ['query']), + 'principalToBytes' : IDL.Func( + [IDL.Principal], + [IDL.Vec(IDL.Nat8)], + ['query'], + ), 'queryProperties' : IDL.Func([QueryRequest], [Result], ['query']), + 'redeemAndClaim' : IDL.Func([IDL.Opt(IDL.Nat64), IDL.Bool], [Result_6], []), + 'restrict' : IDL.Func([IDL.Text, IDL.Bool], [Result_5], []), + 'stabalizeProperty' : IDL.Func([CandyProperty], [CandyProperty], ['query']), + 'stabalizeValue' : IDL.Func([CandyValue__1], [CandyValue__1], ['query']), + 'stabalizeValueArray' : IDL.Func( + [IDL.Vec(CandyValue__1)], + [IDL.Vec(CandyValue__1)], + ['query'], + ), + 'stabalizeValueBuffer' : IDL.Func( + [AddressedChunkArray], + [IDL.Vec(CandyValue__1)], + ['query'], + ), 'staticStreamingCallback' : IDL.Func( [StreamingCallbackToken], [StreamingCallbackResponse], ['query'], ), + 'submit_kyc' : IDL.Func([IDL.Text, IDL.Text], [Result_5], []), + 'textToByteBuffer' : IDL.Func([IDL.Text], [IDL.Vec(IDL.Nat8)], ['query']), + 'textToBytes' : IDL.Func([IDL.Text], [IDL.Vec(IDL.Nat8)], ['query']), 'tokenByIndex' : IDL.Func([IDL.Text], [Result_4], []), 'tokenChunkByIndex' : IDL.Func([IDL.Text, IDL.Nat], [Result_3], []), 'tokenMetadataByIndex' : IDL.Func([IDL.Text], [Result_2], []), 'transfer' : IDL.Func([IDL.Principal, IDL.Text], [Result_1], []), + 'unwrapOptionValue' : IDL.Func([CandyValue__1], [CandyValue__1], ['query']), + 'unwrapOptionValueUnstable' : IDL.Func( + [CandyValue__1], + [CandyValue__1], + ['query'], + ), + 'updateAramakmeLMCanister' : IDL.Func([IDL.Text], [], []), + 'updateBaseFee' : IDL.Func([IDL.Nat], [], []), + 'updateCandyLMCanister' : IDL.Func([IDL.Text], [], []), 'updateContractOwners' : IDL.Func( [IDL.Principal, IDL.Bool], [Result_1], [], ), + 'updateCurrentFee' : IDL.Func([IDL.Nat], [], []), 'updateEventCallback' : IDL.Func([UpdateEventCallback], [], []), + 'updateKYCRequired' : IDL.Func([IDL.Bool], [], []), + 'updateKYCServer' : IDL.Func([IDL.Text], [], []), + 'updateLastTimeAwarded' : IDL.Func([], [], []), + 'updateLedgerProxy' : IDL.Func([IDL.Text], [], []), + 'updateMinCycles' : IDL.Func([IDL.Nat], [], []), 'updateProperties' : IDL.Func([UpdateRequest], [Result], []), + 'updateTargetAccount' : IDL.Func([IDL.Text], [], []), + 'valueToBlob' : IDL.Func([CandyValue__1], [IDL.Vec(IDL.Nat8)], ['query']), + 'valueToBool' : IDL.Func([CandyValue__1], [IDL.Bool], ['query']), + 'valueToBytes' : IDL.Func([CandyValue__1], [IDL.Vec(IDL.Nat8)], ['query']), + 'valueToFloat' : IDL.Func([CandyValue__1], [IDL.Float64], ['query']), + 'valueToInt' : IDL.Func([CandyValue__1], [IDL.Int], ['query']), + 'valueToInt16' : IDL.Func([CandyValue__1], [IDL.Int16], ['query']), + 'valueToInt32' : IDL.Func([CandyValue__1], [IDL.Int32], ['query']), + 'valueToInt64' : IDL.Func([CandyValue__1], [IDL.Int64], ['query']), + 'valueToInt8' : IDL.Func([CandyValue__1], [IDL.Int8], ['query']), + 'valueToNat' : IDL.Func([CandyValue__1], [IDL.Nat], ['query']), + 'valueToNat16' : IDL.Func([CandyValue__1], [IDL.Nat16], ['query']), + 'valueToNat32' : IDL.Func([CandyValue__1], [IDL.Nat32], ['query']), + 'valueToNat64' : IDL.Func([CandyValue__1], [IDL.Nat64], ['query']), + 'valueToNat8' : IDL.Func([CandyValue__1], [IDL.Nat8], ['query']), + 'valueToText' : IDL.Func([CandyValue__1], [IDL.Text], ['query']), + 'valueUnstableToBlob' : IDL.Func( + [CandyValue__1], + [IDL.Vec(IDL.Nat8)], + ['query'], + ), + 'valueUnstableToBool' : IDL.Func([CandyValue__1], [IDL.Bool], ['query']), + 'valueUnstableToBytes' : IDL.Func( + [CandyValue__1], + [IDL.Vec(IDL.Nat8)], + ['query'], + ), + 'valueUnstableToBytesBuffer' : IDL.Func( + [CandyValue__1], + [IDL.Vec(IDL.Nat8)], + ['query'], + ), + 'valueUnstableToFloat' : IDL.Func( + [CandyValue__1], + [IDL.Float64], + ['query'], + ), + 'valueUnstableToFloatsBuffer' : IDL.Func( + [CandyValue__1], + [IDL.Vec(IDL.Float64)], + ['query'], + ), + 'valueUnstableToInt' : IDL.Func([CandyValue__1], [IDL.Int], ['query']), + 'valueUnstableToInt16' : IDL.Func([CandyValue__1], [IDL.Int16], ['query']), + 'valueUnstableToInt32' : IDL.Func([CandyValue__1], [IDL.Int32], ['query']), + 'valueUnstableToInt64' : IDL.Func([CandyValue__1], [IDL.Int64], ['query']), + 'valueUnstableToInt8' : IDL.Func([CandyValue__1], [IDL.Int8], ['query']), + 'valueUnstableToNat' : IDL.Func([CandyValue__1], [IDL.Nat], ['query']), + 'valueUnstableToNat16' : IDL.Func([CandyValue__1], [IDL.Nat16], ['query']), + 'valueUnstableToNat32' : IDL.Func([CandyValue__1], [IDL.Nat32], ['query']), + 'valueUnstableToNat64' : IDL.Func([CandyValue__1], [IDL.Nat64], ['query']), + 'valueUnstableToNat8' : IDL.Func([CandyValue__1], [IDL.Nat8], ['query']), + 'valueUnstableToText' : IDL.Func([CandyValue__1], [IDL.Text], ['query']), 'wallet_receive' : IDL.Func([], [], []), - 'writeStaged' : IDL.Func([StagedWrite], [], []), + 'wallet_withdraw' : IDL.Func([IDL.Text, IDL.Nat], [IDL.Bool], []), + 'workspaceDeepClone' : IDL.Func( + [AddressedChunkArray], + [AddressedChunkArray], + ['query'], + ), + 'workspaceToAddressedChunkArray' : IDL.Func( + [AddressedChunkArray], + [AddressedChunkArray], + ['query'], + ), }); - return Hub; -}; -export const init = ({ }) => { return []; }; +}; \ No newline at end of file diff --git a/src/idls/ext.did.ts b/src/idls/ext.did.ts index 5b93bb9..9df074a 100644 --- a/src/idls/ext.did.ts +++ b/src/idls/ext.did.ts @@ -1,49 +1,136 @@ -/* eslint-disable @typescript-eslint/camelcase */ -/* eslint-disable camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ export default ({ IDL }) => { + const File = IDL.Record({ + data: IDL.Vec(IDL.Vec(IDL.Nat8)), + ctype: IDL.Text, + }); + const Asset = IDL.Record({ + thumbnail: IDL.Opt(File), + name: IDL.Text, + payload: File, + }); + const SubAccount__1 = IDL.Vec(IDL.Nat8); const TokenIndex = IDL.Nat32; const AccountIdentifier = IDL.Text; - const TokenIdentifier = IDL.Text; - const Balance = IDL.Nat; - const Time = IDL.Int; - const SubAccount = IDL.Vec(IDL.Nat8); - const Memo = IDL.Vec(IDL.Nat8); - const Listing = IDL.Record({ - locked: IDL.Opt(Time), + const Settlement = IDL.Record({ + subaccount: SubAccount__1, seller: IDL.Principal, + buyer: AccountIdentifier, price: IDL.Nat64, }); + const TokenIdentifier = IDL.Text; + const AccountIdentifier__1 = IDL.Text; const User = IDL.Variant({ principal: IDL.Principal, - address: AccountIdentifier, + address: AccountIdentifier__1, }); + const BalanceRequest = IDL.Record({ + token: TokenIdentifier, + user: User, + }); + const Balance = IDL.Nat; + const CommonError__1 = IDL.Variant({ + InvalidToken: TokenIdentifier, + Other: IDL.Text, + }); + const BalanceResponse = IDL.Variant({ + ok: Balance, + err: CommonError__1, + }); + const TokenIdentifier__1 = IDL.Text; const CommonError = IDL.Variant({ InvalidToken: TokenIdentifier, Other: IDL.Text, }); - - const BalanceRequest = IDL.Record({ - token: TokenIdentifier, - user: User, + const Result_5 = IDL.Variant({ + ok: AccountIdentifier, + err: CommonError, + }); + const Time = IDL.Int; + const Listing = IDL.Record({ + locked: IDL.Opt(Time), + seller: IDL.Principal, + price: IDL.Nat64, }); - const BalanceResult = IDL.Variant({ ok: Balance, err: CommonError }); - - const DetailsResult = IDL.Variant({ + const Result_6 = IDL.Variant({ ok: IDL.Tuple(AccountIdentifier, IDL.Opt(Listing)), err: CommonError, }); - - const TokensResult = IDL.Variant({ + const Extension = IDL.Text; + const Metadata = IDL.Variant({ + fungible: IDL.Record({ + decimals: IDL.Nat8, + metadata: IDL.Opt(IDL.Vec(IDL.Nat8)), + name: IDL.Text, + symbol: IDL.Text, + }), + nonfungible: IDL.Record({ metadata: IDL.Opt(IDL.Vec(IDL.Nat8)) }), + }); + const HeaderField = IDL.Tuple(IDL.Text, IDL.Text); + const HttpRequest = IDL.Record({ + url: IDL.Text, + method: IDL.Text, + body: IDL.Vec(IDL.Nat8), + headers: IDL.Vec(HeaderField), + }); + const HttpStreamingCallbackToken = IDL.Record({ + key: IDL.Text, + sha256: IDL.Opt(IDL.Vec(IDL.Nat8)), + index: IDL.Nat, + content_encoding: IDL.Text, + }); + const HttpStreamingCallbackResponse = IDL.Record({ + token: IDL.Opt(HttpStreamingCallbackToken), + body: IDL.Vec(IDL.Nat8), + }); + const HttpStreamingStrategy = IDL.Variant({ + Callback: IDL.Record({ + token: HttpStreamingCallbackToken, + callback: IDL.Func( + [HttpStreamingCallbackToken], + [HttpStreamingCallbackResponse], + ["query"] + ), + }), + }); + const HttpResponse = IDL.Record({ + body: IDL.Vec(IDL.Nat8), + headers: IDL.Vec(HeaderField), + streaming_strategy: IDL.Opt(HttpStreamingStrategy), + status_code: IDL.Nat16, + }); + const ListRequest = IDL.Record({ + token: TokenIdentifier__1, + from_subaccount: IDL.Opt(SubAccount__1), + price: IDL.Opt(IDL.Nat64), + }); + const Result_3 = IDL.Variant({ ok: IDL.Null, err: CommonError }); + const Result_4 = IDL.Variant({ ok: Metadata, err: CommonError }); + const MintingRequest = IDL.Record({ + to: AccountIdentifier, + asset: IDL.Nat32, + }); + const Balance__1 = IDL.Nat; + const Result_2 = IDL.Variant({ ok: Balance__1, err: CommonError }); + const Result_1 = IDL.Variant({ ok: IDL.Vec(TokenIndex), err: CommonError, }); - const TokenExtResult = IDL.Variant({ + const Result = IDL.Variant({ ok: IDL.Vec( IDL.Tuple(TokenIndex, IDL.Opt(Listing), IDL.Opt(IDL.Vec(IDL.Nat8))) ), err: CommonError, }); - + const Transaction = IDL.Record({ + token: TokenIdentifier__1, + time: Time, + seller: IDL.Principal, + buyer: AccountIdentifier, + price: IDL.Nat64, + }); + const Memo = IDL.Vec(IDL.Nat8); + const SubAccount = IDL.Vec(IDL.Nat8); const TransferRequest = IDL.Record({ to: User, token: TokenIdentifier, @@ -53,36 +140,96 @@ export default ({ IDL }) => { subaccount: IDL.Opt(SubAccount), amount: Balance, }); - const TransferResult = IDL.Variant({ + const TransferResponse = IDL.Variant({ ok: Balance, err: IDL.Variant({ - CannotNotify: AccountIdentifier, + CannotNotify: AccountIdentifier__1, InsufficientBalance: IDL.Null, InvalidToken: TokenIdentifier, Rejected: IDL.Null, - Unauthorized: AccountIdentifier, + Unauthorized: AccountIdentifier__1, Other: IDL.Text, }), }); - const Metadata = IDL.Variant({ - fungible: IDL.Record({ - decimals: IDL.Nat8, - metadata: IDL.Opt(IDL.Vec(IDL.Nat8)), - name: IDL.Text, - symbol: IDL.Text, - }), - nonfungible: IDL.Record({ metadata: IDL.Opt(IDL.Vec(IDL.Nat8)) }), - }); - const MetadataResult = IDL.Variant({ ok: Metadata, err: CommonError }); return IDL.Service({ - balance: IDL.Func([BalanceRequest], [BalanceResult], ['query']), - details: IDL.Func([TokenIdentifier], [DetailsResult], ['query']), - tokens: IDL.Func([AccountIdentifier], [TokensResult], ['query']), - tokens_ext: IDL.Func([AccountIdentifier], [TokenExtResult], []), - transfer: IDL.Func([TransferRequest], [TransferResult], []), - metadata: IDL.Func([TokenIdentifier], [MetadataResult], ['query']), + acceptCycles: IDL.Func([], [], []), + addAsset: IDL.Func([Asset], [IDL.Nat], []), + allPayments: IDL.Func( + [], + [IDL.Vec(IDL.Tuple(IDL.Principal, IDL.Vec(SubAccount__1)))], + ["query"] + ), + allSettlements: IDL.Func( + [], + [IDL.Vec(IDL.Tuple(TokenIndex, Settlement))], + ["query"] + ), + availableCycles: IDL.Func([], [IDL.Nat], ["query"]), + balance: IDL.Func([BalanceRequest], [BalanceResponse], ["query"]), + bearer: IDL.Func([TokenIdentifier__1], [Result_5], ["query"]), + clearPayments: IDL.Func([IDL.Principal, IDL.Vec(SubAccount__1)], [], []), + details: IDL.Func([TokenIdentifier__1], [Result_6], ["query"]), + extensions: IDL.Func([], [IDL.Vec(Extension)], ["query"]), + getMinter: IDL.Func([], [IDL.Principal], ["query"]), + getRegistry: IDL.Func( + [], + [IDL.Vec(IDL.Tuple(TokenIndex, AccountIdentifier))], + ["query"] + ), + getTokens: IDL.Func( + [], + [IDL.Vec(IDL.Tuple(TokenIndex, Metadata))], + ["query"] + ), + http_request: IDL.Func([HttpRequest], [HttpResponse], ["query"]), + http_request_streaming_callback: IDL.Func( + [HttpStreamingCallbackToken], + [HttpStreamingCallbackResponse], + ["query"] + ), + list: IDL.Func([ListRequest], [Result_3], []), + list_bulk: IDL.Func( + [IDL.Vec(IDL.Tuple(TokenIndex, IDL.Nat64))], + [IDL.Vec(IDL.Tuple(TokenIndex, IDL.Nat64))], + [] + ), + listings: IDL.Func( + [], + [IDL.Vec(IDL.Tuple(TokenIndex, Listing, Metadata))], + ["query"] + ), + lock: IDL.Func( + [TokenIdentifier__1, IDL.Nat64, AccountIdentifier, SubAccount__1], + [Result_5], + [] + ), + metadata: IDL.Func([TokenIdentifier__1], [Result_4], ["query"]), + mintNFT: IDL.Func([MintingRequest], [TokenIndex], []), + payments: IDL.Func([], [IDL.Opt(IDL.Vec(SubAccount__1))], ["query"]), + removePayments: IDL.Func([IDL.Vec(SubAccount__1)], [], []), + setMinter: IDL.Func([IDL.Principal], [], []), + settle: IDL.Func([TokenIdentifier__1], [Result_3], []), + settlements: IDL.Func( + [], + [IDL.Vec(IDL.Tuple(TokenIndex, AccountIdentifier, IDL.Nat64))], + ["query"] + ), + stats: IDL.Func( + [], + [IDL.Nat64, IDL.Nat64, IDL.Nat64, IDL.Nat64, IDL.Nat, IDL.Nat, IDL.Nat], + ["query"] + ), + streamAsset: IDL.Func([IDL.Nat, IDL.Bool, IDL.Vec(IDL.Nat8)], [], []), + supply: IDL.Func([TokenIdentifier__1], [Result_2], ["query"]), + tokens: IDL.Func([AccountIdentifier], [Result_1], ["query"]), + tokens_ext: IDL.Func([AccountIdentifier], [Result], ["query"]), + transactions: IDL.Func([], [IDL.Vec(Transaction)], ["query"]), + transfer: IDL.Func([TransferRequest], [TransferResponse], []), + transfer_bulk: IDL.Func( + [IDL.Vec(IDL.Tuple(TokenIndex, AccountIdentifier))], + [IDL.Vec(IDL.Tuple(TokenIndex, AccountIdentifier))], + [] + ), + updateThumb: IDL.Func([IDL.Text, File], [IDL.Opt(IDL.Nat)], []), }); }; -export const init = () => { - return []; -}; diff --git a/src/idls/icpunks.did.ts b/src/idls/icpunks.did.ts index 50785b9..9016e03 100644 --- a/src/idls/icpunks.did.ts +++ b/src/idls/icpunks.did.ts @@ -1,24 +1,148 @@ -/* eslint-disable camelcase */ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ export default ({ IDL }) => { - const Property = IDL.Record({ value: IDL.Text, name: IDL.Text }); - const TokenDesc = IDL.Record({ - id: IDL.Nat, - url: IDL.Text, - owner: IDL.Principal, - desc: IDL.Text, - name: IDL.Text, - properties: IDL.Vec(Property), - }); - const TokenIndex = IDL.Nat; - - const ICPunk = IDL.Service({ - data_of: IDL.Func([TokenIndex], [TokenDesc], []), - transfer_to: IDL.Func([IDL.Principal, TokenIndex], [IDL.Bool], []), - user_tokens: IDL.Func([IDL.Principal], [IDL.Vec(IDL.Nat)], []), - }); - return ICPunk; -}; -export const init = ({ IDL }) => { - return [IDL.Text, IDL.Text, IDL.Nat, IDL.Principal]; -}; + const Property = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text }); + const TokenDesc_2 = IDL.Record({ + 'id' : IDL.Nat, + 'url' : IDL.Text, + 'owner' : IDL.Principal, + 'desc' : IDL.Text, + 'name' : IDL.Text, + 'properties' : IDL.Vec(Property), + }); + const TokenDesc = TokenDesc_2; + const ICPTs = IDL.Record({ 'e8s' : IDL.Nat64 }); + const Time = IDL.Int; + const Listing_2 = IDL.Record({ + 'tokenId' : IDL.Nat, + 'owner' : IDL.Principal, + 'timestamp' : Time, + 'price' : IDL.Nat64, + }); + const Listing = Listing_2; + const Operation = IDL.Variant({ + 'init' : IDL.Null, + 'list' : IDL.Null, + 'mint' : IDL.Null, + 'delist' : IDL.Null, + 'transfer' : IDL.Null, + 'purchase' : IDL.Null, + }); + const Operation_3 = Operation; + const StorageActor = IDL.Service({ + 'addRecord' : IDL.Func( + [ + IDL.Principal, + Operation_3, + IDL.Opt(IDL.Principal), + IDL.Opt(IDL.Principal), + IDL.Nat, + IDL.Opt(IDL.Nat64), + Time, + ], + [IDL.Nat], + [], + ), + }); + const HeaderField = IDL.Tuple(IDL.Text, IDL.Text); + const HttpRequest_2 = IDL.Record({ + 'url' : IDL.Text, + 'method' : IDL.Text, + 'body' : IDL.Vec(IDL.Nat8), + 'headers' : IDL.Vec(HeaderField), + }); + const HttpRequest = HttpRequest_2; + const StreamingCallbackToken = IDL.Record({ + 'key' : IDL.Text, + 'sha256' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'index' : IDL.Nat, + 'content_encoding' : IDL.Text, + }); + const StreamingCallbackResponse = IDL.Record({ + 'token' : IDL.Opt(StreamingCallbackToken), + 'body' : IDL.Vec(IDL.Nat8), + }); + const StreamingStrategy = IDL.Variant({ + 'Callback' : IDL.Record({ + 'token' : StreamingCallbackToken, + 'callback' : IDL.Func( + [StreamingCallbackToken], + [StreamingCallbackResponse], + ['query'], + ), + }), + }); + const HttpResponse_2 = IDL.Record({ + 'body' : IDL.Vec(IDL.Nat8), + 'headers' : IDL.Vec(HeaderField), + 'streaming_strategy' : IDL.Opt(StreamingStrategy), + 'status_code' : IDL.Nat16, + }); + const HttpResponse = HttpResponse_2; + const MintRequest_2 = IDL.Record({ + 'url' : IDL.Text, + 'dataurl' : IDL.Text, + 'accountid' : IDL.Text, + 'contentType' : IDL.Text, + 'data' : IDL.Vec(IDL.Nat8), + 'desc' : IDL.Text, + 'name' : IDL.Text, + 'properties' : IDL.Vec(Property), + }); + const MintRequest = MintRequest_2; + return IDL.Service({ + 'acceptCycles' : IDL.Func([], [], []), + 'add_genesis_record' : IDL.Func([], [IDL.Nat], []), + 'availableCycles' : IDL.Func([], [IDL.Nat], ['query']), + 'data_of' : IDL.Func([IDL.Nat], [TokenDesc], ['query']), + 'delist' : IDL.Func([IDL.Nat], [IDL.Bool], []), + 'disableMint' : IDL.Func([], [IDL.Bool], []), + 'enableMint' : IDL.Func([], [IDL.Bool], []), + 'getAccountBalance' : IDL.Func([IDL.Text], [ICPTs], []), + 'getAccountID' : IDL.Func([IDL.Nat8, IDL.Nat8], [IDL.Text], ['query']), + 'getBalance' : IDL.Func([], [ICPTs], []), + 'getBunny' : IDL.Func([IDL.Nat], [IDL.Opt(IDL.Text)], []), + 'getCurrentToken' : IDL.Func([], [IDL.Nat], ['query']), + 'getPrice' : IDL.Func([], [IDL.Nat64], []), + 'getPunks' : IDL.Func([], [IDL.Vec(IDL.Nat)], []), + 'getToken' : IDL.Func([IDL.Text], [IDL.Opt(IDL.Nat)], []), + 'get_cycles' : IDL.Func([], [IDL.Nat], ['query']), + 'get_listed' : IDL.Func([IDL.Nat], [IDL.Vec(Listing)], ['query']), + 'get_storage_canister' : IDL.Func([], [IDL.Opt(StorageActor)], ['query']), + 'http_request' : IDL.Func([HttpRequest], [HttpResponse], ['query']), + 'individual_holders' : IDL.Func([], [IDL.Nat], ['query']), + 'list' : IDL.Func([IDL.Nat, IDL.Nat64], [IDL.Bool], []), + 'listSeeds' : IDL.Func([], [IDL.Vec(IDL.Opt(IDL.Text))], []), + 'manageSeeds' : IDL.Func([IDL.Text], [IDL.Bool], []), + 'mint' : IDL.Func([MintRequest], [IDL.Nat], []), + 'multi_mint' : IDL.Func([IDL.Vec(MintRequest)], [IDL.Vec(IDL.Nat)], []), + 'my_tokens' : IDL.Func([], [IDL.Vec(IDL.Nat)], []), + 'name' : IDL.Func([], [IDL.Text], ['query']), + 'nextAccount' : IDL.Func([], [IDL.Nat], []), + 'owner' : IDL.Func([], [IDL.Principal], ['query']), + 'owner_of' : IDL.Func([IDL.Nat], [IDL.Principal], ['query']), + 'remainingTokens' : IDL.Func([], [IDL.Nat], ['query']), + 'setLocal' : IDL.Func([], [IDL.Bool], []), + 'setPrice' : IDL.Func([IDL.Nat64], [IDL.Bool], []), + 'set_ledger_canister_id' : IDL.Func( + [IDL.Opt(IDL.Principal)], + [IDL.Bool], + [], + ), + 'set_owner' : IDL.Func([IDL.Principal], [IDL.Bool], []), + 'set_storage_canister_id' : IDL.Func( + [IDL.Opt(IDL.Principal)], + [IDL.Bool], + [], + ), + 'symbol' : IDL.Func([], [IDL.Text], ['query']), + 'tokenAccounts' : IDL.Func([IDL.Text], [IDL.Text], []), + 'total_supply' : IDL.Func([], [IDL.Nat], ['query']), + 'transfer_to' : IDL.Func([IDL.Principal, IDL.Nat], [IDL.Bool], []), + 'user_tokens' : IDL.Func([IDL.Principal], [IDL.Vec(IDL.Nat)], ['query']), + 'wallet_receive' : IDL.Func( + [], + [IDL.Record({ 'accepted' : IDL.Nat64 })], + [], + ), + }); +}; \ No newline at end of file diff --git a/src/interfaces/departure_labs.ts b/src/interfaces/departure_labs.ts index 536c466..ed44dab 100644 --- a/src/interfaces/departure_labs.ts +++ b/src/interfaces/departure_labs.ts @@ -1,34 +1,97 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import type { Principal } from '@dfinity/principal'; -export type AssetRequest = { - 'Put' : { - 'key' : string, - 'contentType' : string, - 'callback' : [] | [Callback], - 'payload' : { 'StagedData' : null } | - { 'Payload' : Array }, - } - } | - { 'Remove' : { 'key' : string, 'callback' : [] | [Callback] } } | - { 'StagedWrite' : StagedWrite }; + +export type AccountIdentifier = string; +export type AddressedChunk = [bigint, bigint, CandyValue]; +export type AddressedChunkArray = Array; export interface AuthorizeRequest { 'p' : Principal, 'id' : string, 'isAuthorized' : boolean, -} -export type Callback = () => Promise; +}; +export type Balance = bigint; +export interface BalanceRequest { 'token' : TokenIdentifier__1, 'user' : User }; +export type BalanceResponse = { 'ok' : Balance } | + { 'err' : CommonError__1 }; +export type Callback = (arg_0: Message) => Promise; export interface CallbackStatus { 'failedCalls' : bigint, 'failedCallsLimit' : bigint, - 'callback' : [] | [Callback__1], + 'callback' : [] | [Callback], 'noTopupCallLimit' : bigint, 'callsSinceLastTopup' : bigint, -} -export type Callback__1 = (arg_0: Message) => Promise; +}; +export interface CandyProperty { + 'value' : CandyValue, + 'name' : string, + 'immutable' : boolean, +}; +export type CandyValue = { 'Int' : bigint } | + { 'Nat' : bigint } | + { 'Empty' : null } | + { 'Nat16' : number } | + { 'Nat32' : number } | + { 'Nat64' : bigint } | + { 'Blob' : Array } | + { 'Bool' : boolean } | + { 'Int8' : number } | + { 'Nat8' : number } | + { 'Text' : string } | + { 'Bytes' : { 'thawed' : Array } | { 'frozen' : Array } } | + { 'Int16' : number } | + { 'Int32' : number } | + { 'Int64' : bigint } | + { 'Option' : [] | [CandyValue] } | + { 'Floats' : { 'thawed' : Array } | { 'frozen' : Array } } | + { 'Float' : number } | + { 'Principal' : Principal } | + { + 'Array' : { 'thawed' : Array } | + { 'frozen' : Array } + } | + { 'Class' : Array }; +export type CandyValue__1 = { 'Int' : bigint } | + { 'Nat' : bigint } | + { 'Empty' : null } | + { 'Nat16' : number } | + { 'Nat32' : number } | + { 'Nat64' : bigint } | + { 'Blob' : Array } | + { 'Bool' : boolean } | + { 'Int8' : number } | + { 'Nat8' : number } | + { 'Text' : string } | + { 'Bytes' : { 'thawed' : Array } | { 'frozen' : Array } } | + { 'Int16' : number } | + { 'Int32' : number } | + { 'Int64' : bigint } | + { 'Option' : [] | [CandyValue] } | + { 'Floats' : { 'thawed' : Array } | { 'frozen' : Array } } | + { 'Float' : number } | + { 'Principal' : Principal } | + { + 'Array' : { 'thawed' : Array } | + { 'frozen' : Array } + } | + { 'Class' : Array }; export interface Chunk { 'data' : Array, 'totalPages' : bigint, 'nextPage' : [] | [bigint], -} +}; +export interface CodeLine { + 'order' : bigint, + 'line' : string, + 'lineNumber' : bigint, + 'nftID' : [] | [string], + 'image' : Array>, + 'isNFT' : boolean, + 'sourceImage' : bigint, +}; +export type CommonError = { 'InvalidToken' : TokenIdentifier__1 } | + { 'Other' : string }; +export type CommonError__1 = { 'InvalidToken' : TokenIdentifier__1 } | + { 'Other' : string }; export type Contract = { 'ContractAuthorize' : { 'isAuthorized' : boolean, 'user' : Principal } } | @@ -38,86 +101,60 @@ export interface ContractInfo { 'memory_size' : bigint, 'max_live_size' : bigint, 'cycles' : bigint, + 'availableNFTs' : bigint, + 'lastTimeAwarded' : bigint, 'total_minted' : bigint, + 'currentFee' : bigint, 'heap_size' : bigint, 'authorized_users' : Array, -} -export interface ContractMetadata { 'name' : string, 'symbol' : string } +}; +export interface ContractMetadata { 'name' : string, 'symbol' : string }; +export type EXTAccountIdentifier = string; export interface Egg { 'contentType' : string, 'owner' : [] | [Principal], 'properties' : Properties, + 'desiredID' : [] | [string], 'isPrivate' : boolean, 'payload' : { 'StagedData' : null } | { 'Payload' : Array }, -} +}; export type Error = { 'Immutable' : null } | { 'NotFound' : null } | { 'Unauthorized' : null } | + { 'Restricted' : null } | { 'InvalidRequest' : null } | { 'AuthorizedPrincipalLimitReached' : bigint }; +export type Extension = string; export type HeaderField = [string, string]; -export interface Hub { - 'assetRequest' : (arg_0: AssetRequest) => Promise, - 'authorize' : (arg_0: AuthorizeRequest) => Promise, - 'balanceOf' : (arg_0: Principal) => Promise>, - 'getAuthorized' : (arg_0: string) => Promise>, - 'getContractInfo' : () => Promise, - 'getEventCallbackStatus' : () => Promise, - 'getMetadata' : () => Promise, - 'getTotalMinted' : () => Promise, - 'http_request' : (arg_0: Request) => Promise, - 'http_request_streaming_callback' : ( - arg_0: StreamingCallbackToken, - ) => Promise, - 'init' : (arg_0: Array, arg_1: ContractMetadata) => Promise< - undefined - >, - 'isAuthorized' : (arg_0: string, arg_1: Principal) => Promise, - 'listAssets' : () => Promise>, - 'mint' : (arg_0: Egg) => Promise, - 'nftStreamingCallback' : (arg_0: StreamingCallbackToken) => Promise< - StreamingCallbackResponse - >, - 'ownerOf' : (arg_0: string) => Promise, - 'queryProperties' : (arg_0: QueryRequest) => Promise, - 'staticStreamingCallback' : (arg_0: StreamingCallbackToken) => Promise< - StreamingCallbackResponse - >, - 'tokenByIndex' : (arg_0: string) => Promise, - 'tokenChunkByIndex' : (arg_0: string, arg_1: bigint) => Promise, - 'tokenMetadataByIndex' : (arg_0: string) => Promise, - 'transfer' : (arg_0: Principal, arg_1: string) => Promise, - 'updateContractOwners' : (arg_0: Principal, arg_1: boolean) => Promise< - Result_1 - >, - 'updateEventCallback' : (arg_0: UpdateEventCallback) => Promise, - 'updateProperties' : (arg_0: UpdateRequest) => Promise, - 'wallet_receive' : () => Promise, - 'writeStaged' : (arg_0: StagedWrite) => Promise, -} export interface Message { 'topupCallback' : TopupCallback, 'createdAt' : bigint, 'topupAmount' : bigint, 'event' : { 'ContractEvent' : Contract } | { 'TokenEvent' : Token }, -} +}; export interface Metadata { 'id' : string, 'contentType' : string, 'owner' : Principal, 'createdAt' : bigint, - 'properties' : Properties, -} + 'properties' : Array, +}; +export interface MintRequest { 'to' : User, 'metadata' : [] | [Array] }; export type PayloadResult = { 'Complete' : Array } | { 'Chunk' : Chunk }; export type Properties = Array; export interface Property { + 'value' : CandyValue, + 'name' : string, + 'immutable' : boolean, +}; +export interface Property__1 { 'value' : Value, 'name' : string, 'immutable' : boolean, -} +}; export interface PublicToken { 'id' : string, 'contentType' : string, @@ -125,51 +162,57 @@ export interface PublicToken { 'createdAt' : bigint, 'properties' : Properties, 'payload' : PayloadResult, -} -export interface Query { 'name' : string, 'next' : Array } +}; +export interface Query { 'name' : string, 'next' : Array }; export type QueryMode = { 'All' : null } | { 'Some' : Array }; -export interface QueryRequest { 'id' : string, 'mode' : QueryMode } +export interface QueryRequest { 'id' : string, 'mode' : QueryMode }; export interface Request { 'url' : string, 'method' : string, 'body' : Array, 'headers' : Array, -} +}; export interface Response { 'body' : Array, 'headers' : Array, 'streaming_strategy' : [] | [StreamingStrategy], 'status_code' : number, -} +}; export type Result = { 'ok' : Properties } | { 'err' : Error }; export type Result_1 = { 'ok' : null } | { 'err' : Error }; +export type Result_10 = { 'ok' : EXTAccountIdentifier } | + { 'err' : CommonError }; export type Result_2 = { 'ok' : Metadata } | { 'err' : Error }; export type Result_3 = { 'ok' : Chunk } | { 'err' : Error }; export type Result_4 = { 'ok' : PublicToken } | { 'err' : Error }; -export type Result_5 = { 'ok' : Principal } | +export type Result_5 = { 'ok' : boolean } | + { 'err' : string }; +export type Result_6 = { 'ok' : [bigint, Array] } | + { 'err' : string }; +export type Result_7 = { 'ok' : Array } | { 'err' : Error }; -export type StagedWrite = { - 'Init' : { 'size' : bigint, 'callback' : [] | [Callback] } - } | - { 'Chunk' : { 'chunk' : Array, 'callback' : [] | [Callback] } }; +export type Result_8 = { 'ok' : Principal } | + { 'err' : Error }; +export type Result_9 = { 'ok' : bigint } | + { 'err' : string }; export type StreamingCallback = (arg_0: StreamingCallbackToken) => Promise< StreamingCallbackResponse >; export interface StreamingCallbackResponse { 'token' : [] | [StreamingCallbackToken], 'body' : Array, -} +}; export interface StreamingCallbackToken { 'key' : string, 'index' : bigint, 'content_encoding' : string, -} +}; export type StreamingStrategy = { 'Callback' : { 'token' : StreamingCallbackToken, @@ -184,13 +227,24 @@ export type Token = { } } | { 'Transfer' : { 'id' : string, 'to' : Principal, 'from' : Principal } }; +export type TokenIdentifier = string; +export type TokenIdentifier__1 = string; +export interface Token__1 { + 'contentType' : string, + 'createdAt' : bigint, + 'properties' : Properties, + 'isPrivate' : boolean, + 'payload' : Array>, +}; export type TopupCallback = () => Promise; -export interface Update { 'mode' : UpdateMode, 'name' : string } -export type UpdateEventCallback = { 'Set' : Callback__1 } | +export interface Update { 'mode' : UpdateMode, 'name' : string }; +export type UpdateEventCallback = { 'Set' : Callback } | { 'Remove' : null }; -export type UpdateMode = { 'Set' : Value } | +export type UpdateMode = { 'Set' : CandyValue } | { 'Next' : Array }; -export interface UpdateRequest { 'id' : string, 'update' : Array } +export interface UpdateRequest { 'id' : string, 'update' : Array }; +export type User = { 'principal' : Principal } | + { 'address' : AccountIdentifier }; export type Value = { 'Int' : bigint } | { 'Nat' : bigint } | { 'Empty' : null } | @@ -198,5 +252,204 @@ export type Value = { 'Int' : bigint } | { 'Text' : string } | { 'Float' : number } | { 'Principal' : Principal } | - { 'Class' : Array }; -export default interface _SERVICE extends Hub {} + { 'Class' : Array }; +export default interface _SERVICE { + '__updateLicense' : (arg_0: bigint, arg_1: [] | [string]) => Promise, + 'addCodeLine' : (arg_0: CodeLine) => Promise, + 'adminClaim' : (arg_0: bigint, arg_1: string) => Promise, + 'adminGiveCycles' : (arg_0: string, arg_1: bigint) => Promise, + 'authorize' : (arg_0: AuthorizeRequest) => Promise, + 'balance' : (arg_0: BalanceRequest) => Promise, + 'balanceOf' : (arg_0: Principal) => Promise>, + 'bearer' : (arg_0: TokenIdentifier) => Promise, + 'boolToBytes' : (arg_0: boolean) => Promise>, + 'byteBufferChunksToValueUnstableBufferDataZone' : ( + arg_0: Array>, + ) => Promise, + 'byteBufferDataZoneToBuffer' : (arg_0: AddressedChunkArray) => Promise< + Array> + >, + 'bytesToBool' : (arg_0: Array) => Promise, + 'bytesToInt' : (arg_0: Array) => Promise, + 'bytesToNat' : (arg_0: Array) => Promise, + 'bytesToNat16' : (arg_0: Array) => Promise, + 'bytesToNat32' : (arg_0: Array) => Promise, + 'bytesToNat64' : (arg_0: Array) => Promise, + 'bytesToPrincipal' : (arg_0: Array) => Promise, + 'bytesToText' : (arg_0: Array) => Promise, + 'changeOwner' : (arg_0: string) => Promise, + 'clear102' : () => Promise, + 'clearCodeLines' : () => Promise, + 'clearNFTs' : () => Promise, + 'cloneValueUnstable' : (arg_0: CandyValue__1) => Promise, + 'collect_share' : (arg_0: string, arg_1: [] | [bigint]) => Promise, + 'countAddressedChunksInWorkspace' : (arg_0: AddressedChunkArray) => Promise< + bigint + >, + 'creditBalanceOf' : (arg_0: string) => Promise<[] | [bigint]>, + 'cyclesBalanceOf' : (arg_0: string) => Promise<[] | [bigint]>, + 'destabalizeProperty' : (arg_0: CandyProperty) => Promise, + 'destabalizeValue' : (arg_0: CandyValue__1) => Promise, + 'destabalizeValueArray' : (arg_0: Array) => Promise< + Array + >, + 'emptyWorkspace' : () => Promise, + 'extensions' : () => Promise>, + 'fileAddressedChunks' : ( + arg_0: AddressedChunkArray, + arg_1: AddressedChunkArray, + ) => Promise, + 'flattenAddressedChunkArray' : (arg_0: AddressedChunkArray) => Promise< + Array + >, + 'forceCodeUpdate' : () => Promise, + 'fromAddressedChunks' : (arg_0: AddressedChunkArray) => Promise< + AddressedChunkArray + >, + 'getAddressedChunkArraySize' : (arg_0: AddressedChunkArray) => Promise< + bigint + >, + 'getAuthorized' : (arg_0: string) => Promise>, + 'getClassProperty' : (arg_0: CandyValue__1, arg_1: string) => Promise< + CandyProperty + >, + 'getCode' : () => Promise, + 'getCodeLines' : () => Promise>, + 'getContractInfo' : () => Promise, + 'getCurrentLog' : () => Promise>, + 'getDataChunkFromAddressedChunkArray' : ( + arg_0: AddressedChunkArray, + arg_1: bigint, + arg_2: bigint, + ) => Promise, + 'getDataZoneSize' : (arg_0: AddressedChunkArray) => Promise, + 'getDefaultAccountID' : () => Promise, + 'getEventCallbackStatus' : () => Promise, + 'getFeeInfo' : () => Promise<[bigint, bigint, bigint]>, + 'getLogHistory' : (arg_0: bigint) => Promise<[Array, bigint]>, + 'getMetadata' : () => Promise, + 'getNFTs' : () => Promise< + Array<[string, [[] | [Principal], Array], Token__1]> + >, + 'getOwner' : () => Promise, + 'getTargetAccount' : () => Promise, + 'getTotalMinted' : () => Promise, + 'getValueSize' : (arg_0: CandyValue__1) => Promise, + 'getValueUnstableSize' : (arg_0: CandyValue__1) => Promise, + 'getWorkspaceChunk' : ( + arg_0: AddressedChunkArray, + arg_1: bigint, + arg_2: bigint, + ) => Promise<[{ 'eof' : null } | { 'chunk' : null }, AddressedChunkArray]>, + 'getWorkspaceChunkSize' : ( + arg_0: AddressedChunkArray, + arg_1: bigint, + ) => Promise, + 'http_request' : (arg_0: Request) => Promise, + 'http_request_streaming_callback' : ( + arg_0: StreamingCallbackToken, + ) => Promise, + 'initDataZone' : (arg_0: CandyValue__1) => Promise, + 'initNFTs' : (arg_0: ContractMetadata) => Promise, + 'initWorkspace' : (arg_0: bigint) => Promise, + 'intToBytes' : (arg_0: bigint) => Promise>, + 'isAuthorized' : (arg_0: string, arg_1: Principal) => Promise, + 'mint' : (arg_0: Egg) => Promise, + 'mintNFT' : (arg_0: MintRequest) => Promise, + 'nat16ToBytes' : (arg_0: number) => Promise>, + 'nat32ToBytes' : (arg_0: number) => Promise>, + 'nat64ToBytes' : (arg_0: bigint) => Promise>, + 'natToBytes' : (arg_0: bigint) => Promise>, + 'nftStreamingCallback' : (arg_0: StreamingCallbackToken) => Promise< + StreamingCallbackResponse + >, + 'ownerOf' : (arg_0: string) => Promise, + 'owns' : () => Promise, + 'principalToBytes' : (arg_0: Principal) => Promise>, + 'queryProperties' : (arg_0: QueryRequest) => Promise, + 'redeemAndClaim' : (arg_0: [] | [bigint], arg_1: boolean) => Promise< + Result_6 + >, + 'restrict' : (arg_0: string, arg_1: boolean) => Promise, + 'stabalizeProperty' : (arg_0: CandyProperty) => Promise, + 'stabalizeValue' : (arg_0: CandyValue__1) => Promise, + 'stabalizeValueArray' : (arg_0: Array) => Promise< + Array + >, + 'stabalizeValueBuffer' : (arg_0: AddressedChunkArray) => Promise< + Array + >, + 'staticStreamingCallback' : (arg_0: StreamingCallbackToken) => Promise< + StreamingCallbackResponse + >, + 'submit_kyc' : (arg_0: string, arg_1: string) => Promise, + 'textToByteBuffer' : (arg_0: string) => Promise>, + 'textToBytes' : (arg_0: string) => Promise>, + 'tokenByIndex' : (arg_0: string) => Promise, + 'tokenChunkByIndex' : (arg_0: string, arg_1: bigint) => Promise, + 'tokenMetadataByIndex' : (arg_0: string) => Promise, + 'transfer' : (arg_0: Principal, arg_1: string) => Promise, + 'unwrapOptionValue' : (arg_0: CandyValue__1) => Promise, + 'unwrapOptionValueUnstable' : (arg_0: CandyValue__1) => Promise< + CandyValue__1 + >, + 'updateAramakmeLMCanister' : (arg_0: string) => Promise, + 'updateBaseFee' : (arg_0: bigint) => Promise, + 'updateCandyLMCanister' : (arg_0: string) => Promise, + 'updateContractOwners' : (arg_0: Principal, arg_1: boolean) => Promise< + Result_1 + >, + 'updateCurrentFee' : (arg_0: bigint) => Promise, + 'updateEventCallback' : (arg_0: UpdateEventCallback) => Promise, + 'updateKYCRequired' : (arg_0: boolean) => Promise, + 'updateKYCServer' : (arg_0: string) => Promise, + 'updateLastTimeAwarded' : () => Promise, + 'updateLedgerProxy' : (arg_0: string) => Promise, + 'updateMinCycles' : (arg_0: bigint) => Promise, + 'updateProperties' : (arg_0: UpdateRequest) => Promise, + 'updateTargetAccount' : (arg_0: string) => Promise, + 'valueToBlob' : (arg_0: CandyValue__1) => Promise>, + 'valueToBool' : (arg_0: CandyValue__1) => Promise, + 'valueToBytes' : (arg_0: CandyValue__1) => Promise>, + 'valueToFloat' : (arg_0: CandyValue__1) => Promise, + 'valueToInt' : (arg_0: CandyValue__1) => Promise, + 'valueToInt16' : (arg_0: CandyValue__1) => Promise, + 'valueToInt32' : (arg_0: CandyValue__1) => Promise, + 'valueToInt64' : (arg_0: CandyValue__1) => Promise, + 'valueToInt8' : (arg_0: CandyValue__1) => Promise, + 'valueToNat' : (arg_0: CandyValue__1) => Promise, + 'valueToNat16' : (arg_0: CandyValue__1) => Promise, + 'valueToNat32' : (arg_0: CandyValue__1) => Promise, + 'valueToNat64' : (arg_0: CandyValue__1) => Promise, + 'valueToNat8' : (arg_0: CandyValue__1) => Promise, + 'valueToText' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToBlob' : (arg_0: CandyValue__1) => Promise>, + 'valueUnstableToBool' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToBytes' : (arg_0: CandyValue__1) => Promise>, + 'valueUnstableToBytesBuffer' : (arg_0: CandyValue__1) => Promise< + Array + >, + 'valueUnstableToFloat' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToFloatsBuffer' : (arg_0: CandyValue__1) => Promise< + Array + >, + 'valueUnstableToInt' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToInt16' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToInt32' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToInt64' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToInt8' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToNat' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToNat16' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToNat32' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToNat64' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToNat8' : (arg_0: CandyValue__1) => Promise, + 'valueUnstableToText' : (arg_0: CandyValue__1) => Promise, + 'wallet_receive' : () => Promise, + 'wallet_withdraw' : (arg_0: string, arg_1: bigint) => Promise, + 'workspaceDeepClone' : (arg_0: AddressedChunkArray) => Promise< + AddressedChunkArray + >, + 'workspaceToAddressedChunkArray' : (arg_0: AddressedChunkArray) => Promise< + AddressedChunkArray + >, +}; \ No newline at end of file diff --git a/src/interfaces/ext.ts b/src/interfaces/ext.ts index 4b804b3..fcbc791 100644 --- a/src/interfaces/ext.ts +++ b/src/interfaces/ext.ts @@ -1,112 +1,190 @@ -/* eslint-disable @typescript-eslint/class-name-casing */ -/* eslint-disable @typescript-eslint/camelcase */ -/* eslint-disable camelcase */ -import { Principal } from '@dfinity/principal'; +/* eslint-disable @typescript-eslint/naming-convention */ +import type { Principal } from "@dfinity/principal"; export type AccountIdentifier = string; - -export type TokenIdentifier = string; - +export type AccountIdentifier__1 = string; +export interface Asset { + thumbnail: [] | [File]; + name: string; + payload: File; +} export type Balance = bigint; - -export type SubAccount = number[]; - -export type Memo = number[]; - -export type Fee = bigint; - -export type Time = bigint; - -export type TokenIndex = number; - -export type Tokens = TokenIndex[]; - -export type User = +export interface BalanceRequest { + token: TokenIdentifier; + user: User; +} +export type BalanceResponse = { ok: Balance } | { err: CommonError__1 }; +export type Balance__1 = bigint; +export type CommonError = { InvalidToken: TokenIdentifier } | { Other: string }; +export type CommonError__1 = + | { InvalidToken: TokenIdentifier } + | { Other: string }; +export type Extension = string; +export interface File { + data: Array>; + ctype: string; +} +export type HeaderField = [string, string]; +export interface HttpRequest { + url: string; + method: string; + body: Array; + headers: Array; +} +export interface HttpResponse { + body: Array; + headers: Array; + streaming_strategy: [] | [HttpStreamingStrategy]; + status_code: number; +} +export interface HttpStreamingCallbackResponse { + token: [] | [HttpStreamingCallbackToken]; + body: Array; +} +export interface HttpStreamingCallbackToken { + key: string; + sha256: [] | [Array]; + index: bigint; + content_encoding: string; +} +export type HttpStreamingStrategy = { + Callback: { + token: HttpStreamingCallbackToken; + callback: [Principal, string]; + }; +}; +export interface ListRequest { + token: TokenIdentifier__1; + from_subaccount: [] | [SubAccount__1]; + price: [] | [bigint]; +} +export interface Listing { + locked: [] | [Time]; + seller: Principal; + price: bigint; +} +export type Memo = Array; +export type Metadata = | { - addres?: AccountIdentifier; // No notification + fungible: { + decimals: number; + metadata: [] | [Array]; + name: string; + symbol: string; + }; } + | { nonfungible: { metadata: [] | [Array] } }; +export interface MintingRequest { + to: AccountIdentifier; + asset: number; +} +export type Result = | { - principal?: Principal; // default to sub account 0 - }; - -export type CommonError = - | { - InvalidToken: TokenIdentifier; + ok: Array<[TokenIndex, [] | [Listing], [] | [Array]]>; } - | { - Other: string; - }; - -export interface ResultOk { - ok: T; -} - -export interface ResultError { - err: T; -} - -export type Result = ResultOk | ResultError; - -interface BalanceRequest { - token: TokenIdentifier; - user: User; + | { err: CommonError }; +export type Result_1 = { ok: Array } | { err: CommonError }; +export type Result_2 = { ok: Balance__1 } | { err: CommonError }; +export type Result_3 = { ok: null } | { err: CommonError }; +export type Result_4 = { ok: Metadata } | { err: CommonError }; +export type Result_5 = { ok: AccountIdentifier } | { err: CommonError }; +export type Result_6 = + | { ok: [AccountIdentifier, [] | [Listing]] } + | { err: CommonError }; +export interface Settlement { + subaccount: SubAccount__1; + seller: Principal; + buyer: AccountIdentifier; + price: bigint; } - -export interface Listing { - locked?: Time; +export type SubAccount = Array; +export type SubAccount__1 = Array; +export type Time = bigint; +export type TokenIdentifier = string; +export type TokenIdentifier__1 = string; +export type TokenIndex = number; +export interface Transaction { + token: TokenIdentifier__1; + time: Time; seller: Principal; + buyer: AccountIdentifier; price: bigint; } - -type Details = [AccountIdentifier, Listing]; - -type BalanceResult = Result; - -type DetailsResult = Result; - -type TokensResult = Result; - -type TokenExt = [TokenIndex, Listing[], Int8Array[]]; - -type TokensExtResult = Result; - -interface TransferRequest { +export interface TransferRequest { to: User; - from: User; token: TokenIdentifier; - amount: Balance; - memo: Memo; notify: boolean; - subaccount?: SubAccount; -} - -type TransferError = - | { Unauthorized: AccountIdentifier } - | { InsufficientBalance: null } - | { Rejected: null } - | { InvalidToken: TokenIdentifier } - | { CannotNotify: AccountIdentifier } - | { Other: string }; - -type TransferResult = Result; - -export interface NonFungibleMetadata { - nonfungible: { - metadata: Int8Array[]; - }; + from: User; + memo: Memo; + subaccount: [] | [SubAccount]; + amount: Balance; } -export type Metadata = NonFungibleMetadata; - -export type MetadataResponse = Result; - +export type TransferResponse = + | { ok: Balance } + | { + err: + | { CannotNotify: AccountIdentifier__1 } + | { InsufficientBalance: null } + | { InvalidToken: TokenIdentifier } + | { Rejected: null } + | { Unauthorized: AccountIdentifier__1 } + | { Other: string }; + }; +export type User = { principal: Principal } | { address: AccountIdentifier__1 }; export default interface _SERVICE { - balance: (arg_0: BalanceRequest) => Promise; - details: (token: TokenIdentifier) => Promise; - tokens: (account: AccountIdentifier) => Promise; - tokens_ext: (account: AccountIdentifier) => Promise; - transfer: (arg_0: TransferRequest) => Promise; - metadata: (token: TokenIdentifier) => Promise; + acceptCycles: () => Promise; + addAsset: (arg_0: Asset) => Promise; + allPayments: () => Promise]>>; + allSettlements: () => Promise>; + availableCycles: () => Promise; + balance: (arg_0: BalanceRequest) => Promise; + bearer: (arg_0: TokenIdentifier__1) => Promise; + clearPayments: ( + arg_0: Principal, + arg_1: Array + ) => Promise; + details: (arg_0: TokenIdentifier__1) => Promise; + extensions: () => Promise>; + getMinter: () => Promise; + getRegistry: () => Promise>; + getTokens: () => Promise>; + http_request: (arg_0: HttpRequest) => Promise; + http_request_streaming_callback: ( + arg_0: HttpStreamingCallbackToken + ) => Promise; + list: (arg_0: ListRequest) => Promise; + list_bulk: ( + arg_0: Array<[TokenIndex, bigint]> + ) => Promise>; + listings: () => Promise>; + lock: ( + arg_0: TokenIdentifier__1, + arg_1: bigint, + arg_2: AccountIdentifier, + arg_3: SubAccount__1 + ) => Promise; + metadata: (arg_0: TokenIdentifier__1) => Promise; + mintNFT: (arg_0: MintingRequest) => Promise; + payments: () => Promise<[] | [Array]>; + removePayments: (arg_0: Array) => Promise; + setMinter: (arg_0: Principal) => Promise; + settle: (arg_0: TokenIdentifier__1) => Promise; + settlements: () => Promise>; + stats: () => Promise< + [bigint, bigint, bigint, bigint, bigint, bigint, bigint] + >; + streamAsset: ( + arg_0: bigint, + arg_1: boolean, + arg_2: Array + ) => Promise; + supply: (arg_0: TokenIdentifier__1) => Promise; + tokens: (arg_0: AccountIdentifier) => Promise; + tokens_ext: (arg_0: AccountIdentifier) => Promise; + transactions: () => Promise>; + transfer: (arg_0: TransferRequest) => Promise; + transfer_bulk: ( + arg_0: Array<[TokenIndex, AccountIdentifier]> + ) => Promise>; + updateThumb: (arg_0: string, arg_1: File) => Promise<[] | [bigint]>; } -export const init = () => { - return []; -}; diff --git a/src/interfaces/icpunks.ts b/src/interfaces/icpunks.ts index 59150ff..c457544 100644 --- a/src/interfaces/icpunks.ts +++ b/src/interfaces/icpunks.ts @@ -1,24 +1,126 @@ -/* eslint-disable camelcase */ -/* eslint-disable @typescript-eslint/camelcase */ -/* eslint-disable @typescript-eslint/class-name-casing */ -/* eslint-disable @typescript-eslint/interface-name-prefix */ -import { Principal } from '@dfinity/principal'; +/* eslint-disable @typescript-eslint/naming-convention */ +import type { Principal } from '@dfinity/principal'; +export type HeaderField = [string, string]; +export type HttpRequest = HttpRequest_2; +export interface HttpRequest_2 { + 'url' : string, + 'method' : string, + 'body' : Array, + 'headers' : Array, +}; +export type HttpResponse = HttpResponse_2; +export interface HttpResponse_2 { + 'body' : Array, + 'headers' : Array, + 'streaming_strategy' : [] | [StreamingStrategy], + 'status_code' : number, +}; +export interface ICPTs { 'e8s' : bigint }; +export type Listing = Listing_2; +export interface Listing_2 { + 'tokenId' : bigint, + 'owner' : Principal, + 'timestamp' : Time, + 'price' : bigint, +}; +export type MintRequest = MintRequest_2; +export interface MintRequest_2 { + 'url' : string, + 'dataurl' : string, + 'accountid' : string, + 'contentType' : string, + 'data' : Array, + 'desc' : string, + 'name' : string, + 'properties' : Array, +}; +export type Operation = { 'init' : null } | + { 'list' : null } | + { 'mint' : null } | + { 'delist' : null } | + { 'transfer' : null } | + { 'purchase' : null }; +export type Operation_3 = Operation; +export interface Property { 'value' : string, 'name' : string }; +export interface StorageActor { + 'addRecord' : ( + arg_0: Principal, + arg_1: Operation_3, + arg_2: [] | [Principal], + arg_3: [] | [Principal], + arg_4: bigint, + arg_5: [] | [bigint], + arg_6: Time, + ) => Promise, +}; +export interface StreamingCallbackResponse { + 'token' : [] | [StreamingCallbackToken], + 'body' : Array, +}; +export interface StreamingCallbackToken { + 'key' : string, + 'sha256' : [] | [Array], + 'index' : bigint, + 'content_encoding' : string, +}; +export type StreamingStrategy = { + 'Callback' : { + 'token' : StreamingCallbackToken, + 'callback' : [Principal, string], + } + }; +export type Time = bigint; +export type TokenDesc = TokenDesc_2; +export interface TokenDesc_2 { + 'id' : bigint, + 'url' : string, + 'owner' : Principal, + 'desc' : string, + 'name' : string, + 'properties' : Array, +}; export default interface _SERVICE { - data_of: (token_index: bigint) => Promise; - transfer_to: (to: Principal, tokenIndex: bigint) => Promise; - user_tokens: (user: Principal) => Promise>; -} - -export interface Property { - value: string; - name: string; -} -export interface TokenDesc { - id: bigint; - url: string; - owner: Principal; - desc: string; - name: string; - properties: Array; -} + 'acceptCycles' : () => Promise, + 'add_genesis_record' : () => Promise, + 'availableCycles' : () => Promise, + 'data_of' : (arg_0: bigint) => Promise, + 'delist' : (arg_0: bigint) => Promise, + 'disableMint' : () => Promise, + 'enableMint' : () => Promise, + 'getAccountBalance' : (arg_0: string) => Promise, + 'getAccountID' : (arg_0: number, arg_1: number) => Promise, + 'getBalance' : () => Promise, + 'getBunny' : (arg_0: bigint) => Promise<[] | [string]>, + 'getCurrentToken' : () => Promise, + 'getPrice' : () => Promise, + 'getPunks' : () => Promise>, + 'getToken' : (arg_0: string) => Promise<[] | [bigint]>, + 'get_cycles' : () => Promise, + 'get_listed' : (arg_0: bigint) => Promise>, + 'get_storage_canister' : () => Promise<[] | [StorageActor]>, + 'http_request' : (arg_0: HttpRequest) => Promise, + 'individual_holders' : () => Promise, + 'list' : (arg_0: bigint, arg_1: bigint) => Promise, + 'listSeeds' : () => Promise>, + 'manageSeeds' : (arg_0: string) => Promise, + 'mint' : (arg_0: MintRequest) => Promise, + 'multi_mint' : (arg_0: Array) => Promise>, + 'my_tokens' : () => Promise>, + 'name' : () => Promise, + 'nextAccount' : () => Promise, + 'owner' : () => Promise, + 'owner_of' : (arg_0: bigint) => Promise, + 'remainingTokens' : () => Promise, + 'setLocal' : () => Promise, + 'setPrice' : (arg_0: bigint) => Promise, + 'set_ledger_canister_id' : (arg_0: [] | [Principal]) => Promise, + 'set_owner' : (arg_0: Principal) => Promise, + 'set_storage_canister_id' : (arg_0: [] | [Principal]) => Promise, + 'symbol' : () => Promise, + 'tokenAccounts' : (arg_0: string) => Promise, + 'total_supply' : () => Promise, + 'transfer_to' : (arg_0: Principal, arg_1: bigint) => Promise, + 'user_tokens' : (arg_0: Principal) => Promise>, + 'wallet_receive' : () => Promise<{ 'accepted' : bigint }>, +}; \ No newline at end of file