Skip to content

Commit

Permalink
feat: add support for offers by owner
Browse files Browse the repository at this point in the history
  • Loading branch information
zcstarr committed Feb 16, 2022
1 parent b308007 commit 2bc0496
Show file tree
Hide file tree
Showing 7 changed files with 578 additions and 11 deletions.
242 changes: 242 additions & 0 deletions build/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
38 changes: 36 additions & 2 deletions generated-client/custom/typescript/src/index.ts

Large diffs are not rendered by default.

Loading

0 comments on commit 2bc0496

Please sign in to comment.