Skip to content

Commit

Permalink
[GPR-370] Update sign transaction response type (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhesgodi authored Jan 24, 2024
1 parent db0ff55 commit 814b958
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type TransakNFTData = {
collectionAddress: string;
imageURL: string;
nftName: string;
nftType: 'ERC721';
nftType: string;
price: number[];
quantity: number;
tokenID: string[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import pako from 'pako';
import { useCallback, useEffect, useState } from 'react';
import { Environment } from '@imtbl/config';
import pako from 'pako';

export type TransakNFTData = {
imageURL: string;
quantity: number;
nftName: string;
collectionAddress: string;
tokenID: Array<string>;
price: Array<number>;
nftType: 'ERC721';
};
import { TransakNFTData } from './TransakTypes';

export type TransakWidgetType = 'on-ramp' | 'nft-checkout';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function WithCard(props: WithCardProps) {
price: product.amount,
quantity: product.qty,
tokenID: product.tokenId,
nftType: 'ERC721',
nftType: product.contractType || 'ERC721',
})),
[signResponse],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ type SignApiTransaction = {
};

type SignApiProduct = {
product_id: string;
collection_address: string
contract_type: string
detail: {
amount: number;
collection_address: string;
token_id: string;
}[];
product_id: string;
};

type SignApiResponse = {
Expand Down Expand Up @@ -93,7 +94,8 @@ const toSignedProduct = (
name: item?.name || '',
description: item?.description || '',
currency,
collectionAddress: product.detail[0]?.collection_address,
contractType: product.contract_type,
collectionAddress: product.collection_address,
amount: product.detail.map(({ amount }) => amount),
tokenId: product.detail.map(({ token_id: tokenId }) => tokenId),
});
Expand Down
1 change: 1 addition & 0 deletions packages/checkout/widgets-lib/src/widgets/sale/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type SignedOrderProduct = {
amount: number[];
tokenId: string[];
currency: string;
contractType: string;
collectionAddress: string;
};

Expand Down

0 comments on commit 814b958

Please sign in to comment.