@daimo/pay-common 1.7.2 → 1.7.3-dev
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/apiTypes.d.ts +32 -0
- package/dist/apiTypes.js +27 -0
- package/dist/apiTypes.js.map +1 -0
- package/dist/daimoPay.d.ts +1 -1
- package/dist/token.d.ts +26 -14
- package/dist/token.js +128 -114
- package/dist/token.js.map +1 -1
- package/package.json +1 -1
- package/src/daimoPay.ts +1 -1
- package/src/token.ts +150 -118
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare enum PaymentMethod {
|
|
2
|
+
Binance = "Binance",
|
|
3
|
+
Coinbase = "Coinbase",
|
|
4
|
+
Daimo = "Daimo",
|
|
5
|
+
ExternalChains = "ExternalChains",
|
|
6
|
+
EVMWallets = "EVMWallets",
|
|
7
|
+
Lemon = "Lemon",
|
|
8
|
+
RampNetwork = "RampNetwork",
|
|
9
|
+
SolanaWallets = "SolanaWallets"
|
|
10
|
+
}
|
|
11
|
+
export declare enum PaymentMethodType {
|
|
12
|
+
/** Payment method that links out to a deposit address. */
|
|
13
|
+
DepositAddress = "DepositAddress",
|
|
14
|
+
/** Pay with an EVM wallet. */
|
|
15
|
+
EVMWallets = "EVMWallets",
|
|
16
|
+
/** Payment method that links out to an external website. */
|
|
17
|
+
External = "External",
|
|
18
|
+
/** Pay with a Solana wallet. */
|
|
19
|
+
SolanaWallets = "SolanaWallets"
|
|
20
|
+
}
|
|
21
|
+
export type PaymentMethodMetadata = {
|
|
22
|
+
id: PaymentMethod;
|
|
23
|
+
type: PaymentMethodType;
|
|
24
|
+
cta: string;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
logos?: {
|
|
27
|
+
uri: string;
|
|
28
|
+
shape: "circle" | "squircle";
|
|
29
|
+
}[];
|
|
30
|
+
message?: string;
|
|
31
|
+
minimumUsd?: number;
|
|
32
|
+
};
|
package/dist/apiTypes.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentMethodType = exports.PaymentMethod = void 0;
|
|
4
|
+
var PaymentMethod;
|
|
5
|
+
(function (PaymentMethod) {
|
|
6
|
+
PaymentMethod["Binance"] = "Binance";
|
|
7
|
+
PaymentMethod["Coinbase"] = "Coinbase";
|
|
8
|
+
PaymentMethod["Daimo"] = "Daimo";
|
|
9
|
+
// ChangeNow chains. Bitcoin, Litecoin, Doge, Tron, etc.
|
|
10
|
+
PaymentMethod["ExternalChains"] = "ExternalChains";
|
|
11
|
+
PaymentMethod["EVMWallets"] = "EVMWallets";
|
|
12
|
+
PaymentMethod["Lemon"] = "Lemon";
|
|
13
|
+
PaymentMethod["RampNetwork"] = "RampNetwork";
|
|
14
|
+
PaymentMethod["SolanaWallets"] = "SolanaWallets";
|
|
15
|
+
})(PaymentMethod || (exports.PaymentMethod = PaymentMethod = {}));
|
|
16
|
+
var PaymentMethodType;
|
|
17
|
+
(function (PaymentMethodType) {
|
|
18
|
+
/** Payment method that links out to a deposit address. */
|
|
19
|
+
PaymentMethodType["DepositAddress"] = "DepositAddress";
|
|
20
|
+
/** Pay with an EVM wallet. */
|
|
21
|
+
PaymentMethodType["EVMWallets"] = "EVMWallets";
|
|
22
|
+
/** Payment method that links out to an external website. */
|
|
23
|
+
PaymentMethodType["External"] = "External";
|
|
24
|
+
/** Pay with a Solana wallet. */
|
|
25
|
+
PaymentMethodType["SolanaWallets"] = "SolanaWallets";
|
|
26
|
+
})(PaymentMethodType || (exports.PaymentMethodType = PaymentMethodType = {}));
|
|
27
|
+
//# sourceMappingURL=apiTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiTypes.js","sourceRoot":"","sources":["../src/apiTypes.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,wDAAwD;IACxD,kDAAiC,CAAA;IACjC,0CAAyB,CAAA;IACzB,gCAAe,CAAA;IACf,4CAA2B,CAAA;IAC3B,gDAA+B,CAAA;AACjC,CAAC,EAVW,aAAa,6BAAb,aAAa,QAUxB;AAED,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,0DAA0D;IAC1D,sDAAiC,CAAA;IACjC,8BAA8B;IAC9B,8CAAyB,CAAA;IACzB,4DAA4D;IAC5D,0CAAqB,CAAA;IACrB,gCAAgC;IAChC,oDAA+B,CAAA;AACjC,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B"}
|
package/dist/daimoPay.d.ts
CHANGED
|
@@ -214,7 +214,7 @@ export type DaimoPayHydratedOrder = {
|
|
|
214
214
|
destFinalCallTokenAmount: DaimoPayTokenAmount;
|
|
215
215
|
destFinalCall: OnChainCall;
|
|
216
216
|
usdValue: number;
|
|
217
|
-
|
|
217
|
+
refundAddr: Address;
|
|
218
218
|
destNonce: bigint;
|
|
219
219
|
sourceFulfillerAddr: Address | SolanaPublicKey | null;
|
|
220
220
|
sourceTokenAmount: DaimoPayTokenAmount | null;
|
package/dist/token.d.ts
CHANGED
|
@@ -1,34 +1,37 @@
|
|
|
1
|
+
import { Address } from "viem";
|
|
1
2
|
export type Token = {
|
|
2
3
|
/** Chain ID, eg 10 for OP Mainnet */
|
|
3
4
|
chainId: number;
|
|
4
5
|
/** Ethereum (capitalized) or Solana token address */
|
|
5
|
-
token: string;
|
|
6
|
+
token: `0x${string}` | string;
|
|
6
7
|
/** Name, eg "Wrapped Bitcoin" */
|
|
7
8
|
name?: string;
|
|
8
9
|
/** Symbol, eg "WBTC" */
|
|
9
10
|
symbol: string;
|
|
10
11
|
/** Token decimals, eg 8 for WBTC */
|
|
11
12
|
decimals: number;
|
|
12
|
-
/** Logo URI. Fetch required, not guaranteed to be base64. */
|
|
13
|
-
logoURI?: string;
|
|
14
13
|
/** Fiat ISO code for stablecoins, eg "USD" or "EUR" */
|
|
15
14
|
fiatISO?: string;
|
|
15
|
+
/** Logo preview data URI. Generally SVG or 64x64 PNG. */
|
|
16
|
+
logoURI: TokenLogo | string;
|
|
17
|
+
/** Original source image URL. */
|
|
18
|
+
logoSourceURI: string;
|
|
16
19
|
};
|
|
17
20
|
export declare enum TokenLogo {
|
|
18
21
|
ETH = "https://pay.daimo.com/chain-logos/ethereum.png",
|
|
19
|
-
USDC = "https://
|
|
20
|
-
EURC = "https://
|
|
22
|
+
USDC = "https://pay.daimo.com/coin-logos/usdc.png",
|
|
23
|
+
EURC = "https://pay.daimo.com/coin-logos/eurc.png",
|
|
21
24
|
USDT = "https://pay.daimo.com/coin-logos/usdt.png",
|
|
22
25
|
DAI = "https://pay.daimo.com/coin-logos/dai.png",
|
|
23
|
-
POL = "https://
|
|
24
|
-
AVAX = "https://
|
|
25
|
-
BNB = "https://
|
|
26
|
-
SOL = "https://
|
|
27
|
-
WLD = "https://
|
|
28
|
-
USDB = "https://
|
|
29
|
-
BLAST = "https://
|
|
30
|
-
WBTC = "https://
|
|
31
|
-
MNT = "https://
|
|
26
|
+
POL = "https://pay.daimo.com/coin-logos/pol.png",
|
|
27
|
+
AVAX = "https://pay.daimo.com/coin-logos/avax.png",
|
|
28
|
+
BNB = "https://pay.daimo.com/coin-logos/bnb.png",
|
|
29
|
+
SOL = "https://pay.daimo.com/coin-logos/sol.png",
|
|
30
|
+
WLD = "https://pay.daimo.com/coin-logos/wld.jpeg",
|
|
31
|
+
USDB = "https://pay.daimo.com/coin-logos/usdb.png",
|
|
32
|
+
BLAST = "https://pay.daimo.com/coin-logos/blast.jpg",
|
|
33
|
+
WBTC = "https://pay.daimo.com/coin-logos/wbtc.png",
|
|
34
|
+
MNT = "https://pay.daimo.com/coin-logos/mnt.png"
|
|
32
35
|
}
|
|
33
36
|
export declare const arbitrumETH: Token;
|
|
34
37
|
export declare const arbitrumWETH: Token;
|
|
@@ -107,3 +110,12 @@ export declare function getChainAxlUSDC(chainId: number): Token | undefined;
|
|
|
107
110
|
/** Returns native USDC when available, otherwise bridged USDC. */
|
|
108
111
|
export declare function getChainBestUSDC(chainId: number): Token | undefined;
|
|
109
112
|
export declare function getChainDAI(chainId: number): Token | undefined;
|
|
113
|
+
export declare function token({ chainId, token, name, symbol, decimals, fiatISO, logoURI, }: {
|
|
114
|
+
chainId: number;
|
|
115
|
+
token: Address | string;
|
|
116
|
+
name: string;
|
|
117
|
+
symbol: string;
|
|
118
|
+
decimals: number;
|
|
119
|
+
fiatISO?: string;
|
|
120
|
+
logoURI: string;
|
|
121
|
+
}): Token;
|