Skip to content

Commit

Permalink
Add contractID & tokenData config data
Browse files Browse the repository at this point in the history
  • Loading branch information
debajitr committed Jan 12, 2024
1 parent 317639f commit 17997ea
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@transak/transak-sdk",
"version": "2.1.0",
"version": "2.1.1",
"description": "Transak SDK that allows you to easily integrate fiat on/off ramp",
"type": "module",
"types": "lib/index.d.ts",
Expand Down
26 changes: 24 additions & 2 deletions src/Types/query-params.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ type NFT = {

type ColorMode = 'LIGHT' | 'DARK';

type SourceTokenData = {
sourceTokenCode: string;
sourceTokenAmount: number;
};

type CryptoCurrencyData = {
cryptoCurrencyCode: string;
cryptoCurrencyName: string;
cryptoCurrencyImageURL: string;
};

type TokenData = {
tokenID: string[];
collectionAddress: string;
marketplace: string;
normalizeRoyalties: boolean;
nftName?: string;
nftImage?: string;
};

export type QueryParams = {
apiKey: string;
exchangeScreenTitle?: string;
Expand Down Expand Up @@ -80,6 +100,8 @@ export type QueryParams = {
textColors?: string | string[];
borderColors?: string | string[];
isTransakOne?: boolean;
sourceTokenData?: string;
cryptoCurrencyData?: string;
sourceTokenData?: SourceTokenData[];
cryptoCurrencyData?: CryptoCurrencyData[];
contractID?: string;
tokenData?: TokenData[];
};
2 changes: 1 addition & 1 deletion src/Utils/generate-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function generateURL(configData: TransakConfig) {
return;
}

if (['nftData', 'sourceTokenData', 'cryptoCurrencyData'].includes(key)) {
if (['nftData', 'sourceTokenData', 'cryptoCurrencyData', 'tokenData'].includes(key)) {
try {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Expand Down

0 comments on commit 17997ea

Please sign in to comment.