@b3dotfun/sdk 0.0.70-alpha.0 → 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/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/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 +1 -1
- 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/stores/useModalStore.ts +4 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface ValidationResult {
|
|
2
|
+
isValid: boolean;
|
|
3
|
+
error?: string;
|
|
4
|
+
cleaned?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface StringValidationOptions {
|
|
7
|
+
required?: boolean;
|
|
8
|
+
defaultValue?: () => string;
|
|
9
|
+
minLength?: number;
|
|
10
|
+
maxLength?: number;
|
|
11
|
+
pattern?: RegExp;
|
|
12
|
+
patternErrorMessage?: string;
|
|
13
|
+
trim?: boolean;
|
|
14
|
+
toLowerCase?: boolean;
|
|
15
|
+
toUpperCase?: boolean;
|
|
16
|
+
customValidator?: (value: string) => {
|
|
17
|
+
valid: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generic string validator with configurable rules
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateString(value: string | undefined, options: StringValidationOptions): ValidationResult;
|
|
25
|
+
/**
|
|
26
|
+
* Common validation patterns
|
|
27
|
+
*/
|
|
28
|
+
export declare const ValidationPatterns: {
|
|
29
|
+
readonly ALPHANUMERIC: RegExp;
|
|
30
|
+
readonly ALPHANUMERIC_WITH_DASH_UNDERSCORE: RegExp;
|
|
31
|
+
readonly ALPHANUMERIC_WITH_SAFE_CHARS: RegExp;
|
|
32
|
+
readonly SAFE_IDENTIFIER: RegExp;
|
|
33
|
+
readonly NO_CONTROL_CHARS: RegExp;
|
|
34
|
+
readonly URL_SAFE: RegExp;
|
|
35
|
+
readonly NUMERIC: RegExp;
|
|
36
|
+
readonly HEX: RegExp;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Pre-configured validators for common use cases
|
|
40
|
+
*/
|
|
41
|
+
export declare const Validators: {
|
|
42
|
+
/**
|
|
43
|
+
* Validates client reference IDs (alphanumeric + safe chars)
|
|
44
|
+
* Returns undefined if not provided
|
|
45
|
+
*/
|
|
46
|
+
clientReferenceId: (value?: string) => ValidationResult;
|
|
47
|
+
/**
|
|
48
|
+
* Validates alphanumeric strings (letters and numbers only)
|
|
49
|
+
*/
|
|
50
|
+
alphanumeric: (value?: string, required?: boolean) => ValidationResult;
|
|
51
|
+
/**
|
|
52
|
+
* Validates wallet addresses (hex format)
|
|
53
|
+
*/
|
|
54
|
+
walletAddress: (value?: string, required?: boolean) => ValidationResult;
|
|
55
|
+
/**
|
|
56
|
+
* Validates order IDs (UUID format)
|
|
57
|
+
*/
|
|
58
|
+
orderId: (value?: string) => ValidationResult;
|
|
59
|
+
/**
|
|
60
|
+
* Validates URL-safe strings
|
|
61
|
+
*/
|
|
62
|
+
urlSafe: (value?: string, maxLength?: number) => ValidationResult;
|
|
63
|
+
/**
|
|
64
|
+
* Validates safe identifiers (no injection risks)
|
|
65
|
+
*/
|
|
66
|
+
safeIdentifier: (value?: string, required?: boolean) => ValidationResult;
|
|
67
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic string validator with configurable rules
|
|
3
|
+
*/
|
|
4
|
+
export function validateString(value, options) {
|
|
5
|
+
const { required = false, defaultValue, minLength, maxLength, pattern, patternErrorMessage, trim = true, toLowerCase = false, toUpperCase = false, customValidator, } = options;
|
|
6
|
+
// Handle empty/undefined
|
|
7
|
+
if (!value || (trim && value.trim() === "")) {
|
|
8
|
+
if (required && !defaultValue) {
|
|
9
|
+
return { isValid: false, error: "This field is required" };
|
|
10
|
+
}
|
|
11
|
+
if (defaultValue) {
|
|
12
|
+
return { isValid: true, cleaned: defaultValue() };
|
|
13
|
+
}
|
|
14
|
+
return { isValid: true, cleaned: undefined };
|
|
15
|
+
}
|
|
16
|
+
// Pre-processing
|
|
17
|
+
let cleaned = value;
|
|
18
|
+
if (trim)
|
|
19
|
+
cleaned = cleaned.trim();
|
|
20
|
+
if (toLowerCase)
|
|
21
|
+
cleaned = cleaned.toLowerCase();
|
|
22
|
+
if (toUpperCase)
|
|
23
|
+
cleaned = cleaned.toUpperCase();
|
|
24
|
+
// Length validation
|
|
25
|
+
if (minLength !== undefined && cleaned.length < minLength) {
|
|
26
|
+
return {
|
|
27
|
+
isValid: false,
|
|
28
|
+
error: `Minimum length is ${minLength} characters`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (maxLength !== undefined && cleaned.length > maxLength) {
|
|
32
|
+
return {
|
|
33
|
+
isValid: false,
|
|
34
|
+
error: `Maximum length is ${maxLength} characters`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Pattern validation
|
|
38
|
+
if (pattern && !pattern.test(cleaned)) {
|
|
39
|
+
return {
|
|
40
|
+
isValid: false,
|
|
41
|
+
error: patternErrorMessage || "Invalid format",
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Custom validation
|
|
45
|
+
if (customValidator) {
|
|
46
|
+
const customResult = customValidator(cleaned);
|
|
47
|
+
if (!customResult.valid) {
|
|
48
|
+
return { isValid: false, error: customResult.error };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return { isValid: true, cleaned };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Common validation patterns
|
|
55
|
+
*/
|
|
56
|
+
export const ValidationPatterns = {
|
|
57
|
+
ALPHANUMERIC: /^[a-zA-Z0-9]+$/,
|
|
58
|
+
ALPHANUMERIC_WITH_DASH_UNDERSCORE: /^[a-zA-Z0-9_-]+$/,
|
|
59
|
+
ALPHANUMERIC_WITH_SAFE_CHARS: /^[a-zA-Z0-9_.\-]+$/,
|
|
60
|
+
SAFE_IDENTIFIER: /^[a-zA-Z0-9_.\-]+$/, // For IDs, references
|
|
61
|
+
NO_CONTROL_CHARS: /^[^\x00-\x1F\x7F]+$/,
|
|
62
|
+
URL_SAFE: /^[a-zA-Z0-9_.\-~]+$/,
|
|
63
|
+
NUMERIC: /^\d+$/,
|
|
64
|
+
HEX: /^[0-9a-fA-F]+$/,
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Pre-configured validators for common use cases
|
|
68
|
+
*/
|
|
69
|
+
export const Validators = {
|
|
70
|
+
/**
|
|
71
|
+
* Validates client reference IDs (alphanumeric + safe chars)
|
|
72
|
+
* Returns undefined if not provided
|
|
73
|
+
*/
|
|
74
|
+
clientReferenceId: (value) => validateString(value, {
|
|
75
|
+
required: false,
|
|
76
|
+
maxLength: 255,
|
|
77
|
+
pattern: ValidationPatterns.SAFE_IDENTIFIER,
|
|
78
|
+
patternErrorMessage: "Only letters, numbers, hyphens, underscores, and dots allowed",
|
|
79
|
+
trim: true,
|
|
80
|
+
customValidator: val => {
|
|
81
|
+
// Additional security checks
|
|
82
|
+
const dangerous = /('|"|;|--|\/\*|\*\/|<|>|script)/i;
|
|
83
|
+
if (dangerous.test(val)) {
|
|
84
|
+
return {
|
|
85
|
+
valid: false,
|
|
86
|
+
error: "Contains potentially dangerous characters",
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return { valid: true };
|
|
90
|
+
},
|
|
91
|
+
}),
|
|
92
|
+
/**
|
|
93
|
+
* Validates alphanumeric strings (letters and numbers only)
|
|
94
|
+
*/
|
|
95
|
+
alphanumeric: (value, required = false) => validateString(value, {
|
|
96
|
+
required,
|
|
97
|
+
pattern: ValidationPatterns.ALPHANUMERIC,
|
|
98
|
+
patternErrorMessage: "Only letters and numbers allowed",
|
|
99
|
+
trim: true,
|
|
100
|
+
}),
|
|
101
|
+
/**
|
|
102
|
+
* Validates wallet addresses (hex format)
|
|
103
|
+
*/
|
|
104
|
+
walletAddress: (value, required = true) => validateString(value, {
|
|
105
|
+
required,
|
|
106
|
+
minLength: 42,
|
|
107
|
+
maxLength: 42,
|
|
108
|
+
pattern: /^0x[a-fA-F0-9]{40}$/,
|
|
109
|
+
patternErrorMessage: "Invalid wallet address format",
|
|
110
|
+
trim: true,
|
|
111
|
+
toLowerCase: true,
|
|
112
|
+
}),
|
|
113
|
+
/**
|
|
114
|
+
* Validates order IDs (UUID format)
|
|
115
|
+
*/
|
|
116
|
+
orderId: (value) => validateString(value, {
|
|
117
|
+
required: false,
|
|
118
|
+
pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
|
|
119
|
+
patternErrorMessage: "Invalid order ID format",
|
|
120
|
+
trim: true,
|
|
121
|
+
toLowerCase: true,
|
|
122
|
+
}),
|
|
123
|
+
/**
|
|
124
|
+
* Validates URL-safe strings
|
|
125
|
+
*/
|
|
126
|
+
urlSafe: (value, maxLength = 255) => validateString(value, {
|
|
127
|
+
maxLength,
|
|
128
|
+
pattern: ValidationPatterns.URL_SAFE,
|
|
129
|
+
patternErrorMessage: "Contains invalid URL characters",
|
|
130
|
+
trim: true,
|
|
131
|
+
}),
|
|
132
|
+
/**
|
|
133
|
+
* Validates safe identifiers (no injection risks)
|
|
134
|
+
*/
|
|
135
|
+
safeIdentifier: (value, required = false) => validateString(value, {
|
|
136
|
+
required,
|
|
137
|
+
maxLength: 255,
|
|
138
|
+
pattern: ValidationPatterns.SAFE_IDENTIFIER,
|
|
139
|
+
patternErrorMessage: "Invalid identifier format",
|
|
140
|
+
customValidator: val => {
|
|
141
|
+
// Additional security checks
|
|
142
|
+
const dangerous = /('|"|;|--|\/\*|\*\/|<|>|script)/i;
|
|
143
|
+
if (dangerous.test(val)) {
|
|
144
|
+
return {
|
|
145
|
+
valid: false,
|
|
146
|
+
error: "Contains potentially dangerous characters",
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return { valid: true };
|
|
150
|
+
},
|
|
151
|
+
trim: true,
|
|
152
|
+
}),
|
|
153
|
+
};
|
|
@@ -122,6 +122,8 @@ export interface AnySpendModalProps extends BaseModalProps {
|
|
|
122
122
|
destinationTokenChainId?: number;
|
|
123
123
|
/** Custom USD input values for quick amount buttons in fiat onramp */
|
|
124
124
|
customUsdInputValues?: string[];
|
|
125
|
+
/** Client-provided reference ID for tracking orders */
|
|
126
|
+
clientReferenceId?: string;
|
|
125
127
|
}
|
|
126
128
|
/**
|
|
127
129
|
* Props for the AnySpend NFT modal
|
|
@@ -136,6 +138,8 @@ export interface AnySpendNftProps extends BaseModalProps {
|
|
|
136
138
|
recipientAddress?: string;
|
|
137
139
|
/** Callback function called when the NFT is successfully transferred */
|
|
138
140
|
onSuccess?: (txHash?: string) => void;
|
|
141
|
+
/** Client-provided reference ID for tracking orders */
|
|
142
|
+
clientReferenceId?: string;
|
|
139
143
|
}
|
|
140
144
|
/**
|
|
141
145
|
* Props for the AnySpend tournament modal
|
|
@@ -6,6 +6,7 @@ export * from "./utils/json";
|
|
|
6
6
|
export * from "./utils/number";
|
|
7
7
|
export * from "./utils/string";
|
|
8
8
|
export * from "./utils/token";
|
|
9
|
+
export * from "./utils/validation";
|
|
9
10
|
export * from "./constants";
|
|
10
11
|
export * from "./abis/abiUsdcBase";
|
|
11
12
|
export * from "./abis/erc20Staking";
|
|
@@ -34,4 +34,10 @@ export declare function AnySpend(props: {
|
|
|
34
34
|
}) => void;
|
|
35
35
|
onSuccess?: (txHash?: string) => void;
|
|
36
36
|
customUsdInputValues?: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Client-provided reference ID for tracking orders.
|
|
39
|
+
* Must be alphanumeric with optional hyphens, underscores, and dots (max 255 chars).
|
|
40
|
+
* Auto-generates UUID if not provided.
|
|
41
|
+
*/
|
|
42
|
+
clientReferenceId?: string;
|
|
37
43
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { AnySpendBondKitProps } from "@b3dotfun/sdk/global-account/react/stores/useModalStore";
|
|
2
|
-
export declare function AnySpendBondKit({ mode, recipientAddress, contractAddress, minTokensOut, imageUrl, b3Amount: initialB3Amount, onSuccess, }: AnySpendBondKitProps
|
|
2
|
+
export declare function AnySpendBondKit({ mode, recipientAddress, contractAddress, minTokensOut, imageUrl, b3Amount: initialB3Amount, onSuccess, clientReferenceId, }: AnySpendBondKitProps & {
|
|
3
|
+
clientReferenceId?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, }: {
|
|
1
|
+
export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, clientReferenceId, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
spinwheelContractAddress: string;
|
|
@@ -6,4 +6,5 @@ export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddr
|
|
|
6
6
|
recipientAddress: string;
|
|
7
7
|
prefillQuantity?: string;
|
|
8
8
|
onSuccess?: (txHash?: string) => void;
|
|
9
|
+
clientReferenceId?: string;
|
|
9
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -31,6 +31,7 @@ export interface AnySpendCustomExactInProps {
|
|
|
31
31
|
anyspendPrice: GetQuoteResponse | undefined;
|
|
32
32
|
isLoadingAnyspendPrice: boolean;
|
|
33
33
|
}) => React.JSX.Element;
|
|
34
|
+
clientReferenceId?: string;
|
|
34
35
|
}
|
|
35
36
|
export declare function AnySpendCustomExactIn(props: AnySpendCustomExactInProps): import("react/jsx-runtime").JSX.Element;
|
|
36
37
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
-
export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, }: {
|
|
2
|
+
export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, clientReferenceId, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
recipientAddress: string;
|
|
@@ -8,4 +8,5 @@ export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddres
|
|
|
8
8
|
depositContractAddress: string;
|
|
9
9
|
token: components["schemas"]["Token"];
|
|
10
10
|
onSuccess?: (amount: string) => void;
|
|
11
|
+
clientReferenceId?: string;
|
|
11
12
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
-
export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail, }: {
|
|
2
|
+
export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail, clientReferenceId, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
recipientAddress?: string;
|
|
6
6
|
nftContract: components["schemas"]["NftContract"];
|
|
7
7
|
onSuccess?: (txHash?: string) => void;
|
|
8
8
|
onShowPointsDetail?: () => void;
|
|
9
|
+
clientReferenceId?: string;
|
|
9
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess, }: {
|
|
1
|
+
export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess, clientReferenceId, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
recipientAddress: string;
|
|
5
5
|
stakeAmount?: string;
|
|
6
6
|
onSuccess?: () => void;
|
|
7
|
+
clientReferenceId?: string;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, }: {
|
|
1
|
+
export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, clientReferenceId, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
sourceTokenAddress?: string;
|
|
@@ -6,4 +6,5 @@ export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAdd
|
|
|
6
6
|
recipientAddress: string;
|
|
7
7
|
stakeAmount?: string;
|
|
8
8
|
onSuccess?: (amount: string) => void;
|
|
9
|
+
clientReferenceId?: string;
|
|
9
10
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
-
export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, }: {
|
|
2
|
+
export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, clientReferenceId, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
beneficiaryAddress: string;
|
|
@@ -8,4 +8,5 @@ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddres
|
|
|
8
8
|
token: components["schemas"]["Token"];
|
|
9
9
|
onSuccess?: () => void;
|
|
10
10
|
activeTab?: "crypto" | "fiat";
|
|
11
|
+
clientReferenceId?: string;
|
|
11
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
-
export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }: {
|
|
2
|
+
export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, clientReferenceId, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
recipientAddress: string;
|
|
@@ -8,4 +8,5 @@ export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientA
|
|
|
8
8
|
stakingContractAddress: string;
|
|
9
9
|
token: components["schemas"]["Token"];
|
|
10
10
|
onSuccess?: (amount: string) => void;
|
|
11
|
+
clientReferenceId?: string;
|
|
11
12
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -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 {};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|