@zebec-network/exchange-card-sdk 1.9.1 → 1.10.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.
|
@@ -38,6 +38,13 @@ export interface TransactionOptions {
|
|
|
38
38
|
*/
|
|
39
39
|
privateFee?: boolean;
|
|
40
40
|
}
|
|
41
|
+
interface AleoNetworkClientOptions {
|
|
42
|
+
headers?: {
|
|
43
|
+
[key: string]: string;
|
|
44
|
+
};
|
|
45
|
+
proverUri?: string;
|
|
46
|
+
recordScannerUri?: string;
|
|
47
|
+
}
|
|
41
48
|
export interface AleoWallet {
|
|
42
49
|
address: string;
|
|
43
50
|
decrypt: (cipherText: string) => Promise<string>;
|
|
@@ -88,7 +95,7 @@ export declare class AleoService {
|
|
|
88
95
|
readonly sandbox: boolean;
|
|
89
96
|
readonly apiService: ZebecCardAPIService;
|
|
90
97
|
readonly networkClient: AleoNetworkClient | TestnetAleoNetworkClient;
|
|
91
|
-
constructor(wallet: AleoWallet,
|
|
98
|
+
constructor(wallet: AleoWallet, aleoNetworkClientOptions?: AleoNetworkClientOptions, sdkOptions?: {
|
|
92
99
|
sandbox?: boolean;
|
|
93
100
|
});
|
|
94
101
|
/**
|
|
@@ -124,3 +131,4 @@ export declare class AleoService {
|
|
|
124
131
|
getPrivateBalance(): Promise<string>;
|
|
125
132
|
getPrivateTokenBalance(tokenProgramId: string, tokenSymbol: string): Promise<string>;
|
|
126
133
|
}
|
|
134
|
+
export {};
|
|
@@ -41,13 +41,13 @@ export class AleoService {
|
|
|
41
41
|
sandbox;
|
|
42
42
|
apiService;
|
|
43
43
|
networkClient;
|
|
44
|
-
constructor(wallet,
|
|
44
|
+
constructor(wallet, aleoNetworkClientOptions, sdkOptions) {
|
|
45
45
|
this.wallet = wallet;
|
|
46
|
-
this.sandbox =
|
|
47
|
-
this.apiService = new ZebecCardAPIService(
|
|
46
|
+
this.sandbox = sdkOptions?.sandbox || false;
|
|
47
|
+
this.apiService = new ZebecCardAPIService(sdkOptions?.sandbox || false);
|
|
48
48
|
this.networkClient = this.sandbox
|
|
49
|
-
? new TestnetAleoNetworkClient(ALEO_NETWORK_CLIENT_URL)
|
|
50
|
-
: new AleoNetworkClient(ALEO_NETWORK_CLIENT_URL);
|
|
49
|
+
? new TestnetAleoNetworkClient(ALEO_NETWORK_CLIENT_URL, aleoNetworkClientOptions)
|
|
50
|
+
: new AleoNetworkClient(ALEO_NETWORK_CLIENT_URL, aleoNetworkClientOptions);
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Fetches the Bitcoin vault address.
|
|
@@ -140,9 +140,6 @@ export class AleoService {
|
|
|
140
140
|
default:
|
|
141
141
|
throw new Error("Invalid or Unsupported transfer type");
|
|
142
142
|
}
|
|
143
|
-
if (functionName !== "transfer_public") {
|
|
144
|
-
throw new Error("Only public transfers are currently supported for credits. Private and cross-type transfers require additional implementation.");
|
|
145
|
-
}
|
|
146
143
|
const result = await this.wallet.executeTransaction({
|
|
147
144
|
program: PROGRAM_NAME,
|
|
148
145
|
function: functionName,
|
package/package.json
CHANGED