From 2bc04968eae7017451b4ed95a452017dd94e47e3 Mon Sep 17 00:00:00 2001 From: Zane Starr Date: Tue, 15 Feb 2022 19:55:00 -0800 Subject: [PATCH] feat: add support for offers by owner --- build/openrpc.json | 242 ++++++++++++++++++ .../custom/typescript/src/index.ts | 38 ++- .../custom/typescript/src/openrpc.json | 242 ++++++++++++++++++ methods/get_sales_for_owner_id.json | 47 ++++ openrpc.json | 3 + package-lock.json | 15 +- package.json | 2 +- 7 files changed, 578 insertions(+), 11 deletions(-) create mode 100644 methods/get_sales_for_owner_id.json diff --git a/build/openrpc.json b/build/openrpc.json index f6ce34d..d50660d 100644 --- a/build/openrpc.json +++ b/build/openrpc.json @@ -1050,6 +1050,248 @@ } } }, + { + "name": "get_sales_for_owner_id", + "summary": "Get sales for owner id", + "description": "Get sales for owner id", + "tags": [ + { + "name": "view", + "description": "View only methods" + } + ], + "params": [ + { + "name": "account_id", + "summary": "Potential Owner account id", + "description": "Potential Owner account id", + "schema": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "required": true + }, + { + "name": "from_index", + "summary": "From index value", + "description": "From index value", + "schema": { + "title": "U64", + "type": "string", + "description": "U64 integer as string" + }, + "required": true + }, + { + "name": "limit", + "summary": "Limit to set iteration to rel. to index ", + "description": "Limit to set iteration to rel. to index", + "schema": { + "title": "Limit", + "description": "Limit for setting pagination u64 constrainted by 2^53 js limit", + "type": "integer" + }, + "required": true + } + ], + "result": { + "name": "MarketSimpleSalesForOwnerResult", + "summary": "Sales", + "description": "Sales by owner in a vector", + "schema": { + "title": "Sales", + "type": "array", + "items": [ + { + "title": "Sale", + "type": "object", + "properties": { + "owner_id": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "account_condition": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "approval_id": { + "title": "ApprovalId", + "description": "expected approval ID. A number smaller than 2^53", + "type": "number" + }, + "item_for_sale": { + "title": "ItemForSale", + "type": "object", + "properties": { + "contract_id": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "token_id": { + "title": "TokenId", + "description": "Token identifier that corresponds to an id", + "type": "string" + } + }, + "required": [ + "contract_id", + "token_id" + ] + }, + "sale_id": { + "title": "SaleId", + "type": "string" + }, + "service_fee": { + "title": "U128", + "type": "string", + "description": "U128 integer as string" + }, + "sale_conditions": { + "title": "SaleConditions", + "type": "array", + "items": [ + { + "title": "SaleCondition", + "type": "object", + "properties": { + "ft": { + "title": "FtSaleConditions", + "type": "object", + "properties": {}, + "additionalProperties": { + "title": "Bid", + "type": "object", + "properties": { + "owner_id": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "amount": { + "title": "U128", + "type": "string", + "description": "U128 integer as string" + } + } + } + }, + "nft": { + "title": "NftSaleConditions", + "type": "object", + "properties": {}, + "patternProperties": { + ".*": { + "title": "NftMetadataFilter", + "type": "object", + "properties": { + "token_id": { + "title": "TokenId", + "description": "Token identifier that corresponds to an id", + "type": "string" + }, + "token_id_regex": { + "title": "TokenIdRegex", + "type": "string" + }, + "metadata": { + "title": "NFTTokenMetadata", + "type": "object", + "properties": { + "title": { + "type": "string", + "title": "NFTTokenMetadataTitle", + "description": "ex. Parcel #5055" + }, + "description": { + "type": "string", + "title": "NFTTokenMetadataDesc", + "description": "free-form description" + }, + "media": { + "type": "string", + "title": "NFTTokenMetadataMedia", + "description": "URL to associated media, preferably to decentralized, content-addressed storage" + }, + "media_hash": { + "type": "string", + "title": "NFTTokenMetadataMediaHash", + "description": "Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included." + }, + "issued_at": { + "type": "string", + "title": "NFTokenMetadataIssuedAt", + "description": "When token was issued or minted, Unix epoc in milliseconds" + }, + "expires_at": { + "type": "string", + "title": "NFTokenMetadataExpiresAt", + "description": "When token expires, Unix epoch in milliseconds" + }, + "starts_at": { + "type": "string", + "title": "NFTokenMetadataStartsAt", + "description": "When token starts being valid, Unix epoch in milliseconds" + }, + "updated_at": { + "type": "string", + "title": "NFTokenMetadataUpdatedAt", + "description": "When token was last updated, Unix epoch in milliseconds" + }, + "extra": { + "type": "string", + "title": "NFTokenMetadataExtra", + "description": "Anything extra the MT wants to store on-chain. Can be stringified JSON." + }, + "reference": { + "type": "string", + "title": "NFTokenMetadataReference", + "description": "URL to an off-chain JSON file with more info." + }, + "reference_hash": { + "type": "string", + "title": "NFTokenMetadataReferenceHash", + "description": "Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included." + } + } + }, + "receiver": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } + ] + }, + "created_at": { + "title": "U64", + "type": "string", + "description": "U64 integer as string" + } + }, + "required": [ + "owner_id", + "item_for_sale", + "sale_id", + "sales_conditions", + "created_at" + ] + } + ] + } + } + }, { "name": "get_sales_by_nft_contract_id", "summary": "Get sales by nft contract id", diff --git a/generated-client/custom/typescript/src/index.ts b/generated-client/custom/typescript/src/index.ts index 28bae0c..8433a02 100644 --- a/generated-client/custom/typescript/src/index.ts +++ b/generated-client/custom/typescript/src/index.ts @@ -205,7 +205,7 @@ export type UnorderedSetOfBooleanVyG3AETheht2BVDp = [BooleanVyG3AETh]; * Generated! Represents an alias to any of the provided schemas * */ -export type AnyOfAccountIdAccountIdsBidHistoryLengthAccountIdsAccountIdTokenIdNftBuyOfferSaleArgsSaleItemApprovalIdAccountIdTokenIdTokenIdAccountIdTokenIdAccountIdU128SaleIdU128SaleIdAccountIdU64LimitAccountIdU64LimitAccountIdTokenIdU64LimitAccountIdAccountIdAccountIdAccountIdBooleanVyG3AEThBooleanVyG3AEThTokenIdsU128NullQu0Arl1FBooleansNullQu0Arl1FNullQu0Arl1FSaleIdNullQu0Arl1FNullQu0Arl1FNullQu0Arl1FU128SaleSalesSalesSalesU64U64U64StorageBalanceBoundsObjectStorageBalanceStorageBalanceUnorderedSetOfBooleanVyG3AETheht2BVDpStorageBalance = AccountId | AccountIds | BidHistoryLength | TokenId | NftBuyOffer | SaleArgs | SaleItem | ApprovalId | U128 | SaleId | U64 | Limit | BooleanVyG3AETh | TokenIds | NullQu0Arl1F | Booleans | Sale | Sales | StorageBalanceBoundsObject | StorageBalance | UnorderedSetOfBooleanVyG3AETheht2BVDp; +export type AnyOfAccountIdAccountIdsBidHistoryLengthAccountIdsAccountIdTokenIdNftBuyOfferSaleArgsSaleItemApprovalIdAccountIdTokenIdTokenIdAccountIdTokenIdAccountIdU128SaleIdU128SaleIdAccountIdU64LimitAccountIdU64LimitAccountIdU64LimitAccountIdTokenIdU64LimitAccountIdAccountIdAccountIdAccountIdBooleanVyG3AEThBooleanVyG3AEThTokenIdsU128NullQu0Arl1FBooleansNullQu0Arl1FNullQu0Arl1FSaleIdNullQu0Arl1FNullQu0Arl1FNullQu0Arl1FU128SaleSalesSalesSalesSalesU64U64U64StorageBalanceBoundsObjectStorageBalanceStorageBalanceUnorderedSetOfBooleanVyG3AETheht2BVDpStorageBalance = AccountId | AccountIds | BidHistoryLength | TokenId | NftBuyOffer | SaleArgs | SaleItem | ApprovalId | U128 | SaleId | U64 | Limit | BooleanVyG3AETh | TokenIds | NullQu0Arl1F | Booleans | Sale | Sales | StorageBalanceBoundsObject | StorageBalance | UnorderedSetOfBooleanVyG3AETheht2BVDp; export type New = (owner_id: AccountId, ft_token_ids?: AccountIds, bid_history_length?: BidHistoryLength) => Promise; export type AddFtTokenIds = (ft_token_ids: AccountIds) => Promise; export type Offer = (nft_contract_id: AccountId, token_id: TokenId) => Promise; @@ -217,6 +217,7 @@ export type RemoveSale = (sale_id: SaleId) => Promise; export type GetFee = (amount: U128) => Promise; export type GetSale = (sale_id: SaleId) => Promise; export type GetSalesByOwnerId = (account_id: AccountId, from_index: U64, limit: Limit) => Promise; +export type GetSalesForOwnerId = (account_id: AccountId, from_index: U64, limit: Limit) => Promise; export type GetSalesByNftContractId = (nft_contract_id: AccountId, from_index: U64, limit: Limit) => Promise; export type GetOffersByContractTokenId = (contract_id: AccountId, token_id: TokenId, from_index: U64, limit: Limit) => Promise; export type GetSupplyByOwnerId = (account_id?: AccountId) => Promise; @@ -305,6 +306,13 @@ export type StorageWithdraw = (token_ids: TokenIds, amount: U128) => Promise, ChangeMethodOptions?] type RTGetSalesByOwnerId = ReturnType + /** + * Generated typings + */ + // tslint:disable-next-line:max-line-length + type GTGetSalesForOwnerId = [...Parameters, ChangeMethodOptions?] + type RTGetSalesForOwnerId = ReturnType + /** * Generated typings */ @@ -394,7 +402,7 @@ const isMetaObject = (x: any): boolean => { } export class SwapplandMarket { - public static openrpcDocument: OpenRPC = {"openrpc":"1.0.0","info":{"title":"SwapplandMarket","version":"0.0.0-development"},"methods":[{"name":"new","summary":"Instantiate market contract","description":"Instantiate market contract","tags":[{"name":"change","description":"change method"}],"params":[{"name":"owner_id","summary":"The owner of the contract","description":"The owner of the contract","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"ft_token_ids","summary":"Fungible tokens to support","description":"Fungible tokens to support","schema":{"title":"AccountIds","type":"array","items":[{"title":"AccountId","type":"string","description":"AccountId for the near account"}]},"required":false},{"name":"bid_history_length","summary":"The bid history length","description":"The bid history length","schema":{"title":"BidHistoryLength","minimum":0,"maximum":255,"type":"integer"},"required":false}],"result":{"name":"MarketSimpleNewResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"add_ft_token_ids","summary":"Add tokens to accept as currency","description":"Add tokens to accept as currency","tags":[{"name":"change","description":"change method"}],"params":[{"name":"ft_token_ids","summary":"Fungible tokens to support","description":"Fungible tokens to support","schema":{"title":"AccountIds","type":"array","items":[{"title":"AccountId","type":"string","description":"AccountId for the near account"}]},"required":true}],"result":{"name":"MarketSimpleBoolsResult","summary":"Returns whether or not tokens were added","description":"Returns whether or not tokens were added","schema":{"title":"Booleans","type":"array","items":[{"type":"boolean","title":"boolean_vyG3AETh"}]}}},{"name":"offer","summary":"Offer a token id ","description":"Remove sale from market place","tags":[{"name":"change","description":"change method"}],"params":[{"name":"nft_contract_id","summary":"Non fungible contract id","description":"Fungible tokens to support","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"token_id","summary":"NFT token id to support","description":"NFT token id to support","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true}],"result":{"name":"MarketSimpleOfferSalesResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"nft_offer","summary":"NFT token offer","description":"Accept nft token offer","tags":[{"name":"change","description":"change method"}],"params":[{"name":"offer","summary":"Non fungible token offer","description":"Non fungible token offer","schema":{"title":"NftBuyOffer","type":"object","properties":{"sale_id":{"title":"SaleId","type":"string"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["sale_id","contract_id"]},"required":true}],"result":{"name":"MarketSimpleNftOfferResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"nft_list","summary":"List your nft/ft for sale for an nft/ft","description":"List your nft/ft for sale for an nft/ft","tags":[{"name":"change","description":"change method"}],"params":[{"name":"sale_args","summary":"Sale conditions required for sale aka. what you're looking for","description":"sale conditions required for sale","schema":{"title":"SaleArgs","type":"object","properties":{"account_condition":{"title":"AccountCondition","type":"string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]}},"required":["sale_conditions"]},"required":true},{"name":"sale_item","summary":"The item being listed for sale","description":"The item being listed for sale","schema":{"title":"SaleItem","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id"]},"required":true},{"name":"sale_approval_id","summary":"The approval id for the item being sold","description":"The approval id for the item being sold","schema":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"required":false}],"result":{"name":"MarketSimpleNftListResult","summary":"Returns the sales id ","description":"The sales_id for the listing","schema":{"title":"SaleId","type":"string"}}},{"name":"accept_offer","summary":"Accept a token offer","description":"Accept a token offer","tags":[{"name":"change","description":"change method"}],"params":[{"name":"nft_contract_id","summary":"Non fungible contract id","description":"Fungible tokens to support","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"token_id","summary":"NFT token id to support","description":"NFT token id to support","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true},{"name":"ft_token_id","summary":"FT token id to accept offer from","description":"FT token id to accept offer from","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true}],"result":{"name":"MarketSimpleAcceptOfferSalesResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"update_price","summary":"Update the price","description":"Remove sale from market place","tags":[{"name":"change","description":"change method"}],"params":[{"name":"nft_contract_id","summary":"Non fungible contract id","description":"Fungible tokens to support","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"token_id","summary":"NFT token id to support","description":"NFT token id to support","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true},{"name":"ft_token_id","summary":"FT token id to support","description":"FT token id to support","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"price","summary":"Price in the denomination of the token","description":"Price in the denomination of the token","schema":{"title":"U128","type":"string","description":"U128 integer as string"},"required":true}],"result":{"name":"MarketSimpleUpdatePriceResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"remove_sale","summary":"Remove sale from market place","description":"Remove sale from market place","tags":[{"name":"change","description":"change method"}],"params":[{"name":"sale_id","summary":"Sale id for removal","description":"Sale id for removing the associated sale","schema":{"title":"SaleId","type":"string"},"required":true}],"result":{"name":"MarketSimpleRmSalesResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"get_fee","summary":"Get fee associated with ft transfer","description":"Get fee associated with ft transfer","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"amount","summary":"Amount used to determine fee","description":"Amount used to determine fee","schema":{"title":"U128","type":"string","description":"U128 integer as string"},"required":true}],"result":{"name":"MarketSimpleFeeResult","summary":"Fee owed for contract deposit","description":"Fee owed for contract deposit","required":false,"schema":{"title":"U128","type":"string","description":"U128 integer as string"}}},{"name":"get_sale","summary":"Get sales by nft contract id","description":"Get sales by nft contract id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"sale_id","summary":"SaleId sale id to retrieve sale","description":"sale id to retrieve sale","schema":{"title":"SaleId","type":"string"},"required":true}],"result":{"name":"MarketSimpleSalesByNFTContractResult","summary":"Sales","required":false,"description":"Sales by owner in a vector","schema":{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}}},{"name":"get_sales_by_owner_id","summary":"Get sales by owner id","description":"Get sales by owner id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"account_id","summary":"Owner account id","description":"Owner account id","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"from_index","summary":"From index value","description":"From index value","schema":{"title":"U64","type":"string","description":"U64 integer as string"},"required":true},{"name":"limit","summary":"Limit to set iteration to rel. to index ","description":"Limit to set iteration to rel. to index","schema":{"title":"Limit","description":"Limit for setting pagination u64 constrainted by 2^53 js limit","type":"integer"},"required":true}],"result":{"name":"MarketSimpleSalesByOwnerResult","summary":"Sales","description":"Sales by owner in a vector","schema":{"title":"Sales","type":"array","items":[{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}]}}},{"name":"get_sales_by_nft_contract_id","summary":"Get sales by nft contract id","description":"Get sales by nft contract id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"nft_contract_id","summary":"NFT contract id","description":"NFT contract id to query against","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"from_index","summary":"From index value","description":"From index value","schema":{"title":"U64","type":"string","description":"U64 integer as string"},"required":true},{"name":"limit","summary":"Limit to set iteration to rel. to index ","description":"Limit to set iteration to rel. to index","schema":{"title":"Limit","description":"Limit for setting pagination u64 constrainted by 2^53 js limit","type":"integer"},"required":true}],"result":{"name":"MarketSimpleSalesByNFTContractResult","summary":"Sales","description":"Sales by owner in a vector","schema":{"title":"Sales","type":"array","items":[{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}]}}},{"name":"get_offers_by_contract_token_id","summary":"Get offers by contract and token id","description":"Get offers by contract and token id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"contract_id","summary":"NFT contract id","description":"NFT contract id to query against","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"token_id","summary":"NFT token id","description":"NFT token id to query against","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true},{"name":"from_index","summary":"From index value","description":"From index value","schema":{"title":"U64","type":"string","description":"U64 integer as string"},"required":true},{"name":"limit","summary":"Limit to set iteration to rel. to index ","description":"Limit to set iteration to rel. to index","schema":{"title":"Limit","description":"Limit for setting pagination u64 constrainted by 2^53 js limit","type":"integer"},"required":true}],"result":{"name":"MarketSimpleOfferByNFTContractTokenIdResult","summary":"Sales","description":"Sales by owner in a vector","schema":{"title":"Sales","type":"array","items":[{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}]}}},{"name":"get_supply_by_owner_id","summary":"Get supply of sales by owner id","description":"Get supply of sales by owner id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"account_id","summary":"Owner account id","description":"Owner account id","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":false}],"result":{"name":"MarketSimpleSupplySalesResult","summary":"Supply of sales","description":"Supply of sales","schema":{"title":"U64","type":"string","description":"U64 integer as string"}}},{"name":"get_supply_by_nft_contract_id","summary":"Get supply by nft contract id","description":"Get supply by nft contract id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"nft_contract_id","summary":"Nft contract id","description":"Nft contract id","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true}],"result":{"name":"MarketSimpleSupplySalesNFTResult","summary":"Supply of sales","description":"Supply of sales","schema":{"title":"U64","type":"string","description":"U64 integer as string"}}},{"name":"get_supply_sales","summary":"Get supply of sales ","description":"Get supply of sales ","tags":[{"name":"view","description":"View only methods"}],"params":[],"result":{"name":"MarketSimpleSupplySalesResult","summary":"Supply of sales","description":"Supply of sales","schema":{"title":"U64","type":"string","description":"U64 integer as string"}}},{"name":"storage_balance_bounds","summary":"Returns the minimum and maximum allowe balance amounts to interact with this contract","description":"Returns the minimum and maximum allowe balance amounts to interact with this contract","tags":[{"name":"view","description":"View only methods"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[],"result":{"name":"StorageBalanceBoundsResult","summary":"min` is the amount of tokens required to start","description":"This will be returned for the method `storage_balance_bounds`. Both `min` and `max` are string representations of unsigned 128-bit integers.`min` is the amount of tokens required to start using this contract at all (eg to register with the contract). If a new contract user attaches `min` NEAR to a `storage_deposit` call, subsequent calls to `storage_balance_of` for this user must show their `total` equal to `min` and `available=0` . A contract may implement `max` equal to `min` if it only charges for initial registration, and does not adjust per-user storage over time. A contract which implements `max` must refund deposits that would increase a user's storage balance beyond this amount.","schema":{"title":"StorageBalanceBoundsObject","type":"object","properties":{"min":{"title":"U128","type":"string","description":"U128 integer as string"},"max":{"title":"U128","type":"string","description":"U128 integer as string"}}}}},{"name":"storage_balance_of","summary":"Returns the storage balance of an account for set of token_ids","description":"Returns the storage balance of an account for set of token_ids. If the `account_id` is not registered it will return `null`","tags":[{"name":"view","description":"View only methods"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[{"name":"account_id","summary":"Account to allocate storage for","description":"Account to allocate storage for","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true}],"result":{"name":"StorageBalanceOfResult","summary":"Storage balance of the `account_id`","description":"Storage balance of the `account_id`","schema":{"title":"StorageBalance","type":"object","properties":{"total":{"title":"U128","type":"string","description":"U128 integer as string"},"available":{"title":"U128","type":"string","description":"U128 integer as string"}},"required":["total","available"]},"required":false}},{"name":"storage_deposit","summary":"Payable method that receives an attached deposit of Ⓝ for a given account","description":"Payable method that receives an attached deposit of Ⓝ for a given account. ","tags":[{"name":"change","description":"change method"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[{"name":"account_id","summary":"Account to allocate storage for","description":"Account to allocate storage for","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":false},{"name":"registration_only","summary":"Registration flag that if true will refund above minimum balance if accound didn't exist and full deposit if it exists.","description":"Registration flag that if true will refund above minimum balance if accound didn't exist and full deposit if it exists.","schema":{"type":"boolean","title":"boolean_vyG3AETh"},"required":false}],"result":{"name":"StorageDepositResult","summary":"Returns the `StorageBalance` showing updated balances","description":"Returns the `StorageBalance` showing updated balances","schema":{"title":"StorageBalance","type":"object","properties":{"total":{"title":"U128","type":"string","description":"U128 integer as string"},"available":{"title":"U128","type":"string","description":"U128 integer as string"}},"required":["total","available"]}}},{"name":"storage_unregister","summary":"Unregister the predecessor account and return the storage NEAR deposit back","description":"Unregister the predecessor account and return the storage NEAR deposit back. Requires 1yoctoNEAR attached balance to prevent function-call access-key call","tags":[{"name":"change","description":"change method"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[{"name":"force","summary":"The force flag set to true will ignore account balances and burn the tokens and close the account","description":"The force flag set to true will ignore account balances and burn the tokens and close the account","schema":{"type":"boolean","title":"boolean_vyG3AETh"},"required":false}],"result":{"name":"StorageUnregisterResult","summary":"An array of booleans corresponding to the `token_ids`. `false` if token was already unregistered true other wise","schema":{"type":"array","items":[{"type":"boolean","title":"boolean_vyG3AETh"}],"title":"unorderedSetOf_boolean_vyG3AETheht2bVDp"}}},{"name":"storage_withdraw","summary":"Withdraw specified amount of available Ⓝ for predecessor account.","description":"Withdraw specified amount of available Ⓝ for predecessor account. ","tags":[{"name":"change","description":"change method"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[{"name":"token_ids","summary":"The tokens to withdraw storage from","description":"The tokens to withdraw storage from","schema":{"title":"TokenIds","type":"array","items":[{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}]}},{"name":"amount","summary":"The amount of balance to refund","description":"The amount of balance to refund, if not specified then it's the total amount. Must require exactly 1 yoctoNEAR attached balance to prevent restricted function-call access-key call for wallet security.","schema":{"title":"U128","type":"string","description":"U128 integer as string"}}],"result":{"name":"StorageWithdrawResult","summary":"Returns the StorageBalance structure showing updated balances","schema":{"title":"StorageBalance","type":"object","properties":{"total":{"title":"U128","type":"string","description":"U128 integer as string"},"available":{"title":"U128","type":"string","description":"U128 integer as string"}},"required":["total","available"]},"required":true}}]} ; + public static openrpcDocument: OpenRPC = {"openrpc":"1.0.0","info":{"title":"SwapplandMarket","version":"0.0.0-development"},"methods":[{"name":"new","summary":"Instantiate market contract","description":"Instantiate market contract","tags":[{"name":"change","description":"change method"}],"params":[{"name":"owner_id","summary":"The owner of the contract","description":"The owner of the contract","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"ft_token_ids","summary":"Fungible tokens to support","description":"Fungible tokens to support","schema":{"title":"AccountIds","type":"array","items":[{"title":"AccountId","type":"string","description":"AccountId for the near account"}]},"required":false},{"name":"bid_history_length","summary":"The bid history length","description":"The bid history length","schema":{"title":"BidHistoryLength","minimum":0,"maximum":255,"type":"integer"},"required":false}],"result":{"name":"MarketSimpleNewResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"add_ft_token_ids","summary":"Add tokens to accept as currency","description":"Add tokens to accept as currency","tags":[{"name":"change","description":"change method"}],"params":[{"name":"ft_token_ids","summary":"Fungible tokens to support","description":"Fungible tokens to support","schema":{"title":"AccountIds","type":"array","items":[{"title":"AccountId","type":"string","description":"AccountId for the near account"}]},"required":true}],"result":{"name":"MarketSimpleBoolsResult","summary":"Returns whether or not tokens were added","description":"Returns whether or not tokens were added","schema":{"title":"Booleans","type":"array","items":[{"type":"boolean","title":"boolean_vyG3AETh"}]}}},{"name":"offer","summary":"Offer a token id ","description":"Remove sale from market place","tags":[{"name":"change","description":"change method"}],"params":[{"name":"nft_contract_id","summary":"Non fungible contract id","description":"Fungible tokens to support","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"token_id","summary":"NFT token id to support","description":"NFT token id to support","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true}],"result":{"name":"MarketSimpleOfferSalesResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"nft_offer","summary":"NFT token offer","description":"Accept nft token offer","tags":[{"name":"change","description":"change method"}],"params":[{"name":"offer","summary":"Non fungible token offer","description":"Non fungible token offer","schema":{"title":"NftBuyOffer","type":"object","properties":{"sale_id":{"title":"SaleId","type":"string"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["sale_id","contract_id"]},"required":true}],"result":{"name":"MarketSimpleNftOfferResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"nft_list","summary":"List your nft/ft for sale for an nft/ft","description":"List your nft/ft for sale for an nft/ft","tags":[{"name":"change","description":"change method"}],"params":[{"name":"sale_args","summary":"Sale conditions required for sale aka. what you're looking for","description":"sale conditions required for sale","schema":{"title":"SaleArgs","type":"object","properties":{"account_condition":{"title":"AccountCondition","type":"string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]}},"required":["sale_conditions"]},"required":true},{"name":"sale_item","summary":"The item being listed for sale","description":"The item being listed for sale","schema":{"title":"SaleItem","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id"]},"required":true},{"name":"sale_approval_id","summary":"The approval id for the item being sold","description":"The approval id for the item being sold","schema":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"required":false}],"result":{"name":"MarketSimpleNftListResult","summary":"Returns the sales id ","description":"The sales_id for the listing","schema":{"title":"SaleId","type":"string"}}},{"name":"accept_offer","summary":"Accept a token offer","description":"Accept a token offer","tags":[{"name":"change","description":"change method"}],"params":[{"name":"nft_contract_id","summary":"Non fungible contract id","description":"Fungible tokens to support","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"token_id","summary":"NFT token id to support","description":"NFT token id to support","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true},{"name":"ft_token_id","summary":"FT token id to accept offer from","description":"FT token id to accept offer from","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true}],"result":{"name":"MarketSimpleAcceptOfferSalesResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"update_price","summary":"Update the price","description":"Remove sale from market place","tags":[{"name":"change","description":"change method"}],"params":[{"name":"nft_contract_id","summary":"Non fungible contract id","description":"Fungible tokens to support","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"token_id","summary":"NFT token id to support","description":"NFT token id to support","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true},{"name":"ft_token_id","summary":"FT token id to support","description":"FT token id to support","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"price","summary":"Price in the denomination of the token","description":"Price in the denomination of the token","schema":{"title":"U128","type":"string","description":"U128 integer as string"},"required":true}],"result":{"name":"MarketSimpleUpdatePriceResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"remove_sale","summary":"Remove sale from market place","description":"Remove sale from market place","tags":[{"name":"change","description":"change method"}],"params":[{"name":"sale_id","summary":"Sale id for removal","description":"Sale id for removing the associated sale","schema":{"title":"SaleId","type":"string"},"required":true}],"result":{"name":"MarketSimpleRmSalesResult","summary":"Void","description":"Void","schema":{"type":"null","title":"null_Qu0Arl1F"}}},{"name":"get_fee","summary":"Get fee associated with ft transfer","description":"Get fee associated with ft transfer","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"amount","summary":"Amount used to determine fee","description":"Amount used to determine fee","schema":{"title":"U128","type":"string","description":"U128 integer as string"},"required":true}],"result":{"name":"MarketSimpleFeeResult","summary":"Fee owed for contract deposit","description":"Fee owed for contract deposit","required":false,"schema":{"title":"U128","type":"string","description":"U128 integer as string"}}},{"name":"get_sale","summary":"Get sales by nft contract id","description":"Get sales by nft contract id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"sale_id","summary":"SaleId sale id to retrieve sale","description":"sale id to retrieve sale","schema":{"title":"SaleId","type":"string"},"required":true}],"result":{"name":"MarketSimpleSalesByNFTContractResult","summary":"Sales","required":false,"description":"Sales by owner in a vector","schema":{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}}},{"name":"get_sales_by_owner_id","summary":"Get sales by owner id","description":"Get sales by owner id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"account_id","summary":"Owner account id","description":"Owner account id","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"from_index","summary":"From index value","description":"From index value","schema":{"title":"U64","type":"string","description":"U64 integer as string"},"required":true},{"name":"limit","summary":"Limit to set iteration to rel. to index ","description":"Limit to set iteration to rel. to index","schema":{"title":"Limit","description":"Limit for setting pagination u64 constrainted by 2^53 js limit","type":"integer"},"required":true}],"result":{"name":"MarketSimpleSalesByOwnerResult","summary":"Sales","description":"Sales by owner in a vector","schema":{"title":"Sales","type":"array","items":[{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}]}}},{"name":"get_sales_for_owner_id","summary":"Get sales for owner id","description":"Get sales for owner id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"account_id","summary":"Potential Owner account id","description":"Potential Owner account id","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"from_index","summary":"From index value","description":"From index value","schema":{"title":"U64","type":"string","description":"U64 integer as string"},"required":true},{"name":"limit","summary":"Limit to set iteration to rel. to index ","description":"Limit to set iteration to rel. to index","schema":{"title":"Limit","description":"Limit for setting pagination u64 constrainted by 2^53 js limit","type":"integer"},"required":true}],"result":{"name":"MarketSimpleSalesForOwnerResult","summary":"Sales","description":"Sales by owner in a vector","schema":{"title":"Sales","type":"array","items":[{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}]}}},{"name":"get_sales_by_nft_contract_id","summary":"Get sales by nft contract id","description":"Get sales by nft contract id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"nft_contract_id","summary":"NFT contract id","description":"NFT contract id to query against","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"from_index","summary":"From index value","description":"From index value","schema":{"title":"U64","type":"string","description":"U64 integer as string"},"required":true},{"name":"limit","summary":"Limit to set iteration to rel. to index ","description":"Limit to set iteration to rel. to index","schema":{"title":"Limit","description":"Limit for setting pagination u64 constrainted by 2^53 js limit","type":"integer"},"required":true}],"result":{"name":"MarketSimpleSalesByNFTContractResult","summary":"Sales","description":"Sales by owner in a vector","schema":{"title":"Sales","type":"array","items":[{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}]}}},{"name":"get_offers_by_contract_token_id","summary":"Get offers by contract and token id","description":"Get offers by contract and token id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"contract_id","summary":"NFT contract id","description":"NFT contract id to query against","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true},{"name":"token_id","summary":"NFT token id","description":"NFT token id to query against","schema":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"required":true},{"name":"from_index","summary":"From index value","description":"From index value","schema":{"title":"U64","type":"string","description":"U64 integer as string"},"required":true},{"name":"limit","summary":"Limit to set iteration to rel. to index ","description":"Limit to set iteration to rel. to index","schema":{"title":"Limit","description":"Limit for setting pagination u64 constrainted by 2^53 js limit","type":"integer"},"required":true}],"result":{"name":"MarketSimpleOfferByNFTContractTokenIdResult","summary":"Sales","description":"Sales by owner in a vector","schema":{"title":"Sales","type":"array","items":[{"title":"Sale","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"account_condition":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"approval_id":{"title":"ApprovalId","description":"expected approval ID. A number smaller than 2^53","type":"number"},"item_for_sale":{"title":"ItemForSale","type":"object","properties":{"contract_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}},"required":["contract_id","token_id"]},"sale_id":{"title":"SaleId","type":"string"},"service_fee":{"title":"U128","type":"string","description":"U128 integer as string"},"sale_conditions":{"title":"SaleConditions","type":"array","items":[{"title":"SaleCondition","type":"object","properties":{"ft":{"title":"FtSaleConditions","type":"object","properties":{},"additionalProperties":{"title":"Bid","type":"object","properties":{"owner_id":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"amount":{"title":"U128","type":"string","description":"U128 integer as string"}}}},"nft":{"title":"NftSaleConditions","type":"object","properties":{},"patternProperties":{".*":{"title":"NftMetadataFilter","type":"object","properties":{"token_id":{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"},"token_id_regex":{"title":"TokenIdRegex","type":"string"},"metadata":{"title":"NFTTokenMetadata","type":"object","properties":{"title":{"type":"string","title":"NFTTokenMetadataTitle","description":"ex. Parcel #5055"},"description":{"type":"string","title":"NFTTokenMetadataDesc","description":"free-form description"},"media":{"type":"string","title":"NFTTokenMetadataMedia","description":"URL to associated media, preferably to decentralized, content-addressed storage"},"media_hash":{"type":"string","title":"NFTTokenMetadataMediaHash","description":"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."},"issued_at":{"type":"string","title":"NFTokenMetadataIssuedAt","description":"When token was issued or minted, Unix epoc in milliseconds"},"expires_at":{"type":"string","title":"NFTokenMetadataExpiresAt","description":"When token expires, Unix epoch in milliseconds"},"starts_at":{"type":"string","title":"NFTokenMetadataStartsAt","description":"When token starts being valid, Unix epoch in milliseconds"},"updated_at":{"type":"string","title":"NFTokenMetadataUpdatedAt","description":"When token was last updated, Unix epoch in milliseconds"},"extra":{"type":"string","title":"NFTokenMetadataExtra","description":"Anything extra the MT wants to store on-chain. Can be stringified JSON."},"reference":{"type":"string","title":"NFTokenMetadataReference","description":"URL to an off-chain JSON file with more info."},"reference_hash":{"type":"string","title":"NFTokenMetadataReferenceHash","description":"Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included."}}},"receiver":{"title":"AccountId","type":"string","description":"AccountId for the near account"}},"additionalProperties":false}},"additionalProperties":false}}}]},"created_at":{"title":"U64","type":"string","description":"U64 integer as string"}},"required":["owner_id","item_for_sale","sale_id","sales_conditions","created_at"]}]}}},{"name":"get_supply_by_owner_id","summary":"Get supply of sales by owner id","description":"Get supply of sales by owner id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"account_id","summary":"Owner account id","description":"Owner account id","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":false}],"result":{"name":"MarketSimpleSupplySalesResult","summary":"Supply of sales","description":"Supply of sales","schema":{"title":"U64","type":"string","description":"U64 integer as string"}}},{"name":"get_supply_by_nft_contract_id","summary":"Get supply by nft contract id","description":"Get supply by nft contract id","tags":[{"name":"view","description":"View only methods"}],"params":[{"name":"nft_contract_id","summary":"Nft contract id","description":"Nft contract id","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true}],"result":{"name":"MarketSimpleSupplySalesNFTResult","summary":"Supply of sales","description":"Supply of sales","schema":{"title":"U64","type":"string","description":"U64 integer as string"}}},{"name":"get_supply_sales","summary":"Get supply of sales ","description":"Get supply of sales ","tags":[{"name":"view","description":"View only methods"}],"params":[],"result":{"name":"MarketSimpleSupplySalesResult","summary":"Supply of sales","description":"Supply of sales","schema":{"title":"U64","type":"string","description":"U64 integer as string"}}},{"name":"storage_balance_bounds","summary":"Returns the minimum and maximum allowe balance amounts to interact with this contract","description":"Returns the minimum and maximum allowe balance amounts to interact with this contract","tags":[{"name":"view","description":"View only methods"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[],"result":{"name":"StorageBalanceBoundsResult","summary":"min` is the amount of tokens required to start","description":"This will be returned for the method `storage_balance_bounds`. Both `min` and `max` are string representations of unsigned 128-bit integers.`min` is the amount of tokens required to start using this contract at all (eg to register with the contract). If a new contract user attaches `min` NEAR to a `storage_deposit` call, subsequent calls to `storage_balance_of` for this user must show their `total` equal to `min` and `available=0` . A contract may implement `max` equal to `min` if it only charges for initial registration, and does not adjust per-user storage over time. A contract which implements `max` must refund deposits that would increase a user's storage balance beyond this amount.","schema":{"title":"StorageBalanceBoundsObject","type":"object","properties":{"min":{"title":"U128","type":"string","description":"U128 integer as string"},"max":{"title":"U128","type":"string","description":"U128 integer as string"}}}}},{"name":"storage_balance_of","summary":"Returns the storage balance of an account for set of token_ids","description":"Returns the storage balance of an account for set of token_ids. If the `account_id` is not registered it will return `null`","tags":[{"name":"view","description":"View only methods"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[{"name":"account_id","summary":"Account to allocate storage for","description":"Account to allocate storage for","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":true}],"result":{"name":"StorageBalanceOfResult","summary":"Storage balance of the `account_id`","description":"Storage balance of the `account_id`","schema":{"title":"StorageBalance","type":"object","properties":{"total":{"title":"U128","type":"string","description":"U128 integer as string"},"available":{"title":"U128","type":"string","description":"U128 integer as string"}},"required":["total","available"]},"required":false}},{"name":"storage_deposit","summary":"Payable method that receives an attached deposit of Ⓝ for a given account","description":"Payable method that receives an attached deposit of Ⓝ for a given account. ","tags":[{"name":"change","description":"change method"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[{"name":"account_id","summary":"Account to allocate storage for","description":"Account to allocate storage for","schema":{"title":"AccountId","type":"string","description":"AccountId for the near account"},"required":false},{"name":"registration_only","summary":"Registration flag that if true will refund above minimum balance if accound didn't exist and full deposit if it exists.","description":"Registration flag that if true will refund above minimum balance if accound didn't exist and full deposit if it exists.","schema":{"type":"boolean","title":"boolean_vyG3AETh"},"required":false}],"result":{"name":"StorageDepositResult","summary":"Returns the `StorageBalance` showing updated balances","description":"Returns the `StorageBalance` showing updated balances","schema":{"title":"StorageBalance","type":"object","properties":{"total":{"title":"U128","type":"string","description":"U128 integer as string"},"available":{"title":"U128","type":"string","description":"U128 integer as string"}},"required":["total","available"]}}},{"name":"storage_unregister","summary":"Unregister the predecessor account and return the storage NEAR deposit back","description":"Unregister the predecessor account and return the storage NEAR deposit back. Requires 1yoctoNEAR attached balance to prevent function-call access-key call","tags":[{"name":"change","description":"change method"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[{"name":"force","summary":"The force flag set to true will ignore account balances and burn the tokens and close the account","description":"The force flag set to true will ignore account balances and burn the tokens and close the account","schema":{"type":"boolean","title":"boolean_vyG3AETh"},"required":false}],"result":{"name":"StorageUnregisterResult","summary":"An array of booleans corresponding to the `token_ids`. `false` if token was already unregistered true other wise","schema":{"type":"array","items":[{"type":"boolean","title":"boolean_vyG3AETh"}],"title":"unorderedSetOf_boolean_vyG3AETheht2bVDp"}}},{"name":"storage_withdraw","summary":"Withdraw specified amount of available Ⓝ for predecessor account.","description":"Withdraw specified amount of available Ⓝ for predecessor account. ","tags":[{"name":"change","description":"change method"},{"name":"StorageManagement","description":"Storage Management Extension Tag"}],"params":[{"name":"token_ids","summary":"The tokens to withdraw storage from","description":"The tokens to withdraw storage from","schema":{"title":"TokenIds","type":"array","items":[{"title":"TokenId","description":"Token identifier that corresponds to an id","type":"string"}]}},{"name":"amount","summary":"The amount of balance to refund","description":"The amount of balance to refund, if not specified then it's the total amount. Must require exactly 1 yoctoNEAR attached balance to prevent restricted function-call access-key call for wallet security.","schema":{"title":"U128","type":"string","description":"U128 integer as string"}}],"result":{"name":"StorageWithdrawResult","summary":"Returns the StorageBalance structure showing updated balances","schema":{"title":"StorageBalance","type":"object","properties":{"total":{"title":"U128","type":"string","description":"U128 integer as string"},"available":{"title":"U128","type":"string","description":"U128 integer as string"}},"required":["total","available"]},"required":true}}]} ; public contract: Contract; private validator: MethodCallValidator; @@ -419,6 +427,7 @@ export class SwapplandMarket { "get_fee", "get_sale", "get_sales_by_owner_id", + "get_sales_for_owner_id", "get_sales_by_nft_contract_id", "get_offers_by_contract_token_id", "get_supply_by_owner_id", @@ -689,6 +698,31 @@ export class SwapplandMarket { } + /** + * Get sales for owner id + * + */ + // tslint:disable-next-line:max-line-length + public get_sales_for_owner_id(account_id: AccountId, from_index: U64, limit: Limit): RTGetSalesForOwnerId { + //return this.request("get_sales_for_owner_id", params); + const paramNames:string[] = [ + "account_id", + "from_index", + "limit", + ] + const arrArgs = Array.from(arguments); + const options = {} + const args = options && Object.keys(options).length ? arrArgs.slice(0, arguments.length-1) : arrArgs + const paramByName = _.zipObject(paramNames, args); + if (options && Object.keys(options).length) { + return (this.contract as any).get_sales_for_owner_id({args: paramByName, ...options}) as RTGetSalesForOwnerId + } + + return (this.contract as any).get_sales_for_owner_id(paramByName) as RTGetSalesForOwnerId + + } + + /** * Get sales by nft contract id * diff --git a/generated-client/custom/typescript/src/openrpc.json b/generated-client/custom/typescript/src/openrpc.json index e903c34..e0728ee 100644 --- a/generated-client/custom/typescript/src/openrpc.json +++ b/generated-client/custom/typescript/src/openrpc.json @@ -1050,6 +1050,248 @@ } } }, + { + "name": "get_sales_for_owner_id", + "summary": "Get sales for owner id", + "description": "Get sales for owner id", + "tags": [ + { + "name": "view", + "description": "View only methods" + } + ], + "params": [ + { + "name": "account_id", + "summary": "Potential Owner account id", + "description": "Potential Owner account id", + "schema": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "required": true + }, + { + "name": "from_index", + "summary": "From index value", + "description": "From index value", + "schema": { + "title": "U64", + "type": "string", + "description": "U64 integer as string" + }, + "required": true + }, + { + "name": "limit", + "summary": "Limit to set iteration to rel. to index ", + "description": "Limit to set iteration to rel. to index", + "schema": { + "title": "Limit", + "description": "Limit for setting pagination u64 constrainted by 2^53 js limit", + "type": "integer" + }, + "required": true + } + ], + "result": { + "name": "MarketSimpleSalesForOwnerResult", + "summary": "Sales", + "description": "Sales by owner in a vector", + "schema": { + "title": "Sales", + "type": "array", + "items": [ + { + "title": "Sale", + "type": "object", + "properties": { + "owner_id": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "account_condition": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "approval_id": { + "title": "ApprovalId", + "description": "expected approval ID. A number smaller than 2^53", + "type": "number" + }, + "item_for_sale": { + "title": "ItemForSale", + "type": "object", + "properties": { + "contract_id": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "token_id": { + "title": "TokenId", + "description": "Token identifier that corresponds to an id", + "type": "string" + } + }, + "required": [ + "contract_id", + "token_id" + ] + }, + "sale_id": { + "title": "SaleId", + "type": "string" + }, + "service_fee": { + "title": "U128", + "type": "string", + "description": "U128 integer as string" + }, + "sale_conditions": { + "title": "SaleConditions", + "type": "array", + "items": [ + { + "title": "SaleCondition", + "type": "object", + "properties": { + "ft": { + "title": "FtSaleConditions", + "type": "object", + "properties": {}, + "additionalProperties": { + "title": "Bid", + "type": "object", + "properties": { + "owner_id": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + }, + "amount": { + "title": "U128", + "type": "string", + "description": "U128 integer as string" + } + } + } + }, + "nft": { + "title": "NftSaleConditions", + "type": "object", + "properties": {}, + "patternProperties": { + ".*": { + "title": "NftMetadataFilter", + "type": "object", + "properties": { + "token_id": { + "title": "TokenId", + "description": "Token identifier that corresponds to an id", + "type": "string" + }, + "token_id_regex": { + "title": "TokenIdRegex", + "type": "string" + }, + "metadata": { + "title": "NFTTokenMetadata", + "type": "object", + "properties": { + "title": { + "type": "string", + "title": "NFTTokenMetadataTitle", + "description": "ex. Parcel #5055" + }, + "description": { + "type": "string", + "title": "NFTTokenMetadataDesc", + "description": "free-form description" + }, + "media": { + "type": "string", + "title": "NFTTokenMetadataMedia", + "description": "URL to associated media, preferably to decentralized, content-addressed storage" + }, + "media_hash": { + "type": "string", + "title": "NFTTokenMetadataMediaHash", + "description": "Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included." + }, + "issued_at": { + "type": "string", + "title": "NFTokenMetadataIssuedAt", + "description": "When token was issued or minted, Unix epoc in milliseconds" + }, + "expires_at": { + "type": "string", + "title": "NFTokenMetadataExpiresAt", + "description": "When token expires, Unix epoch in milliseconds" + }, + "starts_at": { + "type": "string", + "title": "NFTokenMetadataStartsAt", + "description": "When token starts being valid, Unix epoch in milliseconds" + }, + "updated_at": { + "type": "string", + "title": "NFTokenMetadataUpdatedAt", + "description": "When token was last updated, Unix epoch in milliseconds" + }, + "extra": { + "type": "string", + "title": "NFTokenMetadataExtra", + "description": "Anything extra the MT wants to store on-chain. Can be stringified JSON." + }, + "reference": { + "type": "string", + "title": "NFTokenMetadataReference", + "description": "URL to an off-chain JSON file with more info." + }, + "reference_hash": { + "type": "string", + "title": "NFTokenMetadataReferenceHash", + "description": "Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included." + } + } + }, + "receiver": { + "title": "AccountId", + "type": "string", + "description": "AccountId for the near account" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } + ] + }, + "created_at": { + "title": "U64", + "type": "string", + "description": "U64 integer as string" + } + }, + "required": [ + "owner_id", + "item_for_sale", + "sale_id", + "sales_conditions", + "created_at" + ] + } + ] + } + } + }, { "name": "get_sales_by_nft_contract_id", "summary": "Get sales by nft contract id", diff --git a/methods/get_sales_for_owner_id.json b/methods/get_sales_for_owner_id.json new file mode 100644 index 0000000..c03bdbc --- /dev/null +++ b/methods/get_sales_for_owner_id.json @@ -0,0 +1,47 @@ +{ + "name": "get_sales_for_owner_id", + "summary": "Get sales for owner id", + "description": "Get sales for owner id", + "tags": [ + { + "$ref": "../standards/tags/view.json" + } + ], + "params": [ + { + "name": "account_id", + "summary": "Potential Owner account id", + "description": "Potential Owner account id", + "schema": { + "$ref": "../standards/schemas/AccountId.json" + }, + "required": true + }, + { + "name": "from_index", + "summary": "From index value", + "description": "From index value", + "schema": { + "$ref": "../standards/schemas/U64.json" + }, + "required": true + }, + { + "name": "limit", + "summary": "Limit to set iteration to rel. to index ", + "description": "Limit to set iteration to rel. to index", + "schema": { + "$ref": "../standards/schemas/Limit.json" + }, + "required": true + } + ], + "result": { + "name": "MarketSimpleSalesForOwnerResult", + "summary": "Sales", + "description": "Sales by owner in a vector", + "schema": { + "$ref": "../schemas/Sales.json" + } + } +} \ No newline at end of file diff --git a/openrpc.json b/openrpc.json index aad56eb..8cf3e8c 100644 --- a/openrpc.json +++ b/openrpc.json @@ -39,6 +39,9 @@ { "$ref": "./methods/get_sales_by_owner_id.json" }, + { + "$ref": "./methods/get_sales_for_owner_id.json" + }, { "$ref": "./methods/get_sales_by_nft_contract_id.json" }, diff --git a/package-lock.json b/package-lock.json index d62d91d..84a4dbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@open-rpc/client-js": "^1.7.0", "@shipsgold/open-rpc-near-client-generator": "^1.3.1", - "@swappland/open-rpc-token-standards-specs": "^1.1.0", + "@swappland/open-rpc-token-standards-specs": "^1.1.1", "@xops.net/openrpc-cli": "^1.0.2", "lodash": "4.17.15", "near-api-js": "0.44.0", @@ -1593,10 +1593,9 @@ } }, "node_modules/@swappland/open-rpc-token-standards-specs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@swappland/open-rpc-token-standards-specs/-/open-rpc-token-standards-specs-1.1.0.tgz", - "integrity": "sha512-oJyDarn4JvFBEaB31LfKHROspEZM4bxTOwnaKh0ervDuIp6LeuaRIJAMYtsYDeBtWv6XPj5TCx7RV+Vpzs0awQ==", - "license": "Apache-2.0", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@swappland/open-rpc-token-standards-specs/-/open-rpc-token-standards-specs-1.1.1.tgz", + "integrity": "sha512-Y3r+FODNwlHay7j6vUkj9KXCy0JmRnneqX0z+QV2sT59xpO8Qo2RpcjCJGGlOZgfXKp/vKPYQ0I28VIdB4sV8g==", "dependencies": { "@open-rpc/client-js": "^1.7.0", "@shipsgold/open-rpc-near-client-generator": "^1.3.1", @@ -9191,9 +9190,9 @@ } }, "@swappland/open-rpc-token-standards-specs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@swappland/open-rpc-token-standards-specs/-/open-rpc-token-standards-specs-1.1.0.tgz", - "integrity": "sha512-oJyDarn4JvFBEaB31LfKHROspEZM4bxTOwnaKh0ervDuIp6LeuaRIJAMYtsYDeBtWv6XPj5TCx7RV+Vpzs0awQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@swappland/open-rpc-token-standards-specs/-/open-rpc-token-standards-specs-1.1.1.tgz", + "integrity": "sha512-Y3r+FODNwlHay7j6vUkj9KXCy0JmRnneqX0z+QV2sT59xpO8Qo2RpcjCJGGlOZgfXKp/vKPYQ0I28VIdB4sV8g==", "requires": { "@open-rpc/client-js": "^1.7.0", "@shipsgold/open-rpc-near-client-generator": "^1.3.1", diff --git a/package.json b/package.json index e0c04fa..6785a1d 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "dependencies": { "@open-rpc/client-js": "^1.7.0", "@shipsgold/open-rpc-near-client-generator": "^1.3.1", - "@swappland/open-rpc-token-standards-specs": "^1.1.0", + "@swappland/open-rpc-token-standards-specs": "^1.1.1", "@xops.net/openrpc-cli": "^1.0.2", "lodash": "4.17.15", "near-api-js": "0.44.0",