From 7064eb7d4ddc91eb9967bd0e042ee9c4d67bea09 Mon Sep 17 00:00:00 2001 From: Melisa Anabella Rossi Date: Sat, 13 Jul 2024 19:26:07 -0300 Subject: [PATCH] feat: add signature to trade --- report/schemas.api.md | 55 +++++++++++++++++++++++++++++++++++++------ src/dapps/trade.ts | 1 + src/index.ts | 7 +++++- 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/report/schemas.api.md b/report/schemas.api.md index 7c410f9..fb30f87 100644 --- a/report/schemas.api.md +++ b/report/schemas.api.md @@ -230,6 +230,15 @@ export type BaseEvent = { timestamp: number; }; +// Warning: (ae-missing-release-tag) "BaseTradeAsset" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type BaseTradeAsset = { + assetType: TradeAssetType; + contractAddress: string; + extra: string; +}; + // Warning: (ae-forgotten-export) The symbol "LegacyBid" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "BidTrade" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "Bid" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -480,6 +489,14 @@ export type CollectionFilters = { network?: Network; }; +// Warning: (ae-missing-release-tag) "CollectionItemTradeAsset" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type CollectionItemTradeAsset = BaseTradeAsset & { + assetType: TradeAssetType.COLLECTION_ITEM; + itemId: string; +}; + // Warning: (ae-missing-release-tag) "CollectionSortBy" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -774,6 +791,22 @@ export enum EntityType { WEARABLE = "wearable" } +// Warning: (ae-missing-release-tag) "ERC20TradeAsset" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ERC20TradeAsset = BaseTradeAsset & { + assetType: TradeAssetType.ERC20; + amount: string; +}; + +// Warning: (ae-missing-release-tag) "ERC721TradeAsset" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ERC721TradeAsset = BaseTradeAsset & { + assetType: TradeAssetType.ERC721; + tokenId: string; +}; + // @public export type EthAddress = string; @@ -2634,6 +2667,7 @@ export type ThirdPartyProps = { // @public (undocumented) export type Trade = { id: string; + signature: string; signer: string; network: Network; chainId: ChainId; @@ -2644,14 +2678,21 @@ export type Trade = { received: TradeAssetWithBeneficiary[]; }; -// Warning: (ae-forgotten-export) The symbol "CollectionItemTradeAsset" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "ERC20TradeAsset" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "ERC721TradeAsset" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "TradeAsset" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export type TradeAsset = CollectionItemTradeAsset | ERC20TradeAsset | ERC721TradeAsset; +// Warning: (ae-missing-release-tag) "TradeAssetDirection" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export enum TradeAssetDirection { + // (undocumented) + RECEIVED = "received", + // (undocumented) + SENT = "sent" +} + // Warning: (ae-missing-release-tag) "TradeAssetType" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2995,10 +3036,10 @@ export namespace WorldConfiguration { // src/dapps/sale.ts:18:3 - (ae-incompatible-release-tags) The symbol "network" is marked as @public, but its signature references "Network" which is marked as @alpha // src/dapps/sale.ts:19:3 - (ae-incompatible-release-tags) The symbol "chainId" is marked as @public, but its signature references "ChainId" which is marked as @alpha // src/dapps/sale.ts:42:3 - (ae-incompatible-release-tags) The symbol "network" is marked as @public, but its signature references "Network" which is marked as @alpha -// src/dapps/trade.ts:69:3 - (ae-incompatible-release-tags) The symbol "network" is marked as @public, but its signature references "Network" which is marked as @alpha -// src/dapps/trade.ts:70:3 - (ae-incompatible-release-tags) The symbol "chainId" is marked as @public, but its signature references "ChainId" which is marked as @alpha -// src/dapps/trade.ts:81:3 - (ae-incompatible-release-tags) The symbol "network" is marked as @public, but its signature references "Network" which is marked as @alpha -// src/dapps/trade.ts:82:3 - (ae-incompatible-release-tags) The symbol "chainId" is marked as @public, but its signature references "ChainId" which is marked as @alpha +// src/dapps/trade.ts:70:3 - (ae-incompatible-release-tags) The symbol "network" is marked as @public, but its signature references "Network" which is marked as @alpha +// src/dapps/trade.ts:71:3 - (ae-incompatible-release-tags) The symbol "chainId" is marked as @public, but its signature references "ChainId" which is marked as @alpha +// src/dapps/trade.ts:82:3 - (ae-incompatible-release-tags) The symbol "network" is marked as @public, but its signature references "Network" which is marked as @alpha +// src/dapps/trade.ts:83:3 - (ae-incompatible-release-tags) The symbol "chainId" is marked as @public, but its signature references "ChainId" which is marked as @alpha // src/platform/events/blockchain.ts:19:3 - (ae-forgotten-export) The symbol "BidMetadata" needs to be exported by the entry point index.d.ts // src/platform/events/blockchain.ts:60:3 - (ae-forgotten-export) The symbol "RentalMetadata" needs to be exported by the entry point index.d.ts // src/platform/item/emote/adr74/emote-data-adr74.ts:7:3 - (ae-incompatible-release-tags) The symbol "representations" is marked as @public, but its signature references "EmoteRepresentationADR74" which is marked as @alpha diff --git a/src/dapps/trade.ts b/src/dapps/trade.ts index a0c143a..3a887d2 100644 --- a/src/dapps/trade.ts +++ b/src/dapps/trade.ts @@ -65,6 +65,7 @@ export type TradeAssetWithBeneficiary = TradeAsset & { export type Trade = { id: string + signature: string signer: string network: Network chainId: ChainId diff --git a/src/index.ts b/src/index.ts index 9395dba..7bbea68 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,11 +27,16 @@ export { Trade, TradeAsset, TradeAssetType, + TradeAssetDirection, TradeChecks, TradeExternalCheck, TradeCreation, TradeType, - TradeAssetWithBeneficiary + TradeAssetWithBeneficiary, + BaseTradeAsset, + ERC20TradeAsset, + ERC721TradeAsset, + CollectionItemTradeAsset } from './dapps/trade' export { RentalStatus,