Skip to content

feat: actions with tx signing #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tensor-nft-buy-cheapest interface
  • Loading branch information
Baulore committed Apr 23, 2024
commit ff9da14b28e8f12cc89d00fd14dd431644a4bd6b
4 changes: 2 additions & 2 deletions packages/blockchain-sdk-solana/examples/exmple-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}

Expand All @@ -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;
}