@funkit/core 0.8.6 → 0.10.0
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/fetch-polyfill.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/src/abis/CheckoutPaymaster.json +1 -0
- package/dist/src/abis/EstimationPaymaster.json +1 -1
- package/dist/src/abis/UniswapV3LimitOrder.json +1 -1
- package/dist/src/actions/AccessControl.d.ts +6 -6
- package/dist/src/actions/AccessControl.js +23 -16
- package/dist/src/actions/AccessControl.js.map +1 -1
- package/dist/src/actions/BatchActions.d.ts +2 -2
- package/dist/src/actions/BatchActions.js +2 -2
- package/dist/src/actions/BatchActions.js.map +1 -1
- package/dist/src/actions/Bridge.d.ts +5 -4
- package/dist/src/actions/Bridge.js +13 -9
- package/dist/src/actions/Bridge.js.map +1 -1
- package/dist/src/actions/FirstClassActions.d.ts +8 -6
- package/dist/src/actions/FirstClassActions.js +44 -69
- package/dist/src/actions/FirstClassActions.js.map +1 -1
- package/dist/src/actions/Group.d.ts +3 -3
- package/dist/src/actions/Group.js +6 -14
- package/dist/src/actions/Group.js.map +1 -1
- package/dist/src/actions/LimitOrder.d.ts +4 -4
- package/dist/src/actions/LimitOrder.js +21 -19
- package/dist/src/actions/LimitOrder.js.map +1 -1
- package/dist/src/actions/Stake.d.ts +3 -3
- package/dist/src/actions/Stake.js +31 -44
- package/dist/src/actions/Stake.js.map +1 -1
- package/dist/src/actions/Swap.d.ts +4 -4
- package/dist/src/actions/Swap.js +43 -41
- package/dist/src/actions/Swap.js.map +1 -1
- package/dist/src/actions/Token.d.ts +6 -6
- package/dist/src/actions/Token.js +46 -33
- package/dist/src/actions/Token.js.map +1 -1
- package/dist/src/actions/index.d.ts +7 -7
- package/dist/src/actions/types.d.ts +4 -4
- package/dist/src/actions/types.js +2 -2
- package/dist/src/actions/types.js.map +1 -1
- package/dist/src/apis/AccessControlApis.d.ts +1 -1
- package/dist/src/apis/AccessControlApis.js +7 -3
- package/dist/src/apis/AccessControlApis.js.map +1 -1
- package/dist/src/apis/AssetApis.d.ts +10 -0
- package/dist/src/apis/AssetApis.js +11 -1
- package/dist/src/apis/AssetApis.js.map +1 -1
- package/dist/src/apis/BridgeApis.d.ts +1 -1
- package/dist/src/apis/BridgeApis.js +13 -13
- package/dist/src/apis/BridgeApis.js.map +1 -1
- package/dist/src/apis/CheckoutApis.d.ts +43 -0
- package/dist/src/apis/CheckoutApis.js +116 -0
- package/dist/src/apis/CheckoutApis.js.map +1 -0
- package/dist/src/apis/ContractApis.js +1 -1
- package/dist/src/apis/ContractApis.js.map +1 -1
- package/dist/src/apis/FaucetApis.js.map +1 -1
- package/dist/src/apis/GroupApis.d.ts +2 -6
- package/dist/src/apis/GroupApis.js +4 -29
- package/dist/src/apis/GroupApis.js.map +1 -1
- package/dist/src/apis/InfoApis.d.ts +1 -1
- package/dist/src/apis/InfoApis.js +9 -7
- package/dist/src/apis/InfoApis.js.map +1 -1
- package/dist/src/apis/ListenerApis.d.ts +1 -1
- package/dist/src/apis/ListenerApis.js +6 -6
- package/dist/src/apis/ListenerApis.js.map +1 -1
- package/dist/src/apis/MeshApis.d.ts +87 -0
- package/dist/src/apis/MeshApis.js +213 -0
- package/dist/src/apis/MeshApis.js.map +1 -0
- package/dist/src/apis/NFTApis.js.map +1 -1
- package/dist/src/apis/OnOffRampApis.d.ts +2 -0
- package/dist/src/apis/OnOffRampApis.js +24 -5
- package/dist/src/apis/OnOffRampApis.js.map +1 -1
- package/dist/src/apis/OnOffRampUtils.js +2 -2
- package/dist/src/apis/OnOffRampUtils.js.map +1 -1
- package/dist/src/apis/OperationApis.d.ts +4 -4
- package/dist/src/apis/OperationApis.js +21 -12
- package/dist/src/apis/OperationApis.js.map +1 -1
- package/dist/src/apis/PaymasterApis.d.ts +1 -6
- package/dist/src/apis/PaymasterApis.js +3 -70
- package/dist/src/apis/PaymasterApis.js.map +1 -1
- package/dist/src/apis/SwapApis.d.ts +2 -2
- package/dist/src/apis/SwapApis.js +6 -6
- package/dist/src/apis/SwapApis.js.map +1 -1
- package/dist/src/apis/TurnkeyApis.d.ts +3 -0
- package/dist/src/apis/TurnkeyApis.js +19 -0
- package/dist/src/apis/TurnkeyApis.js.map +1 -0
- package/dist/src/apis/UserApis.d.ts +2 -5
- package/dist/src/apis/UserApis.js +11 -22
- package/dist/src/apis/UserApis.js.map +1 -1
- package/dist/src/apis/index.d.ts +13 -10
- package/dist/src/apis/index.js +4 -1
- package/dist/src/apis/index.js.map +1 -1
- package/dist/src/apis/types.d.ts +79 -7
- package/dist/src/apis/types.js +16 -0
- package/dist/src/apis/types.js.map +1 -1
- package/dist/src/auth/Auth.d.ts +6 -6
- package/dist/src/auth/Auth.js +48 -46
- package/dist/src/auth/Auth.js.map +1 -1
- package/dist/src/auth/SessionKeyAuth.d.ts +5 -5
- package/dist/src/auth/SessionKeyAuth.js +29 -24
- package/dist/src/auth/SessionKeyAuth.js.map +1 -1
- package/dist/src/auth/index.d.ts +2 -2
- package/dist/src/auth/types.d.ts +1 -1
- package/dist/src/common/constants.d.ts +111 -17
- package/dist/src/common/constants.js +158 -85
- package/dist/src/common/constants.js.map +1 -1
- package/dist/src/common/index.d.ts +2 -2
- package/dist/src/common/types.d.ts +2 -2
- package/dist/src/config/Config.d.ts +1 -1
- package/dist/src/config/Config.js +10 -4
- package/dist/src/config/Config.js.map +1 -1
- package/dist/src/config/index.d.ts +2 -2
- package/dist/src/config/types.d.ts +4 -2
- package/dist/src/data/Chain.d.ts +4 -4
- package/dist/src/data/Chain.js +38 -27
- package/dist/src/data/Chain.js.map +1 -1
- package/dist/src/data/NFT.d.ts +3 -3
- package/dist/src/data/NFT.js +11 -11
- package/dist/src/data/NFT.js.map +1 -1
- package/dist/src/data/Operation.d.ts +5 -5
- package/dist/src/data/Operation.js +12 -10
- package/dist/src/data/Operation.js.map +1 -1
- package/dist/src/data/SolidityData.d.ts +3 -3
- package/dist/src/data/SolidityData.js +37 -17
- package/dist/src/data/SolidityData.js.map +1 -1
- package/dist/src/data/Token.d.ts +21 -20
- package/dist/src/data/Token.js +49 -51
- package/dist/src/data/Token.js.map +1 -1
- package/dist/src/data/index.d.ts +6 -6
- package/dist/src/data/index.js +2 -2
- package/dist/src/data/index.js.map +1 -1
- package/dist/src/data/types.d.ts +2 -2
- package/dist/src/data/types.js +3 -3
- package/dist/src/data/types.js.map +1 -1
- package/dist/src/errors/BaseError.js +4 -3
- package/dist/src/errors/BaseError.js.map +1 -1
- package/dist/src/errors/ClientError.d.ts +1 -1
- package/dist/src/errors/ClientError.js +3 -3
- package/dist/src/errors/ClientError.js.map +1 -1
- package/dist/src/errors/ServerError.d.ts +1 -1
- package/dist/src/errors/ServerError.js.map +1 -1
- package/dist/src/errors/index.d.ts +4 -4
- package/dist/src/errors/types.d.ts +2 -1
- package/dist/src/errors/types.js +4 -3
- package/dist/src/errors/types.js.map +1 -1
- package/dist/src/sponsors/CheckoutSponsor.d.ts +23 -0
- package/dist/src/sponsors/CheckoutSponsor.js +65 -0
- package/dist/src/sponsors/CheckoutSponsor.js.map +1 -0
- package/dist/src/sponsors/GaslessSponsor.d.ts +6 -6
- package/dist/src/sponsors/GaslessSponsor.js +20 -32
- package/dist/src/sponsors/GaslessSponsor.js.map +1 -1
- package/dist/src/sponsors/Sponsor.d.ts +15 -15
- package/dist/src/sponsors/Sponsor.js +24 -40
- package/dist/src/sponsors/Sponsor.js.map +1 -1
- package/dist/src/sponsors/TokenSponsor.d.ts +15 -15
- package/dist/src/sponsors/TokenSponsor.js +118 -135
- package/dist/src/sponsors/TokenSponsor.js.map +1 -1
- package/dist/src/sponsors/index.d.ts +4 -3
- package/dist/src/sponsors/index.js +2 -1
- package/dist/src/sponsors/index.js.map +1 -1
- package/dist/src/sponsors/types.d.ts +2 -1
- package/dist/src/sponsors/types.js +2 -1
- package/dist/src/sponsors/types.js.map +1 -1
- package/dist/src/utils/ApiUtils.js +21 -19
- package/dist/src/utils/ApiUtils.js.map +1 -1
- package/dist/src/utils/AuthUtils.d.ts +1 -2
- package/dist/src/utils/AuthUtils.js +7 -25
- package/dist/src/utils/AuthUtils.js.map +1 -1
- package/dist/src/utils/ChainUtils.d.ts +5 -5
- package/dist/src/utils/ChainUtils.js +35 -20
- package/dist/src/utils/ChainUtils.js.map +1 -1
- package/dist/src/utils/CheckoutUtils.d.ts +6 -0
- package/dist/src/utils/CheckoutUtils.js +24 -0
- package/dist/src/utils/CheckoutUtils.js.map +1 -0
- package/dist/src/utils/GroupUtils.d.ts +4 -0
- package/dist/src/utils/GroupUtils.js +30 -0
- package/dist/src/utils/GroupUtils.js.map +1 -0
- package/dist/src/utils/MerkleUtils.d.ts +1 -1
- package/dist/src/utils/MerkleUtils.js +5 -5
- package/dist/src/utils/MerkleUtils.js.map +1 -1
- package/dist/src/utils/PaymasterUtils.d.ts +3 -3
- package/dist/src/utils/PaymasterUtils.js +6 -2
- package/dist/src/utils/PaymasterUtils.js.map +1 -1
- package/dist/src/utils/SwapUtils.d.ts +2 -2
- package/dist/src/utils/SwapUtils.js +43 -34
- package/dist/src/utils/SwapUtils.js.map +1 -1
- package/dist/src/utils/TypeUtils.js.map +1 -1
- package/dist/src/utils/UserOpUtils.d.ts +2 -2
- package/dist/src/utils/UserOpUtils.js +79 -65
- package/dist/src/utils/UserOpUtils.js.map +1 -1
- package/dist/src/utils/ViemUtils.d.ts +2 -2
- package/dist/src/utils/ViemUtils.js +10 -6
- package/dist/src/utils/ViemUtils.js.map +1 -1
- package/dist/src/utils/WalletUtils.d.ts +2 -2
- package/dist/src/utils/WalletUtils.js +6 -5
- package/dist/src/utils/WalletUtils.js.map +1 -1
- package/dist/src/utils/index.d.ts +8 -7
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/viem/ContractInterface.d.ts +4 -4
- package/dist/src/viem/ContractInterface.js +8 -8
- package/dist/src/viem/ContractInterface.js.map +1 -1
- package/dist/src/viem/Converter.d.ts +823 -1107
- package/dist/src/viem/Converter.js +13 -11
- package/dist/src/viem/Converter.js.map +1 -1
- package/dist/src/viem/index.d.ts +2 -2
- package/dist/src/wallet/FunWallet.d.ts +8 -8
- package/dist/src/wallet/FunWallet.js +141 -97
- package/dist/src/wallet/FunWallet.js.map +1 -1
- package/dist/src/wallet/index.d.ts +2 -2
- package/dist/src/wallet/types.d.ts +1 -1
- package/package.json +15 -8
|
@@ -8,13 +8,13 @@ async function createListener(walletAddresses, chains, webhookUrl) {
|
|
|
8
8
|
const body = {
|
|
9
9
|
walletAddresses,
|
|
10
10
|
chains,
|
|
11
|
-
webhookUrl
|
|
11
|
+
webhookUrl,
|
|
12
12
|
};
|
|
13
|
-
const result = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
13
|
+
const result = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'listeners/', body).then((r) => {
|
|
14
14
|
return r;
|
|
15
15
|
});
|
|
16
16
|
if (!result) {
|
|
17
|
-
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError,
|
|
17
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'Listener call failed.', { walletAddresses, chains, webhookUrl }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
18
18
|
}
|
|
19
19
|
return result;
|
|
20
20
|
}
|
|
@@ -22,13 +22,13 @@ exports.createListener = createListener;
|
|
|
22
22
|
async function deleteListener(walletAddress, chain) {
|
|
23
23
|
const body = {
|
|
24
24
|
walletAddress,
|
|
25
|
-
chain
|
|
25
|
+
chain,
|
|
26
26
|
};
|
|
27
|
-
const result = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
27
|
+
const result = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'listeners/delete', body).then((r) => {
|
|
28
28
|
return r;
|
|
29
29
|
});
|
|
30
30
|
if (!result) {
|
|
31
|
-
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError,
|
|
31
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'Listener call failed.', { walletAddress, chain }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
32
32
|
}
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListenerApis.js","sourceRoot":"","sources":["../../../src/apis/ListenerApis.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ListenerApis.js","sourceRoot":"","sources":["../../../src/apis/ListenerApis.ts"],"names":[],"mappings":";;;AAEA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAmD;AAE5C,KAAK,UAAU,cAAc,CAClC,eAA0B,EAC1B,MAAgB,EAChB,UAAkB;IAElB,MAAM,IAAI,GAAG;QACX,eAAe;QACf,MAAM;QACN,UAAU;KACX,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,CACpE,CAAC,CAAC,EAAE,EAAE;QACJ,OAAO,CAAC,CAAA;IACV,CAAC,CACF,CAAA;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,uBAAuB,EACvB,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,EACvC,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAzBD,wCAyBC;AAEM,KAAK,UAAU,cAAc,CAClC,aAAsB,EACtB,KAAa;IAEb,MAAM,IAAI,GAAG;QACX,aAAa;QACb,KAAK;KACN,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC,IAAI,CAC1E,CAAC,CAAC,EAAE,EAAE;QACJ,OAAO,CAAC,CAAA;IACV,CAAC,CACF,CAAA;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,uBAAuB,EACvB,EAAE,aAAa,EAAE,KAAK,EAAE,EACxB,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAvBD,wCAuBC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { MeshOrderSide } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @param authToken The authentication token to send the asset from.
|
|
4
|
+
* @param type The type of the integration to send the asset from.
|
|
5
|
+
* @return https://docs.meshconnect.com/reference/post_api-v1-balance-get
|
|
6
|
+
*/
|
|
7
|
+
export declare function meshGetHoldings(authToken: string, type: string, apiKey?: string): Promise<any>;
|
|
8
|
+
/**
|
|
9
|
+
* @param authToken The authentication token to send the asset from.
|
|
10
|
+
* @param type The type of the integration to send the asset from.
|
|
11
|
+
* @return https://docs.meshconnect.com/reference/post_api-v1-holdings-get
|
|
12
|
+
*/
|
|
13
|
+
export declare function meshGetCryptocurrencyHoldings(authToken: string, type: string, apiKey?: string): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* @return https://docs.meshconnect.com/reference/get_api-v1-transfers-managed-integrations
|
|
16
|
+
*/
|
|
17
|
+
export declare function meshGetTransferIntegrations(apiKey?: string): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* @param userId A unique Id representing the end user. Typically this will be a user Id from the
|
|
20
|
+
client application. Personally identifiable information, such as an email address or phone number,
|
|
21
|
+
should not be used. 50 characters length maximum.
|
|
22
|
+
* @param integrationId A unique identifier representing a specific integration obtained from the list of available integrations.
|
|
23
|
+
* @param restrictMultipleAccounts The final screen of Link allows users to “continue” back to your app or “Link another account.”
|
|
24
|
+
If this param is present then this button will be hidden.
|
|
25
|
+
* @param transferOptions Encapsulates transaction-related parameters, including destination addresses and the amount to transfer in fiat currency.
|
|
26
|
+
* @return https://docs.meshconnect.com/reference/post_api-v1-linktoken
|
|
27
|
+
*/
|
|
28
|
+
export declare function meshGetLinkToken(userId: string, integrationId?: string | null, restrictMultipleAccounts?: boolean, transferOptions?: any | null, apiKey?: string): Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
* @param fromAuthToken The authentication token to send the asset from.
|
|
31
|
+
* @param fromType The type of the integration to send the asset from.
|
|
32
|
+
* @param toAuthToken The authentication token of the target integration. Can be used alternatively to the address in the ToAddress field. If used, toType should also be provided.
|
|
33
|
+
* @param toType The type of the target integration to send assets to. Used along with the toAuthToken alternatively to ToAddress.
|
|
34
|
+
* @param networkId The network to send the asset over. This is generated by Mesh, it isn't a chainId or chain name.
|
|
35
|
+
* @param symbol The symbol of the digital asset to send.
|
|
36
|
+
* @param toAddress The target address to send the asset to.
|
|
37
|
+
* @param amount The amount to send, in crypto.
|
|
38
|
+
* @param amountInFiat The amount to send, in fiat currency. Can be used alternatively to Amount.
|
|
39
|
+
* @param fiatCurrency Fiat currency that is to get corresponding converted fiat values of transfer and fee amounts. If not provided, defaults to USD.
|
|
40
|
+
* @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-preview
|
|
41
|
+
*/
|
|
42
|
+
export declare function meshPreviewTransfer(fromAuthToken: string, fromType: string, toAuthToken?: string | null, toType?: string | null, networkId?: string, symbol?: string | null, toAddress?: string | null, amount?: string | null, amountInFiat?: string | null, fiatCurrency?: string | null, apiKey?: string): Promise<any>;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param fromAuthToken The authentication token to send the asset from.
|
|
46
|
+
* @param fromType The type of the integration to send the asset from.
|
|
47
|
+
* @param previewId The preview ID of the transfer to execute.
|
|
48
|
+
* @param mfaCode Multi-factor auth code that should be provided if the status of the transfer was MfaRequired.
|
|
49
|
+
* @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute
|
|
50
|
+
*/
|
|
51
|
+
export declare function meshExecuteTransfer(fromAuthToken: string, fromType: string, previewId: string, mfaCode?: string | null, apiKey?: string): Promise<any>;
|
|
52
|
+
/**
|
|
53
|
+
* @param side {buy, sell}
|
|
54
|
+
* @param authToken The authentication token to use for the preview.
|
|
55
|
+
* @param type The type of the integration to use for the preview.
|
|
56
|
+
* @param symbol Symbol to trade. For example, AAPL or ETH
|
|
57
|
+
* @param paymentSymbol Symbol to use for payment, defaults to USD.
|
|
58
|
+
* @param amount Amount of purchase.
|
|
59
|
+
* @param price Price of the unit, used for Limit and StopLoss orders.
|
|
60
|
+
* @param isCryptocurrency Some Stock and Crypto symbols can intersect, so the type of the asset needs to be specified explicitly.
|
|
61
|
+
* @param paymentIsCryptoCurrency Indicates whether the PaymentSymbol is fiat or cryptocurrency
|
|
62
|
+
* @param amountIsInPaymentSymbol This value indicates if the order should be executed in payment/quote currency amount (e.g. purchase ETH for $10). This can be performed only if the current institution supports such orders (SupportsPlacingSellOrdersInPaymentSymbolAmount and SupportsPlacingBuyOrdersInPaymentSymbolAmount fields in get supported order features for institution) and AmountInPaymentSymbol value is passed.
|
|
63
|
+
* @param extendedHours Specifies if the extended trading hours should be used.
|
|
64
|
+
* @param orderType {market, limit, stopLoss}
|
|
65
|
+
* @param timeInForce {goodTillCancel, immediateOrCancel, fillOrKill, goodForDay, postOnly, unknown}
|
|
66
|
+
* @param mfaCode MFA Code to create an order (requested by Kraken if MFA is enabled in user settings)
|
|
67
|
+
* @returns https://docs.meshconnect.com/reference/post_api-v1-transactions-preview-side
|
|
68
|
+
*/
|
|
69
|
+
export declare function meshPreviewOrder(side: MeshOrderSide, authToken: string, type: string, symbol: string, paymentSymbol: string, amount: string, isCryptocurrency: string, paymentIsCryptoCurrency: string, orderType: string, timeInForce: string, price?: string, amountIsInPaymentSymbol?: string | null, extendedHours?: boolean, mfaCode?: string | null, apiKey?: string): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* @param side {buy, sell}
|
|
72
|
+
* @param authToken The authentication token to use for the preview.
|
|
73
|
+
* @param type The type of the integration to use for the preview.
|
|
74
|
+
* @param symbol Symbol to trade. For example, AAPL or ETH
|
|
75
|
+
* @param paymentSymbol Symbol to use for payment, defaults to USD.
|
|
76
|
+
* @param amount Amount of purchase.
|
|
77
|
+
* @param price Price of the unit, used for Limit and StopLoss orders.
|
|
78
|
+
* @param isCryptocurrency Some Stock and Crypto symbols can intersect, so the type of the asset needs to be specified explicitly.
|
|
79
|
+
* @param paymentIsCryptoCurrency Indicates whether the PaymentSymbol is fiat or cryptocurrency
|
|
80
|
+
* @param amountIsInPaymentSymbol This value indicates if the order should be executed in payment/quote currency amount (e.g. purchase ETH for $10). This can be performed only if the current institution supports such orders (SupportsPlacingSellOrdersInPaymentSymbolAmount and SupportsPlacingBuyOrdersInPaymentSymbolAmount fields in get supported order features for institution) and AmountInPaymentSymbol value is passed.
|
|
81
|
+
* @param extendedHours Specifies if the extended trading hours should be used.
|
|
82
|
+
* @param orderType {market, limit, stopLoss}
|
|
83
|
+
* @param timeInForce {goodTillCancel, immediateOrCancel, fillOrKill, goodForDay, postOnly, unknown}
|
|
84
|
+
* @param mfaCode MFA Code to create an order (requested by Kraken if MFA is enabled in user settings)
|
|
85
|
+
* @returns https://docs.meshconnect.com/reference/post_api-v1-transactions-side
|
|
86
|
+
*/
|
|
87
|
+
export declare function meshExecuteOrder(side: MeshOrderSide, authToken: string, type: string, symbol: string, paymentSymbol: string, amount: string, isCryptocurrency: string, paymentIsCryptoCurrency: string, orderType: string, timeInForce: string, price?: string, amountIsInPaymentSymbol?: string | null, extendedHours?: boolean, mfaCode?: string | null, apiKey?: string): Promise<any>;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.meshExecuteOrder = exports.meshPreviewOrder = exports.meshExecuteTransfer = exports.meshPreviewTransfer = exports.meshGetLinkToken = exports.meshGetTransferIntegrations = exports.meshGetCryptocurrencyHoldings = exports.meshGetHoldings = void 0;
|
|
4
|
+
const constants_1 = require("../common/constants");
|
|
5
|
+
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
6
|
+
/**
|
|
7
|
+
* @param authToken The authentication token to send the asset from.
|
|
8
|
+
* @param type The type of the integration to send the asset from.
|
|
9
|
+
* @return https://docs.meshconnect.com/reference/post_api-v1-balance-get
|
|
10
|
+
*/
|
|
11
|
+
async function meshGetHoldings(authToken, type, apiKey) {
|
|
12
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/balance/get', { authToken, type }, apiKey);
|
|
13
|
+
return res;
|
|
14
|
+
}
|
|
15
|
+
exports.meshGetHoldings = meshGetHoldings;
|
|
16
|
+
/**
|
|
17
|
+
* @param authToken The authentication token to send the asset from.
|
|
18
|
+
* @param type The type of the integration to send the asset from.
|
|
19
|
+
* @return https://docs.meshconnect.com/reference/post_api-v1-holdings-get
|
|
20
|
+
*/
|
|
21
|
+
async function meshGetCryptocurrencyHoldings(authToken, type, apiKey) {
|
|
22
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/holdings/get', { authToken, type }, apiKey);
|
|
23
|
+
return res;
|
|
24
|
+
}
|
|
25
|
+
exports.meshGetCryptocurrencyHoldings = meshGetCryptocurrencyHoldings;
|
|
26
|
+
/**
|
|
27
|
+
* @return https://docs.meshconnect.com/reference/get_api-v1-transfers-managed-integrations
|
|
28
|
+
*/
|
|
29
|
+
async function meshGetTransferIntegrations(apiKey) {
|
|
30
|
+
const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, 'mesh/transfers/managed/integrations', apiKey);
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
33
|
+
exports.meshGetTransferIntegrations = meshGetTransferIntegrations;
|
|
34
|
+
/**
|
|
35
|
+
* @param userId A unique Id representing the end user. Typically this will be a user Id from the
|
|
36
|
+
client application. Personally identifiable information, such as an email address or phone number,
|
|
37
|
+
should not be used. 50 characters length maximum.
|
|
38
|
+
* @param integrationId A unique identifier representing a specific integration obtained from the list of available integrations.
|
|
39
|
+
* @param restrictMultipleAccounts The final screen of Link allows users to “continue” back to your app or “Link another account.”
|
|
40
|
+
If this param is present then this button will be hidden.
|
|
41
|
+
* @param transferOptions Encapsulates transaction-related parameters, including destination addresses and the amount to transfer in fiat currency.
|
|
42
|
+
* @return https://docs.meshconnect.com/reference/post_api-v1-linktoken
|
|
43
|
+
*/
|
|
44
|
+
async function meshGetLinkToken(userId, integrationId, restrictMultipleAccounts, transferOptions, apiKey) {
|
|
45
|
+
let body = { userId };
|
|
46
|
+
if (integrationId) {
|
|
47
|
+
body = { ...body, integrationId };
|
|
48
|
+
}
|
|
49
|
+
if (restrictMultipleAccounts) {
|
|
50
|
+
body = { ...body, restrictMultipleAccounts };
|
|
51
|
+
}
|
|
52
|
+
if (transferOptions) {
|
|
53
|
+
body = { ...body, transferOptions };
|
|
54
|
+
}
|
|
55
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/linktoken', body, apiKey);
|
|
56
|
+
return res;
|
|
57
|
+
}
|
|
58
|
+
exports.meshGetLinkToken = meshGetLinkToken;
|
|
59
|
+
/**
|
|
60
|
+
* @param fromAuthToken The authentication token to send the asset from.
|
|
61
|
+
* @param fromType The type of the integration to send the asset from.
|
|
62
|
+
* @param toAuthToken The authentication token of the target integration. Can be used alternatively to the address in the ToAddress field. If used, toType should also be provided.
|
|
63
|
+
* @param toType The type of the target integration to send assets to. Used along with the toAuthToken alternatively to ToAddress.
|
|
64
|
+
* @param networkId The network to send the asset over. This is generated by Mesh, it isn't a chainId or chain name.
|
|
65
|
+
* @param symbol The symbol of the digital asset to send.
|
|
66
|
+
* @param toAddress The target address to send the asset to.
|
|
67
|
+
* @param amount The amount to send, in crypto.
|
|
68
|
+
* @param amountInFiat The amount to send, in fiat currency. Can be used alternatively to Amount.
|
|
69
|
+
* @param fiatCurrency Fiat currency that is to get corresponding converted fiat values of transfer and fee amounts. If not provided, defaults to USD.
|
|
70
|
+
* @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-preview
|
|
71
|
+
*/
|
|
72
|
+
async function meshPreviewTransfer(fromAuthToken, fromType, toAuthToken, toType, networkId, symbol, toAddress, amount, amountInFiat, fiatCurrency, apiKey) {
|
|
73
|
+
let body = { fromAuthToken, fromType };
|
|
74
|
+
if (toAuthToken) {
|
|
75
|
+
body = { ...body, toAuthToken };
|
|
76
|
+
}
|
|
77
|
+
if (toType) {
|
|
78
|
+
body = { ...body, toType };
|
|
79
|
+
}
|
|
80
|
+
if (networkId) {
|
|
81
|
+
body = { ...body, networkId };
|
|
82
|
+
}
|
|
83
|
+
if (symbol) {
|
|
84
|
+
body = { ...body, symbol };
|
|
85
|
+
}
|
|
86
|
+
if (toAddress) {
|
|
87
|
+
body = { ...body, toAddress };
|
|
88
|
+
}
|
|
89
|
+
if (amount) {
|
|
90
|
+
body = { ...body, amount };
|
|
91
|
+
}
|
|
92
|
+
if (amountInFiat) {
|
|
93
|
+
body = { ...body, amountInFiat };
|
|
94
|
+
}
|
|
95
|
+
if (fiatCurrency) {
|
|
96
|
+
body = { ...body, fiatCurrency };
|
|
97
|
+
}
|
|
98
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/transfers/managed/preview', body, apiKey);
|
|
99
|
+
console.log('Preview transfer res', res);
|
|
100
|
+
return res;
|
|
101
|
+
}
|
|
102
|
+
exports.meshPreviewTransfer = meshPreviewTransfer;
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @param fromAuthToken The authentication token to send the asset from.
|
|
106
|
+
* @param fromType The type of the integration to send the asset from.
|
|
107
|
+
* @param previewId The preview ID of the transfer to execute.
|
|
108
|
+
* @param mfaCode Multi-factor auth code that should be provided if the status of the transfer was MfaRequired.
|
|
109
|
+
* @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute
|
|
110
|
+
*/
|
|
111
|
+
async function meshExecuteTransfer(fromAuthToken, fromType, previewId, mfaCode, apiKey) {
|
|
112
|
+
let body = { fromAuthToken, fromType, previewId };
|
|
113
|
+
if (mfaCode) {
|
|
114
|
+
body = { ...body, mfaCode };
|
|
115
|
+
}
|
|
116
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/transfers/managed/execute', body, apiKey);
|
|
117
|
+
console.log(res);
|
|
118
|
+
return res;
|
|
119
|
+
}
|
|
120
|
+
exports.meshExecuteTransfer = meshExecuteTransfer;
|
|
121
|
+
/**
|
|
122
|
+
* @param side {buy, sell}
|
|
123
|
+
* @param authToken The authentication token to use for the preview.
|
|
124
|
+
* @param type The type of the integration to use for the preview.
|
|
125
|
+
* @param symbol Symbol to trade. For example, AAPL or ETH
|
|
126
|
+
* @param paymentSymbol Symbol to use for payment, defaults to USD.
|
|
127
|
+
* @param amount Amount of purchase.
|
|
128
|
+
* @param price Price of the unit, used for Limit and StopLoss orders.
|
|
129
|
+
* @param isCryptocurrency Some Stock and Crypto symbols can intersect, so the type of the asset needs to be specified explicitly.
|
|
130
|
+
* @param paymentIsCryptoCurrency Indicates whether the PaymentSymbol is fiat or cryptocurrency
|
|
131
|
+
* @param amountIsInPaymentSymbol This value indicates if the order should be executed in payment/quote currency amount (e.g. purchase ETH for $10). This can be performed only if the current institution supports such orders (SupportsPlacingSellOrdersInPaymentSymbolAmount and SupportsPlacingBuyOrdersInPaymentSymbolAmount fields in get supported order features for institution) and AmountInPaymentSymbol value is passed.
|
|
132
|
+
* @param extendedHours Specifies if the extended trading hours should be used.
|
|
133
|
+
* @param orderType {market, limit, stopLoss}
|
|
134
|
+
* @param timeInForce {goodTillCancel, immediateOrCancel, fillOrKill, goodForDay, postOnly, unknown}
|
|
135
|
+
* @param mfaCode MFA Code to create an order (requested by Kraken if MFA is enabled in user settings)
|
|
136
|
+
* @returns https://docs.meshconnect.com/reference/post_api-v1-transactions-preview-side
|
|
137
|
+
*/
|
|
138
|
+
async function meshPreviewOrder(side, authToken, type, symbol, paymentSymbol, amount, isCryptocurrency, paymentIsCryptoCurrency, orderType, timeInForce, price, amountIsInPaymentSymbol, extendedHours, mfaCode, apiKey) {
|
|
139
|
+
let body = {
|
|
140
|
+
side,
|
|
141
|
+
authToken,
|
|
142
|
+
type,
|
|
143
|
+
symbol,
|
|
144
|
+
paymentSymbol,
|
|
145
|
+
amount,
|
|
146
|
+
isCryptocurrency,
|
|
147
|
+
paymentIsCryptoCurrency,
|
|
148
|
+
orderType,
|
|
149
|
+
timeInForce,
|
|
150
|
+
};
|
|
151
|
+
if (price) {
|
|
152
|
+
body = { ...body, price };
|
|
153
|
+
}
|
|
154
|
+
if (amountIsInPaymentSymbol) {
|
|
155
|
+
body = { ...body, amountIsInPaymentSymbol };
|
|
156
|
+
}
|
|
157
|
+
if (extendedHours) {
|
|
158
|
+
body = { ...body, extendedHours };
|
|
159
|
+
}
|
|
160
|
+
if (mfaCode) {
|
|
161
|
+
body = { ...body, mfaCode };
|
|
162
|
+
}
|
|
163
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/transactions/preview', body, apiKey);
|
|
164
|
+
return res;
|
|
165
|
+
}
|
|
166
|
+
exports.meshPreviewOrder = meshPreviewOrder;
|
|
167
|
+
/**
|
|
168
|
+
* @param side {buy, sell}
|
|
169
|
+
* @param authToken The authentication token to use for the preview.
|
|
170
|
+
* @param type The type of the integration to use for the preview.
|
|
171
|
+
* @param symbol Symbol to trade. For example, AAPL or ETH
|
|
172
|
+
* @param paymentSymbol Symbol to use for payment, defaults to USD.
|
|
173
|
+
* @param amount Amount of purchase.
|
|
174
|
+
* @param price Price of the unit, used for Limit and StopLoss orders.
|
|
175
|
+
* @param isCryptocurrency Some Stock and Crypto symbols can intersect, so the type of the asset needs to be specified explicitly.
|
|
176
|
+
* @param paymentIsCryptoCurrency Indicates whether the PaymentSymbol is fiat or cryptocurrency
|
|
177
|
+
* @param amountIsInPaymentSymbol This value indicates if the order should be executed in payment/quote currency amount (e.g. purchase ETH for $10). This can be performed only if the current institution supports such orders (SupportsPlacingSellOrdersInPaymentSymbolAmount and SupportsPlacingBuyOrdersInPaymentSymbolAmount fields in get supported order features for institution) and AmountInPaymentSymbol value is passed.
|
|
178
|
+
* @param extendedHours Specifies if the extended trading hours should be used.
|
|
179
|
+
* @param orderType {market, limit, stopLoss}
|
|
180
|
+
* @param timeInForce {goodTillCancel, immediateOrCancel, fillOrKill, goodForDay, postOnly, unknown}
|
|
181
|
+
* @param mfaCode MFA Code to create an order (requested by Kraken if MFA is enabled in user settings)
|
|
182
|
+
* @returns https://docs.meshconnect.com/reference/post_api-v1-transactions-side
|
|
183
|
+
*/
|
|
184
|
+
async function meshExecuteOrder(side, authToken, type, symbol, paymentSymbol, amount, isCryptocurrency, paymentIsCryptoCurrency, orderType, timeInForce, price, amountIsInPaymentSymbol, extendedHours, mfaCode, apiKey) {
|
|
185
|
+
let body = {
|
|
186
|
+
side,
|
|
187
|
+
authToken,
|
|
188
|
+
type,
|
|
189
|
+
symbol,
|
|
190
|
+
paymentSymbol,
|
|
191
|
+
amount,
|
|
192
|
+
isCryptocurrency,
|
|
193
|
+
paymentIsCryptoCurrency,
|
|
194
|
+
orderType,
|
|
195
|
+
timeInForce,
|
|
196
|
+
};
|
|
197
|
+
if (price) {
|
|
198
|
+
body = { ...body, price };
|
|
199
|
+
}
|
|
200
|
+
if (amountIsInPaymentSymbol) {
|
|
201
|
+
body = { ...body, amountIsInPaymentSymbol };
|
|
202
|
+
}
|
|
203
|
+
if (extendedHours) {
|
|
204
|
+
body = { ...body, extendedHours };
|
|
205
|
+
}
|
|
206
|
+
if (mfaCode) {
|
|
207
|
+
body = { ...body, mfaCode };
|
|
208
|
+
}
|
|
209
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'mesh/transactions', body, apiKey);
|
|
210
|
+
return res;
|
|
211
|
+
}
|
|
212
|
+
exports.meshExecuteOrder = meshExecuteOrder;
|
|
213
|
+
//# sourceMappingURL=MeshApis.js.map
|
|
@@ -0,0 +1 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AI,OAAO,EAAE,CAAC;QACZ,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAA;IAC7B,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IAC7E,OAAO,GAAG,CAAA;AACZ,CAAC;AA3CD,4CA2CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NFTApis.js","sourceRoot":"","sources":["../../../src/apis/NFTApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,gDAAkD;AAElD;;;;;;;;;GASG;AACI,KAAK,UAAU,UAAU,
|
|
1
|
+
{"version":3,"file":"NFTApis.js","sourceRoot":"","sources":["../../../src/apis/NFTApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,gDAAkD;AAElD;;;;;;;;;GASG;AACI,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,UAAkB;IAElB,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,aAAa,OAAO,IAAI,UAAU,EAAE,CAAC,CAAA;AAC5E,CAAC;AALD,gCAKC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,aAAa,CAAC,IAAY;IAC9C,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,kBAAkB,IAAI,EAAE,CAAC,CAAA;AAChE,CAAC;AAFD,sCAEC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export declare function getMoonPayCheckout(tokenAddress: string, chainId: number, walletAddress: string, amount: string): Promise<string>;
|
|
1
2
|
export declare function getOnRampUrl(walletAddr: string, currencyCode?: string): Promise<string>;
|
|
3
|
+
export declare function getMoonpayUrlSignature(url: string, apiKey?: string): Promise<string>;
|
|
2
4
|
export declare function getOffRampUrl(walletAddr: string): Promise<string>;
|
|
3
5
|
export interface Currency {
|
|
4
6
|
id: string;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOnRampSupportedCurrencies = exports.getOffRampUrl = exports.getOnRampUrl = void 0;
|
|
3
|
+
exports.getOnRampSupportedCurrencies = exports.getOffRampUrl = exports.getMoonpayUrlSignature = exports.getOnRampUrl = exports.getMoonPayCheckout = void 0;
|
|
4
4
|
const constants_1 = require("../common/constants");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
6
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
7
|
+
async function getMoonPayCheckout(tokenAddress, chainId, walletAddress, amount) {
|
|
8
|
+
const params = new URLSearchParams({
|
|
9
|
+
tokenAddress,
|
|
10
|
+
chainId: chainId.toString(),
|
|
11
|
+
walletAddress,
|
|
12
|
+
quoteCurrencyAmount: amount,
|
|
13
|
+
}).toString();
|
|
14
|
+
const json = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `on-ramp/moonpay-checkout/?${params}`);
|
|
15
|
+
return json.url;
|
|
16
|
+
}
|
|
17
|
+
exports.getMoonPayCheckout = getMoonPayCheckout;
|
|
7
18
|
async function getOnRampUrl(walletAddr, currencyCode) {
|
|
8
19
|
const endpoint = `on-ramp/${walletAddr}?provider=moonpay`;
|
|
9
20
|
if (currencyCode) {
|
|
@@ -11,23 +22,31 @@ async function getOnRampUrl(walletAddr, currencyCode) {
|
|
|
11
22
|
}
|
|
12
23
|
const url = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, endpoint))?.url;
|
|
13
24
|
if (!url) {
|
|
14
|
-
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError,
|
|
25
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No onramp url found.', { walletAddr }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
15
26
|
}
|
|
16
27
|
return url;
|
|
17
28
|
}
|
|
18
29
|
exports.getOnRampUrl = getOnRampUrl;
|
|
30
|
+
async function getMoonpayUrlSignature(url, apiKey) {
|
|
31
|
+
const signature = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, `on-ramp/moonpay-signature/`, { url }, apiKey);
|
|
32
|
+
if (!signature) {
|
|
33
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No onramp url found.', { url }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
34
|
+
}
|
|
35
|
+
return signature.url;
|
|
36
|
+
}
|
|
37
|
+
exports.getMoonpayUrlSignature = getMoonpayUrlSignature;
|
|
19
38
|
async function getOffRampUrl(walletAddr) {
|
|
20
39
|
const url = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `off-ramp/${walletAddr}?provider=moonpay`))?.url;
|
|
21
40
|
if (!url) {
|
|
22
|
-
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError,
|
|
41
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No offramp url found.', { walletAddr }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
23
42
|
}
|
|
24
43
|
return url;
|
|
25
44
|
}
|
|
26
45
|
exports.getOffRampUrl = getOffRampUrl;
|
|
27
46
|
async function getOnRampSupportedCurrencies() {
|
|
28
|
-
const currencies = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL,
|
|
47
|
+
const currencies = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, 'on-ramp/currencies');
|
|
29
48
|
if (!currencies || !currencies.length) {
|
|
30
|
-
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError,
|
|
49
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No supported currencies found.', {}, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
31
50
|
}
|
|
32
51
|
return currencies;
|
|
33
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnOffRampApis.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"OnOffRampApis.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAmE;AAE5D,KAAK,UAAU,kBAAkB,CACtC,YAAoB,EACpB,OAAe,EACf,aAAqB,EACrB,MAAc;IAEd,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,YAAY;QACZ,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE;QAC3B,aAAa;QACb,mBAAmB,EAAE,MAAM;KAC5B,CAAC,CAAC,QAAQ,EAAE,CAAA;IAEb,MAAM,IAAI,GAAG,MAAM,IAAA,yBAAc,EAC/B,mBAAO,EACP,6BAA6B,MAAM,EAAE,CACtC,CAAA;IACD,OAAO,IAAI,CAAC,GAAG,CAAA;AACjB,CAAC;AAlBD,gDAkBC;AAEM,KAAK,UAAU,YAAY,CAChC,UAAkB,EAClB,YAAqB;IAErB,MAAM,QAAQ,GAAG,WAAW,UAAU,mBAAmB,CAAA;IACzD,IAAI,YAAY,EAAE,CAAC;QACjB,QAAQ,CAAC,MAAM,CAAC,iBAAiB,YAAY,EAAE,CAAC,CAAA;IAClD,CAAC;IACD,MAAM,GAAG,GAAW,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAA;IAClE,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,sBAAsB,EACtB,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAnBD,oCAmBC;AAEM,KAAK,UAAU,sBAAsB,CAC1C,GAAW,EACX,MAAe;IAEf,MAAM,SAAS,GAAG,MAAM,IAAA,0BAAe,EACrC,mBAAO,EACP,4BAA4B,EAC5B,EAAE,GAAG,EAAE,EACP,MAAM,CACP,CAAA;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,sBAAsB,EACtB,EAAE,GAAG,EAAE,EACP,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,SAAS,CAAC,GAAG,CAAA;AACtB,CAAC;AApBD,wDAoBC;AAEM,KAAK,UAAU,aAAa,CAAC,UAAkB;IACpD,MAAM,GAAG,GAAW,CAClB,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,YAAY,UAAU,mBAAmB,CAAC,CACzE,EAAE,GAAG,CAAA;IACN,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,uBAAuB,EACvB,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAdD,sCAcC;AA2BM,KAAK,UAAU,4BAA4B;IAChD,MAAM,UAAU,GAAe,MAAM,IAAA,yBAAc,EACjD,mBAAO,EACP,oBAAoB,CACrB,CAAA;IACD,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,gCAAgC,EAChC,EAAE,EACF,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAfD,oEAeC"}
|
|
@@ -7,7 +7,7 @@ const ApiUtils_1 = require("../utils/ApiUtils");
|
|
|
7
7
|
async function getOnRampUrl(walletAddr) {
|
|
8
8
|
const url = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `on-ramp/${walletAddr}?provider=moonpay`))?.url;
|
|
9
9
|
if (!url) {
|
|
10
|
-
throw new errors_1.InternalFailureError(errors_1.ErrorCode.ServerFailure, `fail to get on ramp url for ${walletAddr}`, { walletAddr },
|
|
10
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.ServerFailure, `fail to get on ramp url for ${walletAddr}`, { walletAddr }, 'retry later. if it still fails, please contact us.', 'https://docs.fun.xyz');
|
|
11
11
|
}
|
|
12
12
|
return url;
|
|
13
13
|
}
|
|
@@ -15,7 +15,7 @@ exports.getOnRampUrl = getOnRampUrl;
|
|
|
15
15
|
async function getOffRampUrl(walletAddr) {
|
|
16
16
|
const url = (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `off-ramp/${walletAddr}?provider=moonpay`))?.url;
|
|
17
17
|
if (!url) {
|
|
18
|
-
throw new errors_1.InternalFailureError(errors_1.ErrorCode.ServerFailure, `fail to get off ramp url for ${walletAddr}`, { walletAddr },
|
|
18
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.ServerFailure, `fail to get off ramp url for ${walletAddr}`, { walletAddr }, 'retry later. if it still fails, please contact us.', 'https://docs.fun.xyz');
|
|
19
19
|
}
|
|
20
20
|
return url;
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnOffRampUtils.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampUtils.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAkD;AAE3C,KAAK,UAAU,YAAY,CAAC,UAAkB;
|
|
1
|
+
{"version":3,"file":"OnOffRampUtils.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampUtils.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAkD;AAE3C,KAAK,UAAU,YAAY,CAAC,UAAkB;IACnD,MAAM,GAAG,GAAG,CACV,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,WAAW,UAAU,mBAAmB,CAAC,CACxE,EAAE,GAAG,CAAA;IACN,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,aAAa,EACvB,+BAA+B,UAAU,EAAE,EAC3C,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAdD,oCAcC;AAEM,KAAK,UAAU,aAAa,CAAC,UAAkB;IACpD,MAAM,GAAG,GAAG,CACV,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,YAAY,UAAU,mBAAmB,CAAC,CACzE,EAAE,GAAG,CAAA;IACN,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,aAAa,EACvB,gCAAgC,UAAU,EAAE,EAC5C,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAdD,sCAcC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Address, Hex } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { ExecutionReceipt } from '../common/types';
|
|
3
|
+
import { Operation, OperationStatus } from '../data';
|
|
4
|
+
import { EstimatedGas, EstimateOpInput, ExecuteOpInput, ScheduleOpInput, UserOperationGasPrice } from './types';
|
|
5
5
|
export declare function createOp(op: Operation): Promise<string>;
|
|
6
6
|
export declare function getOpsOfGroup(groupId: Hex, chainId: string, status: OperationStatus): Promise<Operation[]>;
|
|
7
7
|
export declare function getOpsOfWallet(walletAddr: Address, chainId: string, status?: OperationStatus): Promise<Operation[]>;
|
|
@@ -5,7 +5,7 @@ const constants_1 = require("../common/constants");
|
|
|
5
5
|
const data_1 = require("../data");
|
|
6
6
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
7
7
|
async function createOp(op) {
|
|
8
|
-
return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
8
|
+
return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation', { ...op })).opId;
|
|
9
9
|
}
|
|
10
10
|
exports.createOp = createOp;
|
|
11
11
|
async function getOpsOfGroup(groupId, chainId, status) {
|
|
@@ -23,7 +23,10 @@ async function getOpsOfWallet(walletAddr, chainId, status) {
|
|
|
23
23
|
}
|
|
24
24
|
exports.getOpsOfWallet = getOpsOfWallet;
|
|
25
25
|
async function getOps(opIds, chainId) {
|
|
26
|
-
return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
26
|
+
return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/get-operations', {
|
|
27
|
+
opIds,
|
|
28
|
+
chainId,
|
|
29
|
+
})).operations;
|
|
27
30
|
}
|
|
28
31
|
exports.getOps = getOps;
|
|
29
32
|
async function deleteOp(opId, chainId) {
|
|
@@ -31,19 +34,25 @@ async function deleteOp(opId, chainId) {
|
|
|
31
34
|
}
|
|
32
35
|
exports.deleteOp = deleteOp;
|
|
33
36
|
async function signOp(opId, chainId, signature, signedBy, threshold) {
|
|
34
|
-
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
37
|
+
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/sign', {
|
|
38
|
+
opId,
|
|
39
|
+
chainId,
|
|
40
|
+
signature,
|
|
41
|
+
signedBy,
|
|
42
|
+
threshold,
|
|
43
|
+
});
|
|
35
44
|
}
|
|
36
45
|
exports.signOp = signOp;
|
|
37
46
|
async function executeOp(executeOpInput) {
|
|
38
|
-
return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
47
|
+
return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/execute', executeOpInput);
|
|
39
48
|
}
|
|
40
49
|
exports.executeOp = executeOp;
|
|
41
50
|
async function estimateOp(estimateOpInput) {
|
|
42
|
-
return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
51
|
+
return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/estimate', estimateOpInput);
|
|
43
52
|
}
|
|
44
53
|
exports.estimateOp = estimateOp;
|
|
45
54
|
async function scheduleOp(scheduleOpInput) {
|
|
46
|
-
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
55
|
+
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/schedule', scheduleOpInput);
|
|
47
56
|
}
|
|
48
57
|
exports.scheduleOp = scheduleOp;
|
|
49
58
|
const getFullReceipt = async (opId, chainId, userOpHash) => {
|
|
@@ -52,7 +61,7 @@ const getFullReceipt = async (opId, chainId, userOpHash) => {
|
|
|
52
61
|
for (let i = 0; i < retries; i++) {
|
|
53
62
|
try {
|
|
54
63
|
result = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `operation/${opId}/chain/${chainId}/receipt?userOpHash=${userOpHash}`);
|
|
55
|
-
if (result.status ===
|
|
64
|
+
if (result.status === 'included') {
|
|
56
65
|
break;
|
|
57
66
|
}
|
|
58
67
|
}
|
|
@@ -63,14 +72,14 @@ const getFullReceipt = async (opId, chainId, userOpHash) => {
|
|
|
63
72
|
}
|
|
64
73
|
if (!result.receipt) {
|
|
65
74
|
result.receipt = {
|
|
66
|
-
txId:
|
|
67
|
-
gasUsed:
|
|
68
|
-
opFeeUSD:
|
|
69
|
-
opFee:
|
|
75
|
+
txId: 'Failed to find.',
|
|
76
|
+
gasUsed: 'Failed to find.',
|
|
77
|
+
opFeeUSD: 'Failed to find.',
|
|
78
|
+
opFee: 'Failed to find.',
|
|
70
79
|
};
|
|
71
80
|
}
|
|
72
81
|
return {
|
|
73
|
-
...result.receipt
|
|
82
|
+
...result.receipt,
|
|
74
83
|
};
|
|
75
84
|
};
|
|
76
85
|
exports.getFullReceipt = getFullReceipt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationApis.js","sourceRoot":"","sources":["../../../src/apis/OperationApis.ts"],"names":[],"mappings":";;;AAEA,mDAA6C;AAE7C,kCAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"OperationApis.js","sourceRoot":"","sources":["../../../src/apis/OperationApis.ts"],"names":[],"mappings":";;;AAEA,mDAA6C;AAE7C,kCAAoD;AACpD,gDAI0B;AASnB,KAAK,UAAU,QAAQ,CAAC,EAAa;IAC1C,OAAO,CAAC,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACtE,CAAC;AAFD,4BAEC;AAEM,KAAK,UAAU,aAAa,CACjC,OAAY,EACZ,OAAe,EACf,MAAuB;IAEvB,MAAM,QAAQ,GACZ,MAAM,KAAK,sBAAe,CAAC,GAAG;QAC5B,CAAC,CAAC,mBAAmB,OAAO,IAAI,OAAO,EAAE;QACzC,CAAC,CAAC,mBAAmB,OAAO,UAAU,OAAO,WAAW,MAAM,EAAE,CAAA;IACpE,OAAO,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAA;AAC7D,CAAC;AAVD,sCAUC;AAEM,KAAK,UAAU,cAAc,CAClC,UAAmB,EACnB,OAAe,EACf,MAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM;QACrB,CAAC,CAAC,oBAAoB,UAAU,UAAU,OAAO,WAAW,MAAM,EAAE;QACpE,CAAC,CAAC,oBAAoB,UAAU,UAAU,OAAO,EAAE,CAAA;IACrD,OAAO,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAA;AAC7D,CAAC;AATD,wCASC;AAEM,KAAK,UAAU,MAAM,CAC1B,KAAY,EACZ,OAAe;IAEf,OAA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;YACH,MAAM,GAAG,MAAM,IAAA,yBAAc,EAC3B,mBAAO,EACP,aAAa,IAAI,UAAU,OAAO,uBAAuB,UAAU,EAAE,CACtE,CAAA;YACD,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBACjC,MAAK;YACP,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,WAAW;QACb,CAAC;QAED,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IAC3D,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,GAAG;YACf,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,iBAAiB;YAC1B,QAAQ,EAAE,iBAAiB;YAC3B,KAAK,EAAE,iBAAiB;SACzB,CAAA;IACH,CAAC;IACD,OAAO;QACL,GAAG,MAAM,CAAC,OAAO;KAClB,CAAA;AACH,CAAC,CAAA;AAjCY,QAAA,cAAc,kBAiC1B;AAEM,MAAM,WAAW,GAAG,KAAK,EAC9B,OAAe,EACiB,EAAE;IAClC,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,mBAAmB,OAAO,YAAY,CAAC,CAAA;AAC9E,CAAC,CAAA;AAJY,QAAA,WAAW,eAIvB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PaymasterType } from
|
|
1
|
+
import { PaymasterType } from '../sponsors/types';
|
|
2
2
|
export interface PaymasterTransaction {
|
|
3
3
|
action: string;
|
|
4
4
|
amount: number;
|
|
@@ -7,9 +7,4 @@ export interface PaymasterTransaction {
|
|
|
7
7
|
token: string;
|
|
8
8
|
txid?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare function updatePaymasterMode(chainId: string, updateObj: any, paymasterType: PaymasterType, sponsorAddress: string): Promise<any>;
|
|
11
|
-
export declare function removeFromList(chainId: string, address: string[], listType: string, paymasterType: PaymasterType, sponsorAddress: string): Promise<any>;
|
|
12
|
-
export declare function addToList(chainId: string, address: string[], listType: string, paymasterType: PaymasterType, sponsorAddress: string): Promise<any>;
|
|
13
10
|
export declare function addTransaction(chainId: string, timestamp: number, txid: any, transaction: PaymasterTransaction, paymasterType: PaymasterType, sponsorAddress: string): Promise<any>;
|
|
14
|
-
export declare function addPaymasterToken(chainId: string, tokenAddress: string): Promise<any>;
|
|
15
|
-
export declare function batchOperation(chainId: string, addresses: string[], modes: boolean[], list: string, paymasterType: PaymasterType, sponsorAddress: string): Promise<any>;
|