@coinflowlabs/react 0.2.5 → 0.2.7
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/README.md +9 -0
- package/build/cjs/CoinflowUtils.d.ts +2 -4
- package/build/cjs/CoinflowUtils.js +3 -16
- package/build/cjs/CoinflowUtils.js.map +1 -1
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/esm/CoinflowUtils.d.ts +2 -4
- package/build/esm/CoinflowUtils.js +4 -17
- package/build/esm/CoinflowUtils.js.map +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,9 +37,18 @@ Props:
|
|
|
37
37
|
* `partialSigners` (optional): Keypairs of Partial Signers to sign the transaction with, this is necessary when initializing new accounts as the new account Keypair must sign the transaction.
|
|
38
38
|
* `debugTx` (optional): Setting this to `true` will sign the transaction with the wallet, and send the transaction with no preflight checks allowing for easier debug of any issues.
|
|
39
39
|
|
|
40
|
+
## Utils
|
|
41
|
+
|
|
42
|
+
`CoinflowUtils`
|
|
43
|
+
|
|
44
|
+
* `getFeePayer` - Return the `PublicKey` of the Coinflow Fee Payer
|
|
40
45
|
|
|
41
46
|
# Changelog
|
|
42
47
|
|
|
48
|
+
### 0.2.6,0.2.7
|
|
49
|
+
|
|
50
|
+
- Added `CoinflowUtils.getFeePayer()` to get the Coinflow fee payer PublicKey
|
|
51
|
+
|
|
43
52
|
### 0.2.5
|
|
44
53
|
|
|
45
54
|
- Fixing an issue when passing partialSigners not working with the setup transaction
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { CoinflowEnvs } from './CoinflowIFrame';
|
|
3
3
|
export declare class CoinflowUtils {
|
|
4
4
|
env: CoinflowEnvs;
|
|
5
5
|
url: string;
|
|
6
6
|
constructor(env?: CoinflowEnvs);
|
|
7
|
-
|
|
8
|
-
transactionToBase58(transaction: Transaction): string;
|
|
9
|
-
base58ToTransaction(bs58: string): Transaction;
|
|
7
|
+
getFeePayer(): Promise<PublicKey>;
|
|
10
8
|
}
|
|
@@ -4,7 +4,6 @@ exports.CoinflowUtils = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var web3_js_1 = require("@solana/web3.js");
|
|
6
6
|
var axios_1 = tslib_1.__importDefault(require("axios"));
|
|
7
|
-
var bs58_1 = tslib_1.__importDefault(require("bs58"));
|
|
8
7
|
var CoinflowUtils = /** @class */ (function () {
|
|
9
8
|
function CoinflowUtils(env) {
|
|
10
9
|
this.env = env !== null && env !== void 0 ? env : 'prod';
|
|
@@ -15,31 +14,19 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
15
14
|
else
|
|
16
15
|
this.url = "https://api-".concat(this.env, ".coinflow.cash");
|
|
17
16
|
}
|
|
18
|
-
CoinflowUtils.prototype.
|
|
17
|
+
CoinflowUtils.prototype.getFeePayer = function () {
|
|
19
18
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
20
19
|
var data;
|
|
21
20
|
return tslib_1.__generator(this, function (_a) {
|
|
22
21
|
switch (_a.label) {
|
|
23
|
-
case 0: return [4 /*yield*/, axios_1["default"].
|
|
24
|
-
tx: this.transactionToBase58(transaction),
|
|
25
|
-
amount: amount
|
|
26
|
-
})];
|
|
22
|
+
case 0: return [4 /*yield*/, axios_1["default"].get(this.url + '/v1/redeem/fee-payer')];
|
|
27
23
|
case 1:
|
|
28
24
|
data = (_a.sent()).data;
|
|
29
|
-
return [2 /*return*/,
|
|
25
|
+
return [2 /*return*/, new web3_js_1.PublicKey(data)];
|
|
30
26
|
}
|
|
31
27
|
});
|
|
32
28
|
});
|
|
33
29
|
};
|
|
34
|
-
CoinflowUtils.prototype.transactionToBase58 = function (transaction) {
|
|
35
|
-
return bs58_1["default"].encode(transaction.serialize({
|
|
36
|
-
requireAllSignatures: false,
|
|
37
|
-
verifySignatures: false
|
|
38
|
-
}));
|
|
39
|
-
};
|
|
40
|
-
CoinflowUtils.prototype.base58ToTransaction = function (bs58) {
|
|
41
|
-
return web3_js_1.Transaction.from(bs58_1["default"].decode(bs58));
|
|
42
|
-
};
|
|
43
30
|
return CoinflowUtils;
|
|
44
31
|
}());
|
|
45
32
|
exports.CoinflowUtils = CoinflowUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";;;;AAAA,2CAA0C;AAE1C,wDAA0B;AAE1B;IAIE,uBAAY,GAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,MAAM,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM;YAAE,IAAI,CAAC,GAAG,GAAG,2BAA2B,CAAC;aAC3D,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO;YAAE,IAAI,CAAC,GAAG,GAAG,uBAAuB,CAAC;;YAC7D,IAAI,CAAC,GAAG,GAAG,sBAAe,IAAI,CAAC,GAAG,mBAAgB,CAAC;IAC1D,CAAC;IAEK,mCAAW,GAAjB;;;;;4BACiB,qBAAM,kBAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,sBAAsB,CAAC,EAAA;;wBAA1D,IAAI,GAAI,CAAA,SAAkD,CAAA,KAAtD;wBACX,sBAAO,IAAI,mBAAS,CAAC,IAAI,CAAC,EAAC;;;;KAC5B;IACH,oBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,sCAAa"}
|
package/build/cjs/index.d.ts
CHANGED
package/build/cjs/index.js
CHANGED
|
@@ -3,4 +3,5 @@ exports.__esModule = true;
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./CoinflowWithdraw"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./CoinflowPurchase"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./CoinflowUtils"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,6DAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,6DAAmC;AACnC,0DAAgC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { CoinflowEnvs } from './CoinflowIFrame';
|
|
3
3
|
export declare class CoinflowUtils {
|
|
4
4
|
env: CoinflowEnvs;
|
|
5
5
|
url: string;
|
|
6
6
|
constructor(env?: CoinflowEnvs);
|
|
7
|
-
|
|
8
|
-
transactionToBase58(transaction: Transaction): string;
|
|
9
|
-
base58ToTransaction(bs58: string): Transaction;
|
|
7
|
+
getFeePayer(): Promise<PublicKey>;
|
|
10
8
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __awaiter, __generator } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { PublicKey } from '@solana/web3.js';
|
|
3
3
|
import axios from 'axios';
|
|
4
|
-
import base58 from 'bs58';
|
|
5
4
|
var CoinflowUtils = /** @class */ (function () {
|
|
6
5
|
function CoinflowUtils(env) {
|
|
7
6
|
this.env = env !== null && env !== void 0 ? env : 'prod';
|
|
@@ -12,31 +11,19 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
12
11
|
else
|
|
13
12
|
this.url = "https://api-".concat(this.env, ".coinflow.cash");
|
|
14
13
|
}
|
|
15
|
-
CoinflowUtils.prototype.
|
|
14
|
+
CoinflowUtils.prototype.getFeePayer = function () {
|
|
16
15
|
return __awaiter(this, void 0, void 0, function () {
|
|
17
16
|
var data;
|
|
18
17
|
return __generator(this, function (_a) {
|
|
19
18
|
switch (_a.label) {
|
|
20
|
-
case 0: return [4 /*yield*/, axios.
|
|
21
|
-
tx: this.transactionToBase58(transaction),
|
|
22
|
-
amount: amount
|
|
23
|
-
})];
|
|
19
|
+
case 0: return [4 /*yield*/, axios.get(this.url + '/v1/redeem/fee-payer')];
|
|
24
20
|
case 1:
|
|
25
21
|
data = (_a.sent()).data;
|
|
26
|
-
return [2 /*return*/,
|
|
22
|
+
return [2 /*return*/, new PublicKey(data)];
|
|
27
23
|
}
|
|
28
24
|
});
|
|
29
25
|
});
|
|
30
26
|
};
|
|
31
|
-
CoinflowUtils.prototype.transactionToBase58 = function (transaction) {
|
|
32
|
-
return base58.encode(transaction.serialize({
|
|
33
|
-
requireAllSignatures: false,
|
|
34
|
-
verifySignatures: false
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
37
|
-
CoinflowUtils.prototype.base58ToTransaction = function (bs58) {
|
|
38
|
-
return Transaction.from(base58.decode(bs58));
|
|
39
|
-
};
|
|
40
27
|
return CoinflowUtils;
|
|
41
28
|
}());
|
|
42
29
|
export { CoinflowUtils };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;IAIE,uBAAY,GAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,MAAM,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM;YAAE,IAAI,CAAC,GAAG,GAAG,2BAA2B,CAAC;aAC3D,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO;YAAE,IAAI,CAAC,GAAG,GAAG,uBAAuB,CAAC;;YAC7D,IAAI,CAAC,GAAG,GAAG,sBAAe,IAAI,CAAC,GAAG,mBAAgB,CAAC;IAC1D,CAAC;IAEK,mCAAW,GAAjB;;;;;4BACiB,qBAAM,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,sBAAsB,CAAC,EAAA;;wBAA1D,IAAI,GAAI,CAAA,SAAkD,CAAA,KAAtD;wBACX,sBAAO,IAAI,SAAS,CAAC,IAAI,CAAC,EAAC;;;;KAC5B;IACH,oBAAC;AAAD,CAAC,AAfD,IAeC"}
|
package/build/esm/index.d.ts
CHANGED
package/build/esm/index.js
CHANGED
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|