@ton-pay/api 0.1.2 → 0.2.0-beta.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/index.d.mts +107 -1
- package/dist/index.d.ts +107 -1
- package/dist/index.js +6731 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6727 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -46,6 +46,112 @@ type CreateTonPayTransferResponse = {
|
|
|
46
46
|
*/
|
|
47
47
|
declare const createTonPayTransfer: (params: CreateTonPayTransferParams, options?: APIOptions) => Promise<CreateTonPayTransferResponse>;
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* MoonPay geo location result
|
|
51
|
+
*/
|
|
52
|
+
type MoonpayGeoResult = {
|
|
53
|
+
alpha2: string;
|
|
54
|
+
alpha3: string;
|
|
55
|
+
country: string;
|
|
56
|
+
state: string;
|
|
57
|
+
ipAddress: string;
|
|
58
|
+
isAllowed: boolean;
|
|
59
|
+
isBuyAllowed: boolean;
|
|
60
|
+
isNftAllowed: boolean;
|
|
61
|
+
isSellAllowed: boolean;
|
|
62
|
+
isBalanceLedgerWithdrawAllowed: boolean;
|
|
63
|
+
isFiatBalanceAllowed: boolean;
|
|
64
|
+
isMoonPayBalanceAllowed: boolean;
|
|
65
|
+
isLowLimitEnabled: boolean;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* MoonPay amount limits
|
|
69
|
+
*/
|
|
70
|
+
type MoonpayAmountLimits = {
|
|
71
|
+
paymentMethod: string;
|
|
72
|
+
quoteCurrency: {
|
|
73
|
+
code: string;
|
|
74
|
+
minBuyAmount: number;
|
|
75
|
+
maxBuyAmount: number;
|
|
76
|
+
};
|
|
77
|
+
baseCurrency: {
|
|
78
|
+
code: string;
|
|
79
|
+
minBuyAmount: number;
|
|
80
|
+
maxBuyAmount: number;
|
|
81
|
+
};
|
|
82
|
+
areFeesIncluded: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* @param amount - in human readable format, 10.5 for example
|
|
86
|
+
* @param asset - jetton master address or TON coin address for TON transfer
|
|
87
|
+
* @param recipientAddr - recipient wallet address. Optional if API key is provided - defaults to the merchant's wallet address from the admin panel
|
|
88
|
+
* @param userIp - user's IP address (required for geo verification)
|
|
89
|
+
* @param redirectURL - redirect URL after Moonpay purchase
|
|
90
|
+
*/
|
|
91
|
+
type CreateMoonpayTransferParams = {
|
|
92
|
+
amount: number;
|
|
93
|
+
asset: string;
|
|
94
|
+
recipientAddr?: string;
|
|
95
|
+
userIp: string;
|
|
96
|
+
redirectURL: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* @param link - MoonPay payment link
|
|
100
|
+
* @param geo - MoonPay geo location result
|
|
101
|
+
* @param limits - MoonPay amount limits
|
|
102
|
+
*/
|
|
103
|
+
type CreateMoonpayTransferResponse = {
|
|
104
|
+
link: string;
|
|
105
|
+
geo?: MoonpayGeoResult;
|
|
106
|
+
limits: MoonpayAmountLimits;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Creates a MoonPay payment link for buying crypto
|
|
111
|
+
* @param params - the parameters for the MoonPay transfer
|
|
112
|
+
* @param options - the options for the transfer (requires API key)
|
|
113
|
+
* @returns the payment link, geo restrictions, and amount limits
|
|
114
|
+
*/
|
|
115
|
+
declare const createMoonpayTransfer: (params: CreateMoonpayTransferParams, options: APIOptions) => Promise<CreateMoonpayTransferResponse>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @param ipAddress - IP address to check for geo restrictions
|
|
119
|
+
*/
|
|
120
|
+
type CheckMoonpayGeoParams = {
|
|
121
|
+
ipAddress: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* MoonPay geo check response
|
|
125
|
+
*/
|
|
126
|
+
type CheckMoonpayGeoResponse = MoonpayGeoResult;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Checks MoonPay geo restrictions for an IP address
|
|
130
|
+
* @param params - the IP address to check
|
|
131
|
+
* @param options - optional API options
|
|
132
|
+
* @returns the geo location and restrictions
|
|
133
|
+
*/
|
|
134
|
+
declare const checkMoonpayGeo: (params: CheckMoonpayGeoParams, options?: APIOptions) => Promise<CheckMoonpayGeoResponse>;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @param asset - jetton master address or TON coin address for TON
|
|
138
|
+
*/
|
|
139
|
+
type CheckMoonpayLimitsParams = {
|
|
140
|
+
asset: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* MoonPay limits check response
|
|
144
|
+
*/
|
|
145
|
+
type CheckMoonpayLimitsResponse = MoonpayAmountLimits;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Gets MoonPay amount limits for an asset
|
|
149
|
+
* @param params - the asset to check limits for
|
|
150
|
+
* @param options - optional API options
|
|
151
|
+
* @returns the amount limits for the asset
|
|
152
|
+
*/
|
|
153
|
+
declare const checkMoonpayLimits: (params: CheckMoonpayLimitsParams, options?: APIOptions) => Promise<CheckMoonpayLimitsResponse>;
|
|
154
|
+
|
|
49
155
|
/**
|
|
50
156
|
* @param amount - the amount of the transfer in human readable format
|
|
51
157
|
* @param rawAmount - the amount of the transfer in base units
|
|
@@ -199,4 +305,4 @@ declare const TON = "TON";
|
|
|
199
305
|
*/
|
|
200
306
|
declare function verifySignature(payload: string | object, signature: string, apiSecret: string): boolean;
|
|
201
307
|
|
|
202
|
-
export { type APIOptions, type Chain, type CompletedTonPayTransferInfo, type CreateTonPayTransferParams, type CreateTonPayTransferResponse, type GetTonPayTransferByBodyHashParams, type GetTonPayTransferByReferenceParams, TON, type TransferCompletedWebhookPayload, type TransferRefundedWebhookPayload, USDT, type WebhookEventType, type WebhookPayload, createTonPayTransfer, getTonPayTransferByBodyHash, getTonPayTransferByReference, verifySignature };
|
|
308
|
+
export { type APIOptions, type Chain, type CheckMoonpayGeoParams, type CheckMoonpayGeoResponse, type CheckMoonpayLimitsParams, type CheckMoonpayLimitsResponse, type CompletedTonPayTransferInfo, type CreateMoonpayTransferParams, type CreateMoonpayTransferResponse, type CreateTonPayTransferParams, type CreateTonPayTransferResponse, type GetTonPayTransferByBodyHashParams, type GetTonPayTransferByReferenceParams, type MoonpayAmountLimits, type MoonpayGeoResult, TON, type TransferCompletedWebhookPayload, type TransferRefundedWebhookPayload, USDT, type WebhookEventType, type WebhookPayload, checkMoonpayGeo, checkMoonpayLimits, createMoonpayTransfer, createTonPayTransfer, getTonPayTransferByBodyHash, getTonPayTransferByReference, verifySignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,112 @@ type CreateTonPayTransferResponse = {
|
|
|
46
46
|
*/
|
|
47
47
|
declare const createTonPayTransfer: (params: CreateTonPayTransferParams, options?: APIOptions) => Promise<CreateTonPayTransferResponse>;
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* MoonPay geo location result
|
|
51
|
+
*/
|
|
52
|
+
type MoonpayGeoResult = {
|
|
53
|
+
alpha2: string;
|
|
54
|
+
alpha3: string;
|
|
55
|
+
country: string;
|
|
56
|
+
state: string;
|
|
57
|
+
ipAddress: string;
|
|
58
|
+
isAllowed: boolean;
|
|
59
|
+
isBuyAllowed: boolean;
|
|
60
|
+
isNftAllowed: boolean;
|
|
61
|
+
isSellAllowed: boolean;
|
|
62
|
+
isBalanceLedgerWithdrawAllowed: boolean;
|
|
63
|
+
isFiatBalanceAllowed: boolean;
|
|
64
|
+
isMoonPayBalanceAllowed: boolean;
|
|
65
|
+
isLowLimitEnabled: boolean;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* MoonPay amount limits
|
|
69
|
+
*/
|
|
70
|
+
type MoonpayAmountLimits = {
|
|
71
|
+
paymentMethod: string;
|
|
72
|
+
quoteCurrency: {
|
|
73
|
+
code: string;
|
|
74
|
+
minBuyAmount: number;
|
|
75
|
+
maxBuyAmount: number;
|
|
76
|
+
};
|
|
77
|
+
baseCurrency: {
|
|
78
|
+
code: string;
|
|
79
|
+
minBuyAmount: number;
|
|
80
|
+
maxBuyAmount: number;
|
|
81
|
+
};
|
|
82
|
+
areFeesIncluded: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* @param amount - in human readable format, 10.5 for example
|
|
86
|
+
* @param asset - jetton master address or TON coin address for TON transfer
|
|
87
|
+
* @param recipientAddr - recipient wallet address. Optional if API key is provided - defaults to the merchant's wallet address from the admin panel
|
|
88
|
+
* @param userIp - user's IP address (required for geo verification)
|
|
89
|
+
* @param redirectURL - redirect URL after Moonpay purchase
|
|
90
|
+
*/
|
|
91
|
+
type CreateMoonpayTransferParams = {
|
|
92
|
+
amount: number;
|
|
93
|
+
asset: string;
|
|
94
|
+
recipientAddr?: string;
|
|
95
|
+
userIp: string;
|
|
96
|
+
redirectURL: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* @param link - MoonPay payment link
|
|
100
|
+
* @param geo - MoonPay geo location result
|
|
101
|
+
* @param limits - MoonPay amount limits
|
|
102
|
+
*/
|
|
103
|
+
type CreateMoonpayTransferResponse = {
|
|
104
|
+
link: string;
|
|
105
|
+
geo?: MoonpayGeoResult;
|
|
106
|
+
limits: MoonpayAmountLimits;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Creates a MoonPay payment link for buying crypto
|
|
111
|
+
* @param params - the parameters for the MoonPay transfer
|
|
112
|
+
* @param options - the options for the transfer (requires API key)
|
|
113
|
+
* @returns the payment link, geo restrictions, and amount limits
|
|
114
|
+
*/
|
|
115
|
+
declare const createMoonpayTransfer: (params: CreateMoonpayTransferParams, options: APIOptions) => Promise<CreateMoonpayTransferResponse>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @param ipAddress - IP address to check for geo restrictions
|
|
119
|
+
*/
|
|
120
|
+
type CheckMoonpayGeoParams = {
|
|
121
|
+
ipAddress: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* MoonPay geo check response
|
|
125
|
+
*/
|
|
126
|
+
type CheckMoonpayGeoResponse = MoonpayGeoResult;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Checks MoonPay geo restrictions for an IP address
|
|
130
|
+
* @param params - the IP address to check
|
|
131
|
+
* @param options - optional API options
|
|
132
|
+
* @returns the geo location and restrictions
|
|
133
|
+
*/
|
|
134
|
+
declare const checkMoonpayGeo: (params: CheckMoonpayGeoParams, options?: APIOptions) => Promise<CheckMoonpayGeoResponse>;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @param asset - jetton master address or TON coin address for TON
|
|
138
|
+
*/
|
|
139
|
+
type CheckMoonpayLimitsParams = {
|
|
140
|
+
asset: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* MoonPay limits check response
|
|
144
|
+
*/
|
|
145
|
+
type CheckMoonpayLimitsResponse = MoonpayAmountLimits;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Gets MoonPay amount limits for an asset
|
|
149
|
+
* @param params - the asset to check limits for
|
|
150
|
+
* @param options - optional API options
|
|
151
|
+
* @returns the amount limits for the asset
|
|
152
|
+
*/
|
|
153
|
+
declare const checkMoonpayLimits: (params: CheckMoonpayLimitsParams, options?: APIOptions) => Promise<CheckMoonpayLimitsResponse>;
|
|
154
|
+
|
|
49
155
|
/**
|
|
50
156
|
* @param amount - the amount of the transfer in human readable format
|
|
51
157
|
* @param rawAmount - the amount of the transfer in base units
|
|
@@ -199,4 +305,4 @@ declare const TON = "TON";
|
|
|
199
305
|
*/
|
|
200
306
|
declare function verifySignature(payload: string | object, signature: string, apiSecret: string): boolean;
|
|
201
307
|
|
|
202
|
-
export { type APIOptions, type Chain, type CompletedTonPayTransferInfo, type CreateTonPayTransferParams, type CreateTonPayTransferResponse, type GetTonPayTransferByBodyHashParams, type GetTonPayTransferByReferenceParams, TON, type TransferCompletedWebhookPayload, type TransferRefundedWebhookPayload, USDT, type WebhookEventType, type WebhookPayload, createTonPayTransfer, getTonPayTransferByBodyHash, getTonPayTransferByReference, verifySignature };
|
|
308
|
+
export { type APIOptions, type Chain, type CheckMoonpayGeoParams, type CheckMoonpayGeoResponse, type CheckMoonpayLimitsParams, type CheckMoonpayLimitsResponse, type CompletedTonPayTransferInfo, type CreateMoonpayTransferParams, type CreateMoonpayTransferResponse, type CreateTonPayTransferParams, type CreateTonPayTransferResponse, type GetTonPayTransferByBodyHashParams, type GetTonPayTransferByReferenceParams, type MoonpayAmountLimits, type MoonpayGeoResult, TON, type TransferCompletedWebhookPayload, type TransferRefundedWebhookPayload, USDT, type WebhookEventType, type WebhookPayload, checkMoonpayGeo, checkMoonpayLimits, createMoonpayTransfer, createTonPayTransfer, getTonPayTransferByBodyHash, getTonPayTransferByReference, verifySignature };
|