@b3dotfun/sdk 0.0.69 → 0.0.70-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/index.d.ts +1 -0
- package/dist/cjs/anyspend/index.js +1 -0
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +13 -1
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +6 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +16 -0
- package/dist/cjs/anyspend/services/anyspend.d.ts +2 -1
- package/dist/cjs/anyspend/services/anyspend.js +2 -1
- package/dist/cjs/anyspend/types/api.d.ts +295 -0
- package/dist/cjs/anyspend/utils/validation.d.ts +67 -0
- package/dist/cjs/anyspend/utils/validation.js +157 -0
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.js +14 -4
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/esm/anyspend/index.d.ts +1 -0
- package/dist/esm/anyspend/index.js +1 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +13 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +6 -2
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +3 -1
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +1 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +16 -0
- package/dist/esm/anyspend/services/anyspend.d.ts +2 -1
- package/dist/esm/anyspend/services/anyspend.js +2 -1
- package/dist/esm/anyspend/types/api.d.ts +295 -0
- package/dist/esm/anyspend/utils/validation.d.ts +67 -0
- package/dist/esm/anyspend/utils/validation.js +153 -0
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.js +14 -4
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/types/anyspend/index.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +16 -0
- package/dist/types/anyspend/services/anyspend.d.ts +2 -1
- package/dist/types/anyspend/types/api.d.ts +295 -0
- package/dist/types/anyspend/utils/validation.d.ts +67 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
- package/package.json +3 -2
- package/src/anyspend/index.ts +1 -0
- package/src/anyspend/react/components/AnySpend.tsx +23 -0
- package/src/anyspend/react/components/AnySpendBondKit.tsx +3 -1
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +3 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +8 -1
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +4 -0
- package/src/anyspend/react/components/AnySpendDepositUpside.tsx +3 -0
- package/src/anyspend/react/components/AnySpendNFT.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
- package/src/anyspend/react/components/AnySpendTournament.tsx +3 -0
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +3 -0
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -0
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +13 -1
- package/src/anyspend/services/anyspend.ts +3 -0
- package/src/anyspend/types/api.ts +295 -0
- package/src/anyspend/utils/validation.ts +209 -0
- package/src/global-account/react/components/ProfileEditor/ProfileEditor.tsx +20 -6
- package/src/global-account/react/stores/useModalStore.ts +4 -0
|
@@ -14,7 +14,7 @@ const STAKE_FOR_FUNCTION_ABI = JSON.stringify([
|
|
|
14
14
|
outputs: [],
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
|
-
export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }) {
|
|
17
|
+
export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, clientReferenceId, }) {
|
|
18
18
|
if (!recipientAddress)
|
|
19
19
|
return null;
|
|
20
20
|
const header = () => (_jsx(_Fragment, { children: _jsx("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", token.symbol, " (Exact In)"] }) }) }) }));
|
|
@@ -26,5 +26,5 @@ export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipien
|
|
|
26
26
|
spenderAddress: stakingContractAddress,
|
|
27
27
|
action: `stake ${token.symbol}`,
|
|
28
28
|
};
|
|
29
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
|
|
29
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess, clientReferenceId: clientReferenceId }));
|
|
30
30
|
}
|
|
@@ -10,6 +10,7 @@ type AnySpendTournamentProps = {
|
|
|
10
10
|
tournamentEntryToken: components["schemas"]["Token"];
|
|
11
11
|
tournamentEntryFee: string;
|
|
12
12
|
onSuccess?: () => void;
|
|
13
|
+
clientReferenceId?: string;
|
|
13
14
|
} | {
|
|
14
15
|
mode?: "modal" | "page";
|
|
15
16
|
action: "fund";
|
|
@@ -20,6 +21,7 @@ type AnySpendTournamentProps = {
|
|
|
20
21
|
tournamentFundToken: components["schemas"]["Token"];
|
|
21
22
|
tournamentFundAmount: string;
|
|
22
23
|
onSuccess?: () => void;
|
|
24
|
+
clientReferenceId?: string;
|
|
23
25
|
};
|
|
24
26
|
export declare function AnySpendTournament(props: AnySpendTournamentProps): import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
export {};
|
|
@@ -13,5 +13,5 @@ export function AnySpendTournament(props) {
|
|
|
13
13
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: action === "join" ? props.joinFor : undefined, orderType: action === "join" ? "join_tournament" : "fund_tournament", dstChainId: tournamentChainId, dstToken: dstToken, dstAmount: dstAmount, contractAddress: tournamentContractAddress, encodedData: "0x", metadata: {
|
|
14
14
|
type: action === "join" ? "join_tournament" : "fund_tournament",
|
|
15
15
|
tournament: tournamentMetadata,
|
|
16
|
-
}, header: header, onSuccess: onSuccess, showRecipient: action === "join" }));
|
|
16
|
+
}, header: header, onSuccess: onSuccess, showRecipient: action === "join", clientReferenceId: props.clientReferenceId }));
|
|
17
17
|
}
|
|
@@ -21,5 +21,6 @@ export interface AnySpendDepositHypeProps {
|
|
|
21
21
|
}) => void;
|
|
22
22
|
customUsdInputValues?: string[];
|
|
23
23
|
preferEoa?: boolean;
|
|
24
|
+
clientReferenceId?: string;
|
|
24
25
|
}
|
|
25
|
-
export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }: AnySpendDepositHypeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, clientReferenceId, }: AnySpendDepositHypeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,7 +6,7 @@ export const HYPE_TOKEN_DETAILS = {
|
|
|
6
6
|
SYMBOL: "HYPE",
|
|
7
7
|
LOGO_URI: "https://cdn.hypeduel.com/hypes-coin.svg",
|
|
8
8
|
};
|
|
9
|
-
export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }) {
|
|
9
|
+
export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, clientReferenceId, }) {
|
|
10
10
|
if (!recipientAddress)
|
|
11
11
|
return null;
|
|
12
12
|
const header = () => (_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsx("div", { children: _jsx("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }));
|
|
@@ -19,5 +19,5 @@ export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddres
|
|
|
19
19
|
logoURI: HYPE_TOKEN_DETAILS.LOGO_URI,
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: hypeToken, destinationChainId: base.id, orderType: "hype_duel", minDestinationAmount: 10, header: header, onSuccess: onSuccess, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa }));
|
|
22
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: hypeToken, destinationChainId: base.id, orderType: "hype_duel", minDestinationAmount: 10, header: header, onSuccess: onSuccess, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, clientReferenceId: clientReferenceId }));
|
|
23
23
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { GenerateSigMintResponse } from "../../types/signatureMint";
|
|
2
|
-
export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData, imageUrl, onSuccess, }: {
|
|
2
|
+
export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData, imageUrl, onSuccess, clientReferenceId, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
signatureData: GenerateSigMintResponse;
|
|
6
6
|
imageUrl?: string;
|
|
7
7
|
onSuccess?: (txHash?: string) => void;
|
|
8
|
+
clientReferenceId?: string;
|
|
8
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,7 +35,7 @@ function generateEncodedDataForSignatureMint(signatureData) {
|
|
|
35
35
|
});
|
|
36
36
|
return encodedData;
|
|
37
37
|
}
|
|
38
|
-
export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess, }) {
|
|
38
|
+
export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess, clientReferenceId, }) {
|
|
39
39
|
// Get token data
|
|
40
40
|
const { data: tokenData, isError: isTokenError, isLoading, } = useTokenData(signatureData.collection.chainId, signatureData.collection.signatureRequestBody?.currency);
|
|
41
41
|
// Convert token data to AnySpend Token type
|
|
@@ -68,5 +68,5 @@ export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData
|
|
|
68
68
|
const price = parseEther(signatureData.payload.price?.toString() || "0");
|
|
69
69
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType: "custom", dstChainId: signatureData.collection.chainId, dstToken: dstToken, dstAmount: price.toString(), contractAddress: signatureData.collection.address || "", encodedData: encodedData, metadata: {
|
|
70
70
|
action: "Signature Mint",
|
|
71
|
-
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
71
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true, clientReferenceId: clientReferenceId }));
|
|
72
72
|
}
|
|
@@ -19,7 +19,7 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
19
19
|
};
|
|
20
20
|
const { mutate: createOrder, isPending } = useMutation({
|
|
21
21
|
mutationFn: async (params) => {
|
|
22
|
-
const { recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId, } = params;
|
|
22
|
+
const { recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId, clientReferenceId, } = params;
|
|
23
23
|
try {
|
|
24
24
|
// Validate required onramp fields
|
|
25
25
|
if (!onramp.vendor || !onramp.country) {
|
|
@@ -62,6 +62,7 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
62
62
|
}),
|
|
63
63
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
64
64
|
partnerId,
|
|
65
|
+
clientReferenceId,
|
|
65
66
|
visitorData,
|
|
66
67
|
});
|
|
67
68
|
}
|
|
@@ -17,7 +17,7 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
17
17
|
};
|
|
18
18
|
const { mutate: createOrder, isPending } = useMutation({
|
|
19
19
|
mutationFn: async (params) => {
|
|
20
|
-
const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress } = params;
|
|
20
|
+
const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress, clientReferenceId, } = params;
|
|
21
21
|
try {
|
|
22
22
|
return await anyspendService.createOrder({
|
|
23
23
|
recipientAddress: normalizeAddress(recipientAddress),
|
|
@@ -50,6 +50,7 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
50
50
|
},
|
|
51
51
|
}),
|
|
52
52
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
53
|
+
clientReferenceId,
|
|
53
54
|
visitorData,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
@@ -16,6 +16,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
16
16
|
receivedDepositAt: number | null;
|
|
17
17
|
creatorAddress: string | null;
|
|
18
18
|
partnerId: string | null;
|
|
19
|
+
clientReferenceId?: string | null;
|
|
19
20
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
20
21
|
oneClickBuyUrl: string | null;
|
|
21
22
|
stripePaymentIntentId: string | null;
|
|
@@ -45,6 +46,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
45
46
|
receivedDepositAt: number | null;
|
|
46
47
|
creatorAddress: string | null;
|
|
47
48
|
partnerId: string | null;
|
|
49
|
+
clientReferenceId?: string | null;
|
|
48
50
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
49
51
|
oneClickBuyUrl: string | null;
|
|
50
52
|
stripePaymentIntentId: string | null;
|
|
@@ -74,6 +76,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
74
76
|
receivedDepositAt: number | null;
|
|
75
77
|
creatorAddress: string | null;
|
|
76
78
|
partnerId: string | null;
|
|
79
|
+
clientReferenceId?: string | null;
|
|
77
80
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
78
81
|
oneClickBuyUrl: string | null;
|
|
79
82
|
stripePaymentIntentId: string | null;
|
|
@@ -103,6 +106,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
103
106
|
receivedDepositAt: number | null;
|
|
104
107
|
creatorAddress: string | null;
|
|
105
108
|
partnerId: string | null;
|
|
109
|
+
clientReferenceId?: string | null;
|
|
106
110
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
107
111
|
oneClickBuyUrl: string | null;
|
|
108
112
|
stripePaymentIntentId: string | null;
|
|
@@ -132,6 +136,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
132
136
|
receivedDepositAt: number | null;
|
|
133
137
|
creatorAddress: string | null;
|
|
134
138
|
partnerId: string | null;
|
|
139
|
+
clientReferenceId?: string | null;
|
|
135
140
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
136
141
|
oneClickBuyUrl: string | null;
|
|
137
142
|
stripePaymentIntentId: string | null;
|
|
@@ -161,6 +166,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
161
166
|
receivedDepositAt: number | null;
|
|
162
167
|
creatorAddress: string | null;
|
|
163
168
|
partnerId: string | null;
|
|
169
|
+
clientReferenceId?: string | null;
|
|
164
170
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
165
171
|
oneClickBuyUrl: string | null;
|
|
166
172
|
stripePaymentIntentId: string | null;
|
|
@@ -190,6 +196,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
190
196
|
receivedDepositAt: number | null;
|
|
191
197
|
creatorAddress: string | null;
|
|
192
198
|
partnerId: string | null;
|
|
199
|
+
clientReferenceId?: string | null;
|
|
193
200
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
194
201
|
oneClickBuyUrl: string | null;
|
|
195
202
|
stripePaymentIntentId: string | null;
|
|
@@ -219,6 +226,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
219
226
|
receivedDepositAt: number | null;
|
|
220
227
|
creatorAddress: string | null;
|
|
221
228
|
partnerId: string | null;
|
|
229
|
+
clientReferenceId?: string | null;
|
|
222
230
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
223
231
|
oneClickBuyUrl: string | null;
|
|
224
232
|
stripePaymentIntentId: string | null;
|
|
@@ -251,6 +259,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
251
259
|
receivedDepositAt: number | null;
|
|
252
260
|
creatorAddress: string | null;
|
|
253
261
|
partnerId: string | null;
|
|
262
|
+
clientReferenceId?: string | null;
|
|
254
263
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
255
264
|
oneClickBuyUrl: string | null;
|
|
256
265
|
stripePaymentIntentId: string | null;
|
|
@@ -280,6 +289,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
280
289
|
receivedDepositAt: number | null;
|
|
281
290
|
creatorAddress: string | null;
|
|
282
291
|
partnerId: string | null;
|
|
292
|
+
clientReferenceId?: string | null;
|
|
283
293
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
284
294
|
oneClickBuyUrl: string | null;
|
|
285
295
|
stripePaymentIntentId: string | null;
|
|
@@ -309,6 +319,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
309
319
|
receivedDepositAt: number | null;
|
|
310
320
|
creatorAddress: string | null;
|
|
311
321
|
partnerId: string | null;
|
|
322
|
+
clientReferenceId?: string | null;
|
|
312
323
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
313
324
|
oneClickBuyUrl: string | null;
|
|
314
325
|
stripePaymentIntentId: string | null;
|
|
@@ -338,6 +349,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
338
349
|
receivedDepositAt: number | null;
|
|
339
350
|
creatorAddress: string | null;
|
|
340
351
|
partnerId: string | null;
|
|
352
|
+
clientReferenceId?: string | null;
|
|
341
353
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
342
354
|
oneClickBuyUrl: string | null;
|
|
343
355
|
stripePaymentIntentId: string | null;
|
|
@@ -367,6 +379,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
367
379
|
receivedDepositAt: number | null;
|
|
368
380
|
creatorAddress: string | null;
|
|
369
381
|
partnerId: string | null;
|
|
382
|
+
clientReferenceId?: string | null;
|
|
370
383
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
371
384
|
oneClickBuyUrl: string | null;
|
|
372
385
|
stripePaymentIntentId: string | null;
|
|
@@ -396,6 +409,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
396
409
|
receivedDepositAt: number | null;
|
|
397
410
|
creatorAddress: string | null;
|
|
398
411
|
partnerId: string | null;
|
|
412
|
+
clientReferenceId?: string | null;
|
|
399
413
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
400
414
|
oneClickBuyUrl: string | null;
|
|
401
415
|
stripePaymentIntentId: string | null;
|
|
@@ -425,6 +439,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
425
439
|
receivedDepositAt: number | null;
|
|
426
440
|
creatorAddress: string | null;
|
|
427
441
|
partnerId: string | null;
|
|
442
|
+
clientReferenceId?: string | null;
|
|
428
443
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
429
444
|
oneClickBuyUrl: string | null;
|
|
430
445
|
stripePaymentIntentId: string | null;
|
|
@@ -454,6 +469,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
454
469
|
receivedDepositAt: number | null;
|
|
455
470
|
creatorAddress: string | null;
|
|
456
471
|
partnerId: string | null;
|
|
472
|
+
clientReferenceId?: string | null;
|
|
457
473
|
onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
|
|
458
474
|
oneClickBuyUrl: string | null;
|
|
459
475
|
stripePaymentIntentId: string | null;
|
|
@@ -6,7 +6,7 @@ export declare const anyspendService: {
|
|
|
6
6
|
getTokenList: (chainId: number, query: string) => Promise<components["schemas"]["Token"][]>;
|
|
7
7
|
getToken: (chainId: number, tokenAddress: string) => Promise<components["schemas"]["Token"]>;
|
|
8
8
|
getQuote: (req: GetQuoteRequest) => Promise<GetQuoteResponse>;
|
|
9
|
-
createOrder: ({ recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId, visitorData, }: {
|
|
9
|
+
createOrder: ({ recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId, clientReferenceId, visitorData, }: {
|
|
10
10
|
recipientAddress: string;
|
|
11
11
|
type: string;
|
|
12
12
|
srcChain: number;
|
|
@@ -19,6 +19,7 @@ export declare const anyspendService: {
|
|
|
19
19
|
metadata: Record<string, any>;
|
|
20
20
|
creatorAddress?: string;
|
|
21
21
|
partnerId?: string;
|
|
22
|
+
clientReferenceId?: string;
|
|
22
23
|
visitorData?: VisitorData;
|
|
23
24
|
}) => Promise<{
|
|
24
25
|
success: boolean;
|
|
@@ -35,7 +35,7 @@ export const anyspendService = {
|
|
|
35
35
|
return data;
|
|
36
36
|
},
|
|
37
37
|
// Order related
|
|
38
|
-
createOrder: async ({ recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId, visitorData, }) => {
|
|
38
|
+
createOrder: async ({ recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId, clientReferenceId, visitorData, }) => {
|
|
39
39
|
const response = await fetch(`${ANYSPEND_MAINNET_BASE_URL}/orders`, {
|
|
40
40
|
method: "POST",
|
|
41
41
|
headers: {
|
|
@@ -56,6 +56,7 @@ export const anyspendService = {
|
|
|
56
56
|
metadata,
|
|
57
57
|
creatorAddress,
|
|
58
58
|
partnerId,
|
|
59
|
+
...(clientReferenceId && { clientReferenceId }),
|
|
59
60
|
}),
|
|
60
61
|
});
|
|
61
62
|
const data = await response.json();
|