@b3dotfun/sdk 0.0.7-alpha.27 → 0.0.7-alpha.29
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/shared/utils/formatUsername.d.ts +1 -0
- package/dist/cjs/shared/utils/formatUsername.js +8 -0
- package/dist/cjs/shared/utils/index.d.ts +3 -10
- package/dist/cjs/shared/utils/index.js +4 -23
- package/dist/cjs/shared/utils/truncateAddress.d.ts +6 -0
- package/dist/cjs/shared/utils/truncateAddress.js +16 -0
- package/dist/esm/shared/utils/formatUsername.d.ts +1 -0
- package/dist/esm/shared/utils/formatUsername.js +5 -0
- package/dist/esm/shared/utils/index.d.ts +3 -10
- package/dist/esm/shared/utils/index.js +4 -20
- package/dist/esm/shared/utils/truncateAddress.d.ts +6 -0
- package/dist/esm/shared/utils/truncateAddress.js +12 -0
- package/dist/types/shared/utils/formatUsername.d.ts +1 -0
- package/dist/types/shared/utils/index.d.ts +3 -10
- package/dist/types/shared/utils/truncateAddress.d.ts +6 -0
- package/package.json +1 -1
- package/src/anyspend/README.md +12 -0
- package/src/shared/utils/formatUsername.ts +5 -0
- package/src/shared/utils/index.ts +4 -22
- package/src/shared/utils/truncateAddress.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatUsername(username: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatUsername = formatUsername;
|
|
4
|
+
function formatUsername(username) {
|
|
5
|
+
// Remove .b3.fun and put an @ before it
|
|
6
|
+
// Make it all lowercase
|
|
7
|
+
return `@${username.replace(".b3.fun", "").toLowerCase()}`;
|
|
8
|
+
}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
export declare function formatUsername(username: string): string;
|
|
2
|
-
/**
|
|
3
|
-
* Helper functions for formatting data
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Truncates a wallet address to show first 4 and last 4 characters
|
|
7
|
-
* @param address Wallet address to truncate
|
|
8
|
-
* @returns Truncated address in format "0x1234...5678"
|
|
9
|
-
*/
|
|
10
|
-
export declare const truncateAddress: (address: string) => string;
|
|
11
1
|
export * from "./cn";
|
|
2
|
+
export * from "./formatNumber";
|
|
3
|
+
export * from "./formatUsername";
|
|
4
|
+
export * from "./truncateAddress";
|
|
@@ -14,27 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
exports.formatUsername = formatUsername;
|
|
19
|
-
function formatUsername(username) {
|
|
20
|
-
// Remove .b3.fun and put an @ before it
|
|
21
|
-
// Make it all lowercase
|
|
22
|
-
return `@${username.replace(".b3.fun", "").toLowerCase()}`;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Helper functions for formatting data
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Truncates a wallet address to show first 4 and last 4 characters
|
|
29
|
-
* @param address Wallet address to truncate
|
|
30
|
-
* @returns Truncated address in format "0x1234...5678"
|
|
31
|
-
*/
|
|
32
|
-
const truncateAddress = (address) => {
|
|
33
|
-
if (!address)
|
|
34
|
-
return "";
|
|
35
|
-
if (address.length <= 9)
|
|
36
|
-
return address;
|
|
37
|
-
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
38
|
-
};
|
|
39
|
-
exports.truncateAddress = truncateAddress;
|
|
17
|
+
// Export utility functions
|
|
40
18
|
__exportStar(require("./cn"), exports);
|
|
19
|
+
__exportStar(require("./formatNumber"), exports);
|
|
20
|
+
__exportStar(require("./formatUsername"), exports);
|
|
21
|
+
__exportStar(require("./truncateAddress"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.truncateAddress = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Truncates a wallet address to show first 4 and last 4 characters
|
|
6
|
+
* @param address Wallet address to truncate
|
|
7
|
+
* @returns Truncated address in format "0x1234...5678"
|
|
8
|
+
*/
|
|
9
|
+
const truncateAddress = (address) => {
|
|
10
|
+
if (!address)
|
|
11
|
+
return "";
|
|
12
|
+
if (address.length <= 9)
|
|
13
|
+
return address;
|
|
14
|
+
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
15
|
+
};
|
|
16
|
+
exports.truncateAddress = truncateAddress;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatUsername(username: string): string;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
export declare function formatUsername(username: string): string;
|
|
2
|
-
/**
|
|
3
|
-
* Helper functions for formatting data
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Truncates a wallet address to show first 4 and last 4 characters
|
|
7
|
-
* @param address Wallet address to truncate
|
|
8
|
-
* @returns Truncated address in format "0x1234...5678"
|
|
9
|
-
*/
|
|
10
|
-
export declare const truncateAddress: (address: string) => string;
|
|
11
1
|
export * from "./cn";
|
|
2
|
+
export * from "./formatNumber";
|
|
3
|
+
export * from "./formatUsername";
|
|
4
|
+
export * from "./truncateAddress";
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
// Remove .b3.fun and put an @ before it
|
|
3
|
-
// Make it all lowercase
|
|
4
|
-
return `@${username.replace(".b3.fun", "").toLowerCase()}`;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Helper functions for formatting data
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Truncates a wallet address to show first 4 and last 4 characters
|
|
11
|
-
* @param address Wallet address to truncate
|
|
12
|
-
* @returns Truncated address in format "0x1234...5678"
|
|
13
|
-
*/
|
|
14
|
-
export const truncateAddress = (address) => {
|
|
15
|
-
if (!address)
|
|
16
|
-
return "";
|
|
17
|
-
if (address.length <= 9)
|
|
18
|
-
return address;
|
|
19
|
-
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
20
|
-
};
|
|
1
|
+
// Export utility functions
|
|
21
2
|
export * from "./cn.js";
|
|
3
|
+
export * from "./formatNumber.js";
|
|
4
|
+
export * from "./formatUsername.js";
|
|
5
|
+
export * from "./truncateAddress.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Truncates a wallet address to show first 4 and last 4 characters
|
|
3
|
+
* @param address Wallet address to truncate
|
|
4
|
+
* @returns Truncated address in format "0x1234...5678"
|
|
5
|
+
*/
|
|
6
|
+
export const truncateAddress = (address) => {
|
|
7
|
+
if (!address)
|
|
8
|
+
return "";
|
|
9
|
+
if (address.length <= 9)
|
|
10
|
+
return address;
|
|
11
|
+
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatUsername(username: string): string;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
export declare function formatUsername(username: string): string;
|
|
2
|
-
/**
|
|
3
|
-
* Helper functions for formatting data
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Truncates a wallet address to show first 4 and last 4 characters
|
|
7
|
-
* @param address Wallet address to truncate
|
|
8
|
-
* @returns Truncated address in format "0x1234...5678"
|
|
9
|
-
*/
|
|
10
|
-
export declare const truncateAddress: (address: string) => string;
|
|
11
1
|
export * from "./cn";
|
|
2
|
+
export * from "./formatNumber";
|
|
3
|
+
export * from "./formatUsername";
|
|
4
|
+
export * from "./truncateAddress";
|
package/package.json
CHANGED
package/src/anyspend/README.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# AnySpend SDK Documentation
|
|
2
2
|
|
|
3
|
+
The fastest way to accept crypto payments and onboard users with zero friction
|
|
4
|
+
|
|
5
|
+
AnySpend gives you everything you need to add instant crypto onramps and checkout to your product. Let your users onramp from fiat instantly and pay using any token on any chain, all in one seamless experience.
|
|
6
|
+
|
|
7
|
+
🚀 Instant Onramp: Users can fund their wallet directly from fiat and start spending in your app right away
|
|
8
|
+
💸 Pay Anyway: Accept payments in any token across any chain with no bridges, swapping, or network switching required
|
|
9
|
+
🧩 One SDK, Any Flow: Easily add crypto payments and onramps to any business model or checkout flow
|
|
10
|
+
👛 Unified Wallet View: Users see and spend their balances from all chains in one place
|
|
11
|
+
AnySpend makes it simple to reach more users, increase conversions, and future proof your business with modern crypto payments.
|
|
12
|
+
|
|
13
|
+
See the Quickstart below or visit anyspend.com for a live demo
|
|
14
|
+
|
|
3
15
|
AnySpend is a powerful cross-chain protocol that enables seamless token swaps, NFT minting, tournament participation, and custom smart contract interactions across multiple blockchain networks. Built for developers who want to provide their users with a frictionless Web3 experience.
|
|
4
16
|
|
|
5
17
|
## 📦 Overview
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
// Remove .b3.fun and put an @ before it
|
|
3
|
-
// Make it all lowercase
|
|
4
|
-
return `@${username.replace(".b3.fun", "").toLowerCase()}`;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Helper functions for formatting data
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Truncates a wallet address to show first 4 and last 4 characters
|
|
13
|
-
* @param address Wallet address to truncate
|
|
14
|
-
* @returns Truncated address in format "0x1234...5678"
|
|
15
|
-
*/
|
|
16
|
-
export const truncateAddress = (address: string): string => {
|
|
17
|
-
if (!address) return "";
|
|
18
|
-
if (address.length <= 9) return address;
|
|
19
|
-
|
|
20
|
-
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
21
|
-
};
|
|
22
|
-
|
|
1
|
+
// Export utility functions
|
|
23
2
|
export * from "./cn";
|
|
3
|
+
export * from "./formatNumber";
|
|
4
|
+
export * from "./formatUsername";
|
|
5
|
+
export * from "./truncateAddress";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Truncates a wallet address to show first 4 and last 4 characters
|
|
3
|
+
* @param address Wallet address to truncate
|
|
4
|
+
* @returns Truncated address in format "0x1234...5678"
|
|
5
|
+
*/
|
|
6
|
+
export const truncateAddress = (address: string): string => {
|
|
7
|
+
if (!address) return "";
|
|
8
|
+
if (address.length <= 9) return address;
|
|
9
|
+
|
|
10
|
+
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
11
|
+
};
|