@joai/warps-adapter-solana 1.2.1 → 1.2.3
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.cts +3 -11
- package/dist/index.d.ts +3 -11
- package/dist/index.js +6 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -3
package/dist/index.d.cts
CHANGED
|
@@ -50,11 +50,6 @@ declare const SolanaExplorerNames: {
|
|
|
50
50
|
readonly devnet: readonly [SolanaExplorers.SolscanDevnet, SolanaExplorers.SolanaExplorerDevnet];
|
|
51
51
|
};
|
|
52
52
|
declare const SolanaExplorerUrls: Record<ExplorerName, string>;
|
|
53
|
-
declare const X402SolanaNetworkIdentifiers: {
|
|
54
|
-
readonly Mainnet: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
55
|
-
readonly Devnet: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
|
|
56
|
-
};
|
|
57
|
-
declare const SupportedX402SolanaNetworks: string[];
|
|
58
53
|
|
|
59
54
|
declare const KnownTokens: Partial<Record<WarpChainName, Record<WarpChainEnv, WarpChainAsset[]>>>;
|
|
60
55
|
declare const findKnownTokenById: (chain: WarpChainName, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
@@ -69,10 +64,6 @@ declare module '@solana/kit' {
|
|
|
69
64
|
export function isDurableNonceTransaction(transaction: any): boolean
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
declare module '@x402/svm/exact/client' {
|
|
73
|
-
export function registerExactSvmScheme(client: unknown, options: { signer: unknown }): void
|
|
74
|
-
}
|
|
75
|
-
|
|
76
67
|
declare class WarpSolanaDataLoader implements AdapterWarpDataLoader {
|
|
77
68
|
private readonly config;
|
|
78
69
|
private readonly chain;
|
|
@@ -127,6 +118,8 @@ declare class WarpSolanaExecutor implements AdapterWarpExecutor {
|
|
|
127
118
|
private resolveAccountPubkey;
|
|
128
119
|
private determineAccountFlags;
|
|
129
120
|
private addComputeBudgetInstructions;
|
|
121
|
+
createDeployTransaction(): Promise<never>;
|
|
122
|
+
createUpgradeTransaction(): Promise<never>;
|
|
130
123
|
}
|
|
131
124
|
|
|
132
125
|
declare class WarpSolanaExplorer implements AdapterWarpExplorer {
|
|
@@ -207,7 +200,6 @@ declare class WarpSolanaWallet implements AdapterWarpWallet {
|
|
|
207
200
|
delete(provider: WarpWalletProvider, externalId: string): Promise<void>;
|
|
208
201
|
getAddress(): string | null;
|
|
209
202
|
getPublicKey(): string | null;
|
|
210
|
-
registerX402Handlers(client: unknown): Promise<Record<string, () => void>>;
|
|
211
203
|
private createProvider;
|
|
212
204
|
private initializeCache;
|
|
213
205
|
private createProviderForOperation;
|
|
@@ -221,4 +213,4 @@ declare class WarpSolanaWallet implements AdapterWarpWallet {
|
|
|
221
213
|
private isSimulationError;
|
|
222
214
|
}
|
|
223
215
|
|
|
224
|
-
export { type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenSol, SolanaAdapter, SolanaExplorerMap, SolanaExplorerNames, SolanaExplorerUrls, SolanaExplorers,
|
|
216
|
+
export { type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenSol, SolanaAdapter, SolanaExplorerMap, SolanaExplorerNames, SolanaExplorerUrls, SolanaExplorers, WarpSolanaConstants, WarpSolanaDataLoader, WarpSolanaExecutor, WarpSolanaExplorer, WarpSolanaOutput, WarpSolanaSerializer, WarpSolanaWallet, findKnownTokenById, getKnownTokensForChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -50,11 +50,6 @@ declare const SolanaExplorerNames: {
|
|
|
50
50
|
readonly devnet: readonly [SolanaExplorers.SolscanDevnet, SolanaExplorers.SolanaExplorerDevnet];
|
|
51
51
|
};
|
|
52
52
|
declare const SolanaExplorerUrls: Record<ExplorerName, string>;
|
|
53
|
-
declare const X402SolanaNetworkIdentifiers: {
|
|
54
|
-
readonly Mainnet: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
55
|
-
readonly Devnet: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
|
|
56
|
-
};
|
|
57
|
-
declare const SupportedX402SolanaNetworks: string[];
|
|
58
53
|
|
|
59
54
|
declare const KnownTokens: Partial<Record<WarpChainName, Record<WarpChainEnv, WarpChainAsset[]>>>;
|
|
60
55
|
declare const findKnownTokenById: (chain: WarpChainName, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
@@ -69,10 +64,6 @@ declare module '@solana/kit' {
|
|
|
69
64
|
export function isDurableNonceTransaction(transaction: any): boolean
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
declare module '@x402/svm/exact/client' {
|
|
73
|
-
export function registerExactSvmScheme(client: unknown, options: { signer: unknown }): void
|
|
74
|
-
}
|
|
75
|
-
|
|
76
67
|
declare class WarpSolanaDataLoader implements AdapterWarpDataLoader {
|
|
77
68
|
private readonly config;
|
|
78
69
|
private readonly chain;
|
|
@@ -127,6 +118,8 @@ declare class WarpSolanaExecutor implements AdapterWarpExecutor {
|
|
|
127
118
|
private resolveAccountPubkey;
|
|
128
119
|
private determineAccountFlags;
|
|
129
120
|
private addComputeBudgetInstructions;
|
|
121
|
+
createDeployTransaction(): Promise<never>;
|
|
122
|
+
createUpgradeTransaction(): Promise<never>;
|
|
130
123
|
}
|
|
131
124
|
|
|
132
125
|
declare class WarpSolanaExplorer implements AdapterWarpExplorer {
|
|
@@ -207,7 +200,6 @@ declare class WarpSolanaWallet implements AdapterWarpWallet {
|
|
|
207
200
|
delete(provider: WarpWalletProvider, externalId: string): Promise<void>;
|
|
208
201
|
getAddress(): string | null;
|
|
209
202
|
getPublicKey(): string | null;
|
|
210
|
-
registerX402Handlers(client: unknown): Promise<Record<string, () => void>>;
|
|
211
203
|
private createProvider;
|
|
212
204
|
private initializeCache;
|
|
213
205
|
private createProviderForOperation;
|
|
@@ -221,4 +213,4 @@ declare class WarpSolanaWallet implements AdapterWarpWallet {
|
|
|
221
213
|
private isSimulationError;
|
|
222
214
|
}
|
|
223
215
|
|
|
224
|
-
export { type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenSol, SolanaAdapter, SolanaExplorerMap, SolanaExplorerNames, SolanaExplorerUrls, SolanaExplorers,
|
|
216
|
+
export { type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenSol, SolanaAdapter, SolanaExplorerMap, SolanaExplorerNames, SolanaExplorerUrls, SolanaExplorers, WarpSolanaConstants, WarpSolanaDataLoader, WarpSolanaExecutor, WarpSolanaExplorer, WarpSolanaOutput, WarpSolanaSerializer, WarpSolanaWallet, findKnownTokenById, getKnownTokensForChain };
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,6 @@ __export(index_exports, {
|
|
|
38
38
|
SolanaExplorerNames: () => SolanaExplorerNames,
|
|
39
39
|
SolanaExplorerUrls: () => SolanaExplorerUrls,
|
|
40
40
|
SolanaExplorers: () => SolanaExplorers,
|
|
41
|
-
SupportedX402SolanaNetworks: () => SupportedX402SolanaNetworks,
|
|
42
41
|
WarpSolanaConstants: () => WarpSolanaConstants,
|
|
43
42
|
WarpSolanaDataLoader: () => WarpSolanaDataLoader,
|
|
44
43
|
WarpSolanaExecutor: () => WarpSolanaExecutor,
|
|
@@ -46,7 +45,6 @@ __export(index_exports, {
|
|
|
46
45
|
WarpSolanaOutput: () => WarpSolanaOutput,
|
|
47
46
|
WarpSolanaSerializer: () => WarpSolanaSerializer,
|
|
48
47
|
WarpSolanaWallet: () => WarpSolanaWallet,
|
|
49
|
-
X402SolanaNetworkIdentifiers: () => X402SolanaNetworkIdentifiers,
|
|
50
48
|
findKnownTokenById: () => findKnownTokenById,
|
|
51
49
|
getKnownTokensForChain: () => getKnownTokensForChain
|
|
52
50
|
});
|
|
@@ -113,11 +111,6 @@ var SolanaExplorerNames = {
|
|
|
113
111
|
devnet: ["solscan_devnet" /* SolscanDevnet */, "solana_explorer_devnet" /* SolanaExplorerDevnet */]
|
|
114
112
|
};
|
|
115
113
|
var SolanaExplorerUrls = ExplorerUrls;
|
|
116
|
-
var X402SolanaNetworkIdentifiers = {
|
|
117
|
-
Mainnet: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
118
|
-
Devnet: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
|
|
119
|
-
};
|
|
120
|
-
var SupportedX402SolanaNetworks = [X402SolanaNetworkIdentifiers.Mainnet, X402SolanaNetworkIdentifiers.Devnet];
|
|
121
114
|
|
|
122
115
|
// src/tokenProgram.ts
|
|
123
116
|
var import_web3 = require("@solana/web3.js");
|
|
@@ -1594,6 +1587,12 @@ var WarpSolanaExecutor = class {
|
|
|
1594
1587
|
const computeUnitPriceIx = import_web35.ComputeBudgetProgram.setComputeUnitPrice({ microLamports: WarpSolanaConstants.PriorityFee.Default });
|
|
1595
1588
|
return [computeUnitLimitIx, computeUnitPriceIx, ...instructions];
|
|
1596
1589
|
}
|
|
1590
|
+
async createDeployTransaction() {
|
|
1591
|
+
throw new Error("WarpSolanaExecutor: Contract deployment not supported");
|
|
1592
|
+
}
|
|
1593
|
+
async createUpgradeTransaction() {
|
|
1594
|
+
throw new Error("WarpSolanaExecutor: Contract upgrade not supported");
|
|
1595
|
+
}
|
|
1597
1596
|
};
|
|
1598
1597
|
|
|
1599
1598
|
// src/WarpSolanaExplorer.ts
|
|
@@ -1743,9 +1742,7 @@ var WarpSolanaExplorer = class {
|
|
|
1743
1742
|
|
|
1744
1743
|
// src/WarpSolanaWallet.ts
|
|
1745
1744
|
var import_warps12 = require("@joai/warps");
|
|
1746
|
-
var import_kit = require("@solana/kit");
|
|
1747
1745
|
var import_web38 = require("@solana/web3.js");
|
|
1748
|
-
var import_client = require("@x402/svm/exact/client");
|
|
1749
1746
|
|
|
1750
1747
|
// src/providers/MnemonicWalletProvider.ts
|
|
1751
1748
|
var bip39 = __toESM(require("@scure/bip39"), 1);
|
|
@@ -2136,22 +2133,6 @@ var WarpSolanaWallet = class {
|
|
|
2136
2133
|
getPublicKey() {
|
|
2137
2134
|
return this.cachedPublicKey;
|
|
2138
2135
|
}
|
|
2139
|
-
async registerX402Handlers(client) {
|
|
2140
|
-
if (!this.walletProvider) return {};
|
|
2141
|
-
const provider = this.walletProvider;
|
|
2142
|
-
const getKeypair = provider.getKeypairInstance;
|
|
2143
|
-
if (typeof getKeypair !== "function") return {};
|
|
2144
|
-
const keypair = getKeypair();
|
|
2145
|
-
if (!keypair || !keypair.secretKey) return {};
|
|
2146
|
-
const signer = await (0, import_kit.createKeyPairSignerFromBytes)(keypair.secretKey);
|
|
2147
|
-
const handlers = {};
|
|
2148
|
-
for (const network of SupportedX402SolanaNetworks) {
|
|
2149
|
-
handlers[network] = () => {
|
|
2150
|
-
(0, import_client.registerExactSvmScheme)(client, { signer });
|
|
2151
|
-
};
|
|
2152
|
-
}
|
|
2153
|
-
return handlers;
|
|
2154
|
-
}
|
|
2155
2136
|
createProvider() {
|
|
2156
2137
|
const wallet = this.config.user?.wallets?.[this.chain.name];
|
|
2157
2138
|
if (!wallet) return null;
|
|
@@ -2345,7 +2326,6 @@ var SolanaAdapter = createSolanaAdapter(import_warps13.WarpChainName.Solana, {
|
|
|
2345
2326
|
SolanaExplorerNames,
|
|
2346
2327
|
SolanaExplorerUrls,
|
|
2347
2328
|
SolanaExplorers,
|
|
2348
|
-
SupportedX402SolanaNetworks,
|
|
2349
2329
|
WarpSolanaConstants,
|
|
2350
2330
|
WarpSolanaDataLoader,
|
|
2351
2331
|
WarpSolanaExecutor,
|
|
@@ -2353,7 +2333,6 @@ var SolanaAdapter = createSolanaAdapter(import_warps13.WarpChainName.Solana, {
|
|
|
2353
2333
|
WarpSolanaOutput,
|
|
2354
2334
|
WarpSolanaSerializer,
|
|
2355
2335
|
WarpSolanaWallet,
|
|
2356
|
-
X402SolanaNetworkIdentifiers,
|
|
2357
2336
|
findKnownTokenById,
|
|
2358
2337
|
getKnownTokensForChain
|
|
2359
2338
|
});
|