From ff9da14b28e8f12cc89d00fd14dd431644a4bd6b Mon Sep 17 00:00:00 2001 From: baulore Date: Tue, 23 Apr 2024 11:48:09 +0300 Subject: [PATCH] tensor-nft-buy-cheapest interface --- .../examples/exmple-actions.ts | 4 ++-- .../smart-messages/tensor-transactions-spec.ts | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/blockchain-sdk-solana/examples/exmple-actions.ts b/packages/blockchain-sdk-solana/examples/exmple-actions.ts index 7075124b..d5497ea4 100644 --- a/packages/blockchain-sdk-solana/examples/exmple-actions.ts +++ b/packages/blockchain-sdk-solana/examples/exmple-actions.ts @@ -3,12 +3,12 @@ // 2. Multiple actions should be later supported (e.g. both link and sign transaction), based on mockups e.g. https://www.figma.com/file/YMrtyevM6MlWYDZBO2fLb4/Use-Case-Examples?type=design&node-id=1-820&mode=dev // 3. Single smart message should be produced if multiple actions exist, we should forbid using multiple tx-services in a context of single actionable notif import { DappMessageActionType, type DappMessageSmartMessageAction } from '@dialectlabs/sdk/src'; -import type { TensorNftBuySmartMessage } from '../../sdk-actions-spec'; +import type { TensorNftBuyNowSmartMessage } from '../../sdk-actions-spec'; import type { DappMessages } from '../../sdk/src/'; // @ts-ignore const dappMessages = (1 as DappMessages); -const tensorSmartMessage: TensorNftBuySmartMessage = { +const tensorSmartMessage: TensorNftBuyNowSmartMessage = { transactionServiceId: 'tensor-nft-buy', transactionParams: { collectionId: 'foo', diff --git a/packages/sdk-actions-spec/src/smart-messages/tensor-transactions-spec.ts b/packages/sdk-actions-spec/src/smart-messages/tensor-transactions-spec.ts index 0ac19cd7..6a099def 100644 --- a/packages/sdk-actions-spec/src/smart-messages/tensor-transactions-spec.ts +++ b/packages/sdk-actions-spec/src/smart-messages/tensor-transactions-spec.ts @@ -1,7 +1,7 @@ import type { SmartMessage, SmartMessageParams } from '@dialectlabs/sdk'; -export interface TensorNftBuySmartMessage extends SmartMessage { - transactionServiceId: 'tensor-nft-buy'; +export interface TensorNftBuyNowSmartMessage extends SmartMessage { + transactionServiceId: 'tensor-nft-buy-now'; transactionParams: NftBuyTransactionParams; } @@ -15,3 +15,14 @@ export interface NftBuyTransactionParams extends SmartMessageParams { collectionName?: string; nftName?: string; } + +export interface TensorNftBuyCheapestSmartMessage extends SmartMessage { + transactionServiceId: 'tensor-nft-buy-cheapest'; + transactionParams: NftBuyTransactionParams; +} + +export interface NftBuyCheapestTransactionParams extends SmartMessageParams { + collectionId: string; + collectionName: string; + imageUrl?: string; +}