@tatumio/flow 2.0.1-alpha.237
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/package.json +25 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +5 -0
- package/src/index.js.map +1 -0
- package/src/lib/flow.constants.d.ts +11 -0
- package/src/lib/flow.constants.js +16 -0
- package/src/lib/flow.constants.js.map +1 -0
- package/src/lib/flow.sdk.d.ts +164 -0
- package/src/lib/flow.sdk.errors.d.ts +5 -0
- package/src/lib/flow.sdk.errors.js +21 -0
- package/src/lib/flow.sdk.errors.js.map +1 -0
- package/src/lib/flow.sdk.js +33 -0
- package/src/lib/flow.sdk.js.map +1 -0
- package/src/lib/services/flow.blockchain.d.ts +14 -0
- package/src/lib/services/flow.blockchain.js +31 -0
- package/src/lib/services/flow.blockchain.js.map +1 -0
- package/src/lib/services/flow.kms.d.ts +16 -0
- package/src/lib/services/flow.kms.js +37 -0
- package/src/lib/services/flow.kms.js.map +1 -0
- package/src/lib/services/flow.sdk.wallet.d.ts +2 -0
- package/src/lib/services/flow.sdk.wallet.js +40 -0
- package/src/lib/services/flow.sdk.wallet.js.map +1 -0
- package/src/lib/services/flow.tx.d.ts +127 -0
- package/src/lib/services/flow.tx.js +443 -0
- package/src/lib/services/flow.tx.js.map +1 -0
- package/src/lib/services/flow.tx.templates.d.ts +12 -0
- package/src/lib/services/flow.tx.templates.js +194 -0
- package/src/lib/services/flow.tx.templates.js.map +1 -0
package/package.json
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"name": "@tatumio/flow",
|
3
|
+
"version": "2.0.1-alpha.237",
|
4
|
+
"license": "MIT",
|
5
|
+
"main": "./src/index.js",
|
6
|
+
"typings": "./src/index.d.ts",
|
7
|
+
"dependencies": {
|
8
|
+
"@tatumio/shared-testing-common": "2.0.1-alpha.237",
|
9
|
+
"@tatumio/shared-blockchain-abstract": "2.0.1-alpha.237",
|
10
|
+
"@tatumio/api-client": "2.0.1-alpha.237",
|
11
|
+
"axios": "^0.25.0",
|
12
|
+
"form-data": "^4.0.0",
|
13
|
+
"@tatumio/shared-core": "2.0.1-alpha.237",
|
14
|
+
"@tatumio/shared-abstract-sdk": "2.0.1-alpha.237",
|
15
|
+
"bignumber.js": "^9.0.2",
|
16
|
+
"dedent-js": "^1.0.1",
|
17
|
+
"bip32": "^2.0.5",
|
18
|
+
"bip39": "^3.0.2",
|
19
|
+
"hdkey": "^2.0.1",
|
20
|
+
"@onflow/fcl": "^0.0.78",
|
21
|
+
"@onflow/util-encode-key": "^0.0.2",
|
22
|
+
"sha3": "^2.1.4"
|
23
|
+
},
|
24
|
+
"peerDependencies": {}
|
25
|
+
}
|
package/src/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './lib/flow.sdk';
|
package/src/index.js
ADDED
package/src/index.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/blockchain/flow/src/index.ts"],"names":[],"mappings":";;;AAAA,8DAA8B"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FlowTxType = void 0;
|
4
|
+
var FlowTxType;
|
5
|
+
(function (FlowTxType) {
|
6
|
+
FlowTxType[FlowTxType["CREATE_ACCOUNT"] = 0] = "CREATE_ACCOUNT";
|
7
|
+
FlowTxType[FlowTxType["ADD_PK_TO_ACCOUNT"] = 1] = "ADD_PK_TO_ACCOUNT";
|
8
|
+
FlowTxType[FlowTxType["TRANSFER"] = 2] = "TRANSFER";
|
9
|
+
FlowTxType[FlowTxType["DEPLOY_NFT"] = 3] = "DEPLOY_NFT";
|
10
|
+
FlowTxType[FlowTxType["MINT_NFT"] = 4] = "MINT_NFT";
|
11
|
+
FlowTxType[FlowTxType["MINT_MULTIPLE_NFT"] = 5] = "MINT_MULTIPLE_NFT";
|
12
|
+
FlowTxType[FlowTxType["BURN_NFT"] = 6] = "BURN_NFT";
|
13
|
+
FlowTxType[FlowTxType["TRANSFER_NFT"] = 7] = "TRANSFER_NFT";
|
14
|
+
FlowTxType[FlowTxType["CUSTOM_TX"] = 8] = "CUSTOM_TX";
|
15
|
+
})(FlowTxType = exports.FlowTxType || (exports.FlowTxType = {}));
|
16
|
+
//# sourceMappingURL=flow.constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"flow.constants.js","sourceRoot":"","sources":["../../../../../../packages/blockchain/flow/src/lib/flow.constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAUX;AAVD,WAAY,UAAU;IACpB,+DAAc,CAAA;IACd,qEAAiB,CAAA;IACjB,mDAAQ,CAAA;IACR,uDAAU,CAAA;IACV,mDAAQ,CAAA;IACR,qEAAiB,CAAA;IACjB,mDAAQ,CAAA;IACR,2DAAY,CAAA;IACZ,qDAAS,CAAA;AACX,CAAC,EAVW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAUrB"}
|
@@ -0,0 +1,164 @@
|
|
1
|
+
import { BlockchainFlowService } from '@tatumio/api-client';
|
2
|
+
import { SDKArguments } from '@tatumio/shared-abstract-sdk';
|
3
|
+
export declare const TatumFlowSDK: (args: SDKArguments) => {
|
4
|
+
api: typeof BlockchainFlowService;
|
5
|
+
kms: {
|
6
|
+
sign(tx: import("@tatumio/shared-core").ChainTransactionKMS, fromPrivateKeys: string[], testnet: boolean): Promise<{
|
7
|
+
txId: string;
|
8
|
+
address: string;
|
9
|
+
} | {
|
10
|
+
txId: string;
|
11
|
+
}>;
|
12
|
+
getAllPending(signatures?: string): import("@tatumio/api-client").CancelablePromise<import("@tatumio/api-client").PendingTransaction[]>;
|
13
|
+
get: typeof import("@tatumio/api-client").SecurityKeyManagementSystemService.getPendingTransactionToSign;
|
14
|
+
complete: typeof import("@tatumio/api-client").SecurityKeyManagementSystemService.completePendingSignature;
|
15
|
+
delete: typeof import("@tatumio/api-client").SecurityKeyManagementSystemService.deletePendingTransactionToSign;
|
16
|
+
};
|
17
|
+
wallet: import("@tatumio/shared-blockchain-abstract").SdkWithWalletFunctions;
|
18
|
+
transaction: {
|
19
|
+
sign: (pk: string, msg: Buffer) => string;
|
20
|
+
getSigner: (pk: string, address: string, keyId?: number) => {
|
21
|
+
signer: (account: any) => any;
|
22
|
+
};
|
23
|
+
getApiSigner: (isPayer: boolean) => {
|
24
|
+
signer: (account: any) => Promise<any>;
|
25
|
+
keyHash: string;
|
26
|
+
};
|
27
|
+
createAccountFromPublicKey: (testnet: boolean, publicKey: string, signerAddress: string, signerPrivateKey: string, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
28
|
+
txId: string;
|
29
|
+
address: string;
|
30
|
+
}>;
|
31
|
+
addPublicKeyToAccount: (testnet: boolean, publicKey: string, signerAddress: string, signerPrivateKey: string, weight?: number, proposer?: (args: any) => any, payer?: (args: any) => any) => Promise<{
|
32
|
+
txId: string;
|
33
|
+
address: string;
|
34
|
+
}>;
|
35
|
+
getNftMetadata: (testnet: boolean, account: string, id: string, contractAddress: string) => Promise<any>;
|
36
|
+
getNftTokenByAddress: (testnet: boolean, account: string, tokenType: string) => Promise<any>;
|
37
|
+
sendNftMintToken: (testnet: boolean, body: import("@tatumio/shared-core").ChainFlowMintNft, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
38
|
+
txId: string;
|
39
|
+
tokenId: string;
|
40
|
+
}>;
|
41
|
+
sendNftMintMultipleToken: (testnet: boolean, body: import("@tatumio/shared-core").ChainFlowMintMultipleNft, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
42
|
+
txId: string;
|
43
|
+
tokenId: number[];
|
44
|
+
}>;
|
45
|
+
sendNftTransferToken: (testnet: boolean, body: import("@tatumio/shared-core").ChainFlowTransferNft, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
46
|
+
txId: string;
|
47
|
+
}>;
|
48
|
+
sendNftBurnToken: (testnet: boolean, body: import("@tatumio/shared-core").ChainFlowBurnNft, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
49
|
+
txId: string;
|
50
|
+
}>;
|
51
|
+
sendCustomTransaction: (testnet: boolean, body: import("@tatumio/shared-core").TransferFlowCustomTx, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
52
|
+
txId: string;
|
53
|
+
events: any[];
|
54
|
+
}>;
|
55
|
+
sendTransaction: (testnet: boolean, body: import("@tatumio/shared-core").TransferFlow, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
56
|
+
txId: string;
|
57
|
+
}>;
|
58
|
+
};
|
59
|
+
nft: {
|
60
|
+
deployNFTSmartContract: typeof import("@tatumio/api-client").BlockchainNftService.nftDeployErc721;
|
61
|
+
mintNFT: typeof import("@tatumio/api-client").BlockchainNftService.nftMintErc721;
|
62
|
+
transferNFT: typeof import("@tatumio/api-client").BlockchainNftService.nftTransferErc721;
|
63
|
+
mintMultipleNFTs: typeof import("@tatumio/api-client").BlockchainNftService.nftMintMultipleErc721;
|
64
|
+
burnNFT: typeof import("@tatumio/api-client").BlockchainNftService.nftBurnErc721;
|
65
|
+
getNFTTransaction: typeof import("@tatumio/api-client").BlockchainNftService.nftGetTransactErc721;
|
66
|
+
getNFTAccountBalance: typeof import("@tatumio/api-client").BlockchainNftService.nftGetBalanceErc721;
|
67
|
+
getNFTMetadataURI: typeof import("@tatumio/api-client").BlockchainNftService.nftGetMetadataErc721;
|
68
|
+
};
|
69
|
+
blockchain: {
|
70
|
+
getCurrentBlock: typeof BlockchainFlowService.flowGetBlockChainInfo;
|
71
|
+
getBlock: typeof BlockchainFlowService.flowGetBlock;
|
72
|
+
getAccount: typeof BlockchainFlowService.flowGetAccount;
|
73
|
+
getTransaction: typeof BlockchainFlowService.flowGetRawTransaction;
|
74
|
+
};
|
75
|
+
offchain: {
|
76
|
+
depositAddress: {
|
77
|
+
checkExists: (address: string, index?: number) => Promise<import("@tatumio/api-client").Account>;
|
78
|
+
create: typeof import("@tatumio/api-client").OffChainAccountService.generateDepositAddress;
|
79
|
+
createMultiple: typeof import("@tatumio/api-client").OffChainAccountService.generateDepositAddressesBatch;
|
80
|
+
assign: typeof import("@tatumio/api-client").OffChainAccountService.assignAddress;
|
81
|
+
remove: typeof import("@tatumio/api-client").OffChainAccountService.removeAddress;
|
82
|
+
getByAccount: typeof import("@tatumio/api-client").OffChainAccountService.getAllDepositAddresses;
|
83
|
+
};
|
84
|
+
withdrawal: {
|
85
|
+
getAll: (status?: "InProgress" | "Done" | "Cancelled", pageSize?: number, offset?: number) => Promise<import("@tatumio/api-client").WithdrawalObject[]>;
|
86
|
+
broadcast: typeof import("@tatumio/api-client").OffChainWithdrawalService.broadcastBlockchainTransaction;
|
87
|
+
create: typeof import("@tatumio/api-client").OffChainWithdrawalService.storeWithdrawal;
|
88
|
+
complete: typeof import("@tatumio/api-client").OffChainWithdrawalService.completeWithdrawal;
|
89
|
+
};
|
90
|
+
storeTokenAddress: typeof import("@tatumio/api-client").OffChainBlockchainService.storeTokenAddress;
|
91
|
+
};
|
92
|
+
getExchangeRate(basePair?: import("@tatumio/api-client").Fiat): import("@tatumio/api-client").CancelablePromise<import("@tatumio/api-client").ExchangeRate>;
|
93
|
+
storage: {
|
94
|
+
upload: typeof import("@tatumio/api-client").StorageIpfsService.storeIpfs;
|
95
|
+
get: typeof import("@tatumio/api-client").StorageIpfsService.getIpfsData;
|
96
|
+
};
|
97
|
+
subscriptions: typeof import("@tatumio/api-client").LedgerSubscriptionService;
|
98
|
+
ledger: {
|
99
|
+
customer: {
|
100
|
+
get: typeof import("@tatumio/api-client").LedgerCustomerService.getCustomerByExternalOrInternalId;
|
101
|
+
getAll: typeof import("@tatumio/api-client").LedgerCustomerService.findAllCustomers;
|
102
|
+
update: typeof import("@tatumio/api-client").LedgerCustomerService.updateCustomer;
|
103
|
+
activate: typeof import("@tatumio/api-client").LedgerCustomerService.activateCustomer;
|
104
|
+
deactivate: typeof import("@tatumio/api-client").LedgerCustomerService.deactivateCustomer;
|
105
|
+
enable: typeof import("@tatumio/api-client").LedgerCustomerService.enableCustomer;
|
106
|
+
disable: typeof import("@tatumio/api-client").LedgerCustomerService.disableCustomer;
|
107
|
+
};
|
108
|
+
orderBook: {
|
109
|
+
getHistorical: typeof import("@tatumio/api-client").LedgerOrderBookService.getHistoricalTradesBody;
|
110
|
+
getActiveBuyTrades: typeof import("@tatumio/api-client").LedgerOrderBookService.getBuyTradesBody;
|
111
|
+
getActiveSellTrades: typeof import("@tatumio/api-client").LedgerOrderBookService.getBuyTradesBody;
|
112
|
+
newTrade: typeof import("@tatumio/api-client").LedgerOrderBookService.storeTrade;
|
113
|
+
get: typeof import("@tatumio/api-client").LedgerOrderBookService.getTradeById;
|
114
|
+
cancel: typeof import("@tatumio/api-client").LedgerOrderBookService.deleteTrade;
|
115
|
+
cancelByAccount: typeof import("@tatumio/api-client").LedgerOrderBookService.deleteAccountTrades;
|
116
|
+
};
|
117
|
+
transaction: {
|
118
|
+
send: typeof import("@tatumio/api-client").LedgerTransactionService.sendTransaction;
|
119
|
+
sendMultiple: typeof import("@tatumio/api-client").LedgerTransactionService.sendTransactionBatch;
|
120
|
+
getAll: typeof import("@tatumio/api-client").LedgerTransactionService.getTransactions;
|
121
|
+
getAllByAccount: typeof import("@tatumio/api-client").LedgerTransactionService.getTransactionsByAccountId;
|
122
|
+
getAllByCustomer: typeof import("@tatumio/api-client").LedgerTransactionService.getTransactionsByCustomerId;
|
123
|
+
getAllByReference: typeof import("@tatumio/api-client").LedgerTransactionService.getTransactionsByReference;
|
124
|
+
countByAccount: (filter: import("@tatumio/api-client").TransactionFilter) => any;
|
125
|
+
countByCustomer: (filter: import("@tatumio/api-client").TransactionFilterCustomer) => any;
|
126
|
+
};
|
127
|
+
virtualCurrency: {
|
128
|
+
create: typeof import("@tatumio/api-client").LedgerVirtualCurrencyService.createCurrency;
|
129
|
+
mint: typeof import("@tatumio/api-client").LedgerVirtualCurrencyService.mintCurrency;
|
130
|
+
revoke: typeof import("@tatumio/api-client").LedgerVirtualCurrencyService.revokeCurrency;
|
131
|
+
getByName: typeof import("@tatumio/api-client").LedgerVirtualCurrencyService.getCurrency;
|
132
|
+
update: typeof import("@tatumio/api-client").LedgerVirtualCurrencyService.updateCurrency;
|
133
|
+
};
|
134
|
+
blockAmount: {
|
135
|
+
block: typeof import("@tatumio/api-client").LedgerAccountService.blockAmount;
|
136
|
+
unblock: typeof import("@tatumio/api-client").LedgerAccountService.deleteBlockAmount;
|
137
|
+
unblockWithTransaction: typeof import("@tatumio/api-client").LedgerAccountService.unblockAmountWithTransaction;
|
138
|
+
};
|
139
|
+
account: {
|
140
|
+
get: typeof import("@tatumio/api-client").LedgerAccountService.getAccountByAccountId;
|
141
|
+
getAll: typeof import("@tatumio/api-client").LedgerAccountService.getAllAccounts;
|
142
|
+
getByCustomerId: typeof import("@tatumio/api-client").LedgerAccountService.getAccountsByCustomerId;
|
143
|
+
getBalance: typeof import("@tatumio/api-client").LedgerAccountService.getAccountBalance;
|
144
|
+
create: typeof import("@tatumio/api-client").LedgerAccountService.createAccount;
|
145
|
+
createMultiple: typeof import("@tatumio/api-client").LedgerAccountService.createAccountBatch;
|
146
|
+
update: typeof import("@tatumio/api-client").LedgerAccountService.updateAccountByAccountId;
|
147
|
+
getBlockedAmountsByAccountId: typeof import("@tatumio/api-client").LedgerAccountService.getBlockAmountById;
|
148
|
+
activate: typeof import("@tatumio/api-client").LedgerAccountService.activateAccount;
|
149
|
+
deactivate: typeof import("@tatumio/api-client").LedgerAccountService.deactivateAccount;
|
150
|
+
freeze: typeof import("@tatumio/api-client").LedgerAccountService.freezeAccount;
|
151
|
+
unfreeze: typeof import("@tatumio/api-client").LedgerAccountService.unfreezeAccount;
|
152
|
+
generate: (account: import("@tatumio/api-client").CreateAccount, generateNewWalletFn: any, generateNewWallet?: boolean, testnet?: boolean, webhookUrl?: string) => Promise<any>;
|
153
|
+
};
|
154
|
+
};
|
155
|
+
security: {
|
156
|
+
checkMaliciousAddress: typeof import("@tatumio/api-client").SecurityAddressService.checkMalicousAddress;
|
157
|
+
};
|
158
|
+
tatum: {
|
159
|
+
getCredits: typeof import("@tatumio/api-client").TatumServiceService.getCredits;
|
160
|
+
getVersion: typeof import("@tatumio/api-client").TatumServiceService.getVersion;
|
161
|
+
freezeApiKey: typeof import("@tatumio/api-client").TatumServiceService.freezeApiKey;
|
162
|
+
unfreezeApiKey: typeof import("@tatumio/api-client").TatumServiceService.unfreezeApiKey;
|
163
|
+
};
|
164
|
+
};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { SdkError, SdkErrorCode } from '@tatumio/shared-abstract-sdk';
|
2
|
+
export declare type FlowSdkErrorCode = SdkErrorCode.FLOW_MISSING_PRIVATE_KEY | SdkErrorCode.FLOW_MISSING_MNEMONIC;
|
3
|
+
export declare class FlowSdkError extends SdkError {
|
4
|
+
constructor(error: Error | FlowSdkErrorCode);
|
5
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FlowSdkError = void 0;
|
4
|
+
const shared_abstract_sdk_1 = require("@tatumio/shared-abstract-sdk");
|
5
|
+
class FlowSdkError extends shared_abstract_sdk_1.SdkError {
|
6
|
+
constructor(error) {
|
7
|
+
if (typeof error === 'string') {
|
8
|
+
super({
|
9
|
+
code: error,
|
10
|
+
});
|
11
|
+
}
|
12
|
+
else {
|
13
|
+
super({
|
14
|
+
originalError: error,
|
15
|
+
originalErrorAsString: error.name,
|
16
|
+
});
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.FlowSdkError = FlowSdkError;
|
21
|
+
//# sourceMappingURL=flow.sdk.errors.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"flow.sdk.errors.js","sourceRoot":"","sources":["../../../../../../packages/blockchain/flow/src/lib/flow.sdk.errors.ts"],"names":[],"mappings":";;;AAAA,sEAAqE;AAIrE,MAAa,YAAa,SAAQ,8BAAQ;IACxC,YAAY,KAA+B;QACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,KAAK,CAAC;gBACJ,IAAI,EAAE,KAAK;aACZ,CAAC,CAAA;SACH;aAAM;YACL,KAAK,CAAC;gBACJ,aAAa,EAAE,KAAK;gBACpB,qBAAqB,EAAE,KAAK,CAAC,IAAI;aAClC,CAAC,CAAA;SACH;IACH,CAAC;CACF;AAbD,oCAaC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.TatumFlowSDK = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const api_client_1 = require("@tatumio/api-client");
|
6
|
+
const shared_blockchain_abstract_1 = require("@tatumio/shared-blockchain-abstract");
|
7
|
+
const shared_core_1 = require("@tatumio/shared-core");
|
8
|
+
const flow_sdk_wallet_1 = require("./services/flow.sdk.wallet");
|
9
|
+
const flow_tx_1 = require("./services/flow.tx");
|
10
|
+
const flow_kms_1 = require("./services/flow.kms");
|
11
|
+
const blockchain = shared_core_1.Blockchain.FLOW;
|
12
|
+
const TatumFlowSDK = (args) => {
|
13
|
+
const api = api_client_1.BlockchainFlowService;
|
14
|
+
const _a = (0, shared_blockchain_abstract_1.abstractBlockchainSdk)(Object.assign(Object.assign({}, args), { blockchain })), { nft } = _a, abstractSdk = (0, tslib_1.__rest)(_a, ["nft"]);
|
15
|
+
const { deployNFTSmartContract, mintNFT, transferNFT, mintMultipleNFTs, burnNFT, getNFTTransaction, getNFTAccountBalance, getNFTMetadataURI, } = nft;
|
16
|
+
return Object.assign(Object.assign({}, abstractSdk), { api, kms: (0, flow_kms_1.flowKmsService)(Object.assign(Object.assign({}, args), { blockchain })), wallet: (0, flow_sdk_wallet_1.flowWallet)(), transaction: (0, flow_tx_1.flowTxService)(args), nft: {
|
17
|
+
deployNFTSmartContract,
|
18
|
+
mintNFT,
|
19
|
+
transferNFT,
|
20
|
+
mintMultipleNFTs,
|
21
|
+
burnNFT,
|
22
|
+
getNFTTransaction,
|
23
|
+
getNFTAccountBalance,
|
24
|
+
getNFTMetadataURI,
|
25
|
+
}, blockchain: {
|
26
|
+
getCurrentBlock: api_client_1.BlockchainFlowService.flowGetBlockChainInfo,
|
27
|
+
getBlock: api_client_1.BlockchainFlowService.flowGetBlock,
|
28
|
+
getAccount: api_client_1.BlockchainFlowService.flowGetAccount,
|
29
|
+
getTransaction: api_client_1.BlockchainFlowService.flowGetRawTransaction,
|
30
|
+
} });
|
31
|
+
};
|
32
|
+
exports.TatumFlowSDK = TatumFlowSDK;
|
33
|
+
//# sourceMappingURL=flow.sdk.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"flow.sdk.js","sourceRoot":"","sources":["../../../../../../packages/blockchain/flow/src/lib/flow.sdk.ts"],"names":[],"mappings":";;;;AAAA,oDAA2D;AAC3D,oFAA2E;AAC3E,sDAAiD;AAEjD,gEAAuD;AACvD,gDAAkD;AAClD,kDAAoD;AAEpD,MAAM,UAAU,GAAG,wBAAU,CAAC,IAAI,CAAA;AAE3B,MAAM,YAAY,GAAG,CAAC,IAAkB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,kCAAqB,CAAA;IACjC,MAAM,KAA0B,IAAA,kDAAqB,kCAAM,IAAI,KAAE,UAAU,IAAG,EAAxE,EAAE,GAAG,OAAmE,EAA9D,WAAW,2BAArB,OAAuB,CAAiD,CAAA;IAE9E,MAAM,EACJ,sBAAsB,EACtB,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,GAClB,GAAG,GAAG,CAAA;IAEP,uCACK,WAAW,KACd,GAAG,EACH,GAAG,EAAE,IAAA,yBAAc,kCAAM,IAAI,KAAE,UAAU,IAAG,EAC5C,MAAM,EAAE,IAAA,4BAAU,GAAE,EACpB,WAAW,EAAE,IAAA,uBAAa,EAAC,IAAI,CAAC,EAChC,GAAG,EAAE;YACH,sBAAsB;YACtB,OAAO;YACP,WAAW;YACX,gBAAgB;YAChB,OAAO;YACP,iBAAiB;YACjB,oBAAoB;YACpB,iBAAiB;SAClB,EACD,UAAU,EAAE;YACV,eAAe,EAAE,kCAAqB,CAAC,qBAAqB;YAC5D,QAAQ,EAAE,kCAAqB,CAAC,YAAY;YAC5C,UAAU,EAAE,kCAAqB,CAAC,cAAc;YAChD,cAAc,EAAE,kCAAqB,CAAC,qBAAqB;SAC5D,IACF;AACH,CAAC,CAAA;AAtCY,QAAA,YAAY,gBAsCxB"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { SDKArguments } from '@tatumio/shared-abstract-sdk';
|
2
|
+
export declare const flowBlockchain: (args: SDKArguments) => {
|
3
|
+
getSignKey: (isPayer: boolean) => Promise<{
|
4
|
+
keyId: number;
|
5
|
+
address: string;
|
6
|
+
}>;
|
7
|
+
signWithKey: (data: string, isPayer: boolean) => Promise<{
|
8
|
+
signature: string;
|
9
|
+
}>;
|
10
|
+
broadcast: (txData: string, signatureId?: string, proposalKey?: number) => Promise<{
|
11
|
+
txId: string;
|
12
|
+
failed?: boolean;
|
13
|
+
}>;
|
14
|
+
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.flowBlockchain = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const shared_core_1 = require("@tatumio/shared-core");
|
6
|
+
const api_client_1 = require("@tatumio/api-client");
|
7
|
+
const baseUrl = () => process.env['TATUM_API_URL'] || api_client_1.TATUM_API_CONSTANTS.URL;
|
8
|
+
const headers = (xApiKey) => ({
|
9
|
+
headers: {
|
10
|
+
'x-api-key': xApiKey || process.env['TATUM_API_KEY'] || api_client_1.TATUM_API_CONSTANTS.API_KEY,
|
11
|
+
'x-testnet-type': process.env['TESTNET_TYPE'] || 'ethereum-ropsten',
|
12
|
+
},
|
13
|
+
});
|
14
|
+
const post = (xApiKey, url, body) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
15
|
+
const { data } = yield shared_core_1.httpHelper.post(`${baseUrl()}${url}`, body, headers(xApiKey));
|
16
|
+
return data;
|
17
|
+
});
|
18
|
+
const get = (xApiKey, url) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
19
|
+
const { data } = yield shared_core_1.httpHelper.get(`${baseUrl()}${url}`, headers(xApiKey));
|
20
|
+
return data;
|
21
|
+
});
|
22
|
+
// Flow specific methods performing internal tasks on the API
|
23
|
+
const flowBlockchain = (args) => {
|
24
|
+
return {
|
25
|
+
getSignKey: (isPayer) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { return get(args.apiKey, `/v3/flow/proposal/${isPayer}`); }),
|
26
|
+
signWithKey: (data, isPayer) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { return post(args.apiKey, '/v3/flow/sign', { data, isPayer }); }),
|
27
|
+
broadcast: (txData, signatureId, proposalKey) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { return post(args.apiKey, '/v3/flow/broadcast', { txData, signatureId, proposalKey }); }),
|
28
|
+
};
|
29
|
+
};
|
30
|
+
exports.flowBlockchain = flowBlockchain;
|
31
|
+
//# sourceMappingURL=flow.blockchain.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"flow.blockchain.js","sourceRoot":"","sources":["../../../../../../../packages/blockchain/flow/src/lib/services/flow.blockchain.ts"],"names":[],"mappings":";;;;AAAA,sDAAiD;AACjD,oDAAyD;AAGzD,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,gCAAmB,CAAC,GAAG,CAAA;AAE7E,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,EAAE,C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E,oBAAoB,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAA,GAAA;KAChF,CAAA;AACH,CAAC,CAAA;AAbY,QAAA,cAAc,kBAa1B"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Blockchain, ChainTransactionKMS } from '@tatumio/shared-core';
|
2
|
+
export declare const flowKmsService: (args: {
|
3
|
+
apiKey: string;
|
4
|
+
blockchain: Blockchain;
|
5
|
+
}) => {
|
6
|
+
sign(tx: ChainTransactionKMS, fromPrivateKeys: string[], testnet: boolean): Promise<{
|
7
|
+
txId: string;
|
8
|
+
address: string;
|
9
|
+
} | {
|
10
|
+
txId: string;
|
11
|
+
}>;
|
12
|
+
getAllPending(signatures?: string): import("../../../../../../dist/packages/api-client/src").CancelablePromise<import("../../../../../../dist/packages/api-client/src").PendingTransaction[]>;
|
13
|
+
get: typeof import("../../../../../../dist/packages/api-client/src").SecurityKeyManagementSystemService.getPendingTransactionToSign;
|
14
|
+
complete: typeof import("../../../../../../dist/packages/api-client/src").SecurityKeyManagementSystemService.completePendingSignature;
|
15
|
+
delete: typeof import("../../../../../../dist/packages/api-client/src").SecurityKeyManagementSystemService.deletePendingTransactionToSign;
|
16
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.flowKmsService = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const shared_core_1 = require("@tatumio/shared-core");
|
6
|
+
const flow_tx_1 = require("./flow.tx");
|
7
|
+
const shared_blockchain_abstract_1 = require("@tatumio/shared-blockchain-abstract");
|
8
|
+
const flow_constants_1 = require("../flow.constants");
|
9
|
+
const flowKmsService = (args) => {
|
10
|
+
return Object.assign(Object.assign({}, (0, shared_blockchain_abstract_1.abstractBlockchainKms)(args)), { sign(tx, fromPrivateKeys, testnet) {
|
11
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
12
|
+
const txWithChain = Object.assign(Object.assign({}, tx), { chain: shared_core_1.Blockchain.FLOW });
|
13
|
+
const { type, body } = JSON.parse(txWithChain.serializedTransaction);
|
14
|
+
const txService = (0, flow_tx_1.flowTxService)(args);
|
15
|
+
switch (type) {
|
16
|
+
case flow_constants_1.FlowTxType.CREATE_ACCOUNT:
|
17
|
+
return txService.createAccountFromPublicKey(testnet, body.publicKey, body.account, fromPrivateKeys[0]);
|
18
|
+
case flow_constants_1.FlowTxType.ADD_PK_TO_ACCOUNT:
|
19
|
+
return txService.addPublicKeyToAccount(testnet, body.publicKey, body.account, fromPrivateKeys[0]);
|
20
|
+
case flow_constants_1.FlowTxType.TRANSFER:
|
21
|
+
return txService.sendTransaction(testnet, Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] }));
|
22
|
+
case flow_constants_1.FlowTxType.TRANSFER_NFT:
|
23
|
+
return txService.sendNftTransferToken(testnet, Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] }));
|
24
|
+
case flow_constants_1.FlowTxType.MINT_NFT:
|
25
|
+
return txService.sendNftMintToken(testnet, Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] }));
|
26
|
+
case flow_constants_1.FlowTxType.MINT_MULTIPLE_NFT:
|
27
|
+
return txService.sendNftMintMultipleToken(testnet, Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] }));
|
28
|
+
case flow_constants_1.FlowTxType.BURN_NFT:
|
29
|
+
return txService.sendNftBurnToken(testnet, Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] }));
|
30
|
+
default:
|
31
|
+
return txService.sendCustomTransaction(testnet, Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] }));
|
32
|
+
}
|
33
|
+
});
|
34
|
+
} });
|
35
|
+
};
|
36
|
+
exports.flowKmsService = flowKmsService;
|
37
|
+
//# sourceMappingURL=flow.kms.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"flow.kms.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,OAAO,SAAS,CAAC,gBAAgB,CAAC,OAAO,kCAAO,IAAI,KAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAAG,CAAA;oBACzF,KAAK,2BAAU,CAAC,iBAAiB;wBAC/B,OAAO,SAAS,CAAC,wBAAwB,CAAC,OAAO,kCAC5C,IAAI,KACP,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAC9B,CAAA;oBACJ,KAAK,2BAAU,CAAC,QAAQ;wBACtB,OAAO,SAAS,CAAC,gBAAgB,CAAC,OAAO,kCAAO,IAAI,KAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAAG,CAAA;oBACzF;wBACE,OAAO,SAAS,CAAC,qBAAqB,CAAC,OAAO,kCACzC,IAAI,KACP,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAC9B,CAAA;iBACL;YACH,CAAC;SAAA,IACF;AACH,CAAC,CAAA;AAhDY,QAAA,cAAc,kBAgD1B"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.flowWallet = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const shared_core_1 = require("@tatumio/shared-core");
|
6
|
+
const elliptic = (0, tslib_1.__importStar)(require("elliptic"));
|
7
|
+
const bip32_1 = require("bip32");
|
8
|
+
const bip39_1 = require("bip39");
|
9
|
+
const hdkey_1 = (0, tslib_1.__importDefault)(require("hdkey"));
|
10
|
+
const flowWallet = () => {
|
11
|
+
return {
|
12
|
+
generateAddressFromXPub: (xpub, i) => {
|
13
|
+
const w = (0, bip32_1.fromBase58)(xpub).derivePath(String(i));
|
14
|
+
const s = new elliptic.ec('secp256k1').keyFromPublic(w.publicKey).getPublic().encode('hex', false);
|
15
|
+
return s.slice(2);
|
16
|
+
},
|
17
|
+
generateAddressFromPrivateKey: (privateKey) => {
|
18
|
+
const s = new elliptic.ec('secp256k1').keyFromPrivate(privateKey).getPublic().encode('hex', false);
|
19
|
+
return s.slice(2);
|
20
|
+
},
|
21
|
+
generateWallet: (mnemonic) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
22
|
+
mnemonic || (mnemonic = (0, bip39_1.generateMnemonic)(256));
|
23
|
+
const hdwallet = hdkey_1.default.fromMasterSeed(yield (0, bip39_1.mnemonicToSeed)(mnemonic));
|
24
|
+
return {
|
25
|
+
mnemonic,
|
26
|
+
xpub: hdwallet.derive(shared_core_1.DERIVATION_PATH.FLOW).toJSON().xpub,
|
27
|
+
};
|
28
|
+
}),
|
29
|
+
generatePrivateKeyFromMnemonic: (mnemonic, i) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
30
|
+
const key = (0, bip32_1.fromSeed)(yield (0, bip39_1.mnemonicToSeed)(mnemonic))
|
31
|
+
.derivePath(shared_core_1.DERIVATION_PATH.FLOW)
|
32
|
+
.derive(i).privateKey;
|
33
|
+
if (!key)
|
34
|
+
throw new Error('No key generated');
|
35
|
+
return new elliptic.ec('secp256k1').keyFromPrivate(key).getPrivate().toString(16);
|
36
|
+
}),
|
37
|
+
};
|
38
|
+
};
|
39
|
+
exports.flowWallet = flowWallet;
|
40
|
+
//# sourceMappingURL=flow.sdk.wallet.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"flow.sdk.wallet.js","sourceRoot":"","sources":["../../../../../../../packages/blockchain/flow/src/lib/services/flow.sdk.wallet.ts"],"names":[],"mappings":";;;;AAAA,sDAAsD;AACtD,gEAAoC;AACpC,iCAA4C;AAC5C,iCAAwD;AACxD,+DAAyB;AAGlB,MAAM,UAAU,GAAG,GAA2B,EAAE;IACrD,OAAO;QACL,uBAAuB,EAAE,CAAC,IAAY,EAAE,CAAS,EAAU,EAAE;YAC3D,MAAM,CAAC,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YAChD,MAAM,CAAC,GAAG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C,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QACnF,CAAC,CAAA;KACF,CAAA;AACH,CAAC,CAAA;AA3BY,QAAA,UAAU,cA2BtB"}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
import { ChainFlowBurnNft, ChainFlowMintMultipleNft, ChainFlowMintNft, ChainFlowTransferNft, TransferFlow, TransferFlowCustomTx } from '@tatumio/shared-core';
|
2
|
+
import { SDKArguments } from '@tatumio/shared-abstract-sdk';
|
3
|
+
export declare const FLOW_TESTNET_ADDRESSES: {
|
4
|
+
FlowToken: string;
|
5
|
+
FungibleToken: string;
|
6
|
+
FUSD: string;
|
7
|
+
TatumMultiNFT: string;
|
8
|
+
};
|
9
|
+
export declare const FLOW_MAINNET_ADDRESSES: {
|
10
|
+
FlowToken: string;
|
11
|
+
FungibleToken: string;
|
12
|
+
FUSD: string;
|
13
|
+
TatumMultiNFT: string;
|
14
|
+
};
|
15
|
+
export declare const flowTxService: (args: SDKArguments) => {
|
16
|
+
sign: (pk: string, msg: Buffer) => string;
|
17
|
+
getSigner: (pk: string, address: string, keyId?: number) => {
|
18
|
+
signer: (account: any) => any;
|
19
|
+
};
|
20
|
+
getApiSigner: (isPayer: boolean) => {
|
21
|
+
signer: (account: any) => Promise<any>;
|
22
|
+
keyHash: string;
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* Create account on the FLOW network. It automatically creates 100 0-weight proposal keys, which are managed by Tatum API - index 1-100.
|
26
|
+
* Main 1000 weight authorizer key is stored as a first one on index 0.
|
27
|
+
* @param testnet if we use testnet or not
|
28
|
+
* @param publicKey public key to assign to address as authorizer (1000 weight) key
|
29
|
+
* @param signerAddress address of the authorizer creator of the address on the chain
|
30
|
+
* @param signerPrivateKey private key of the authorizer creator of the address on the chain
|
31
|
+
* @param proposer function to obtain proposer key from
|
32
|
+
* @param payer function to obtain payer key from
|
33
|
+
*/
|
34
|
+
createAccountFromPublicKey: (testnet: boolean, publicKey: string, signerAddress: string, signerPrivateKey: string, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
35
|
+
txId: string;
|
36
|
+
address: string;
|
37
|
+
}>;
|
38
|
+
/**
|
39
|
+
* Add public key to existing blockchain address with defined weight
|
40
|
+
* @param testnet
|
41
|
+
* @param publicKey key to add
|
42
|
+
* @param signerAddress address of the authorizer key
|
43
|
+
* @param signerPrivateKey key of the authorize key
|
44
|
+
* @param weight defaults to 1000 - weight of the key
|
45
|
+
* @param proposer function to obtain proposer key from
|
46
|
+
* @param payer function to obtain payer key from
|
47
|
+
*/
|
48
|
+
addPublicKeyToAccount: (testnet: boolean, publicKey: string, signerAddress: string, signerPrivateKey: string, weight?: number, proposer?: (args: any) => any, payer?: (args: any) => any) => Promise<{
|
49
|
+
txId: string;
|
50
|
+
address: string;
|
51
|
+
}>;
|
52
|
+
getNftMetadata: (testnet: boolean, account: string, id: string, contractAddress: string) => Promise<any>;
|
53
|
+
getNftTokenByAddress: (testnet: boolean, account: string, tokenType: string) => Promise<any>;
|
54
|
+
/**
|
55
|
+
* Send Flow NFT mint token transaction to the blockchain. This method broadcasts signed transaction to the blockchain.
|
56
|
+
* This operation is irreversible.
|
57
|
+
* @param testnet
|
58
|
+
* @param body content of the transaction to broadcast
|
59
|
+
* @param proposer function to obtain proposer key from
|
60
|
+
* @param payer function to obtain payer key from
|
61
|
+
* @returns txId id of the transaction in the blockchain
|
62
|
+
*/
|
63
|
+
sendNftMintToken: (testnet: boolean, body: ChainFlowMintNft, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
64
|
+
txId: string;
|
65
|
+
tokenId: string;
|
66
|
+
}>;
|
67
|
+
/**
|
68
|
+
* Send Flow NFT mint multiple tokens transaction to the blockchain. This method broadcasts signed transaction to the blockchain.
|
69
|
+
* This operation is irreversible.
|
70
|
+
* @param testnet
|
71
|
+
* @param body content of the transaction to broadcast
|
72
|
+
* @param proposer function to obtain proposer key from
|
73
|
+
* @param payer function to obtain payer key from
|
74
|
+
* @returns txId id of the transaction in the blockchain
|
75
|
+
*/
|
76
|
+
sendNftMintMultipleToken: (testnet: boolean, body: ChainFlowMintMultipleNft, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
77
|
+
txId: string;
|
78
|
+
tokenId: number[];
|
79
|
+
}>;
|
80
|
+
/**
|
81
|
+
* Send Flow NFT transfer token transaction to the blockchain. This method broadcasts signed transaction to the blockchain.
|
82
|
+
* This operation is irreversible.
|
83
|
+
* @param testnet
|
84
|
+
* @param body content of the transaction to broadcast
|
85
|
+
* @param proposer function to obtain proposer key from
|
86
|
+
* @param payer function to obtain payer key from
|
87
|
+
* @returns {txId: string, events: any[]} id of the transaction in the blockchain and events this tx produced
|
88
|
+
*/
|
89
|
+
sendNftTransferToken: (testnet: boolean, body: ChainFlowTransferNft, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
90
|
+
txId: string;
|
91
|
+
}>;
|
92
|
+
/**
|
93
|
+
* Send Flow NFT burn token transaction to the blockchain. This method broadcasts signed transaction to the blockchain.
|
94
|
+
* This operation is irreversible.
|
95
|
+
* @param testnet
|
96
|
+
* @param body content of the transaction to broadcast
|
97
|
+
* @param proposer function to obtain proposer key from
|
98
|
+
* @param payer function to obtain payer key from
|
99
|
+
* @returns txId id of the transaction in the blockchain
|
100
|
+
*/
|
101
|
+
sendNftBurnToken: (testnet: boolean, body: ChainFlowBurnNft, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
102
|
+
txId: string;
|
103
|
+
}>;
|
104
|
+
/**
|
105
|
+
* Send custom transaction to the FLOW network
|
106
|
+
* @param testnet
|
107
|
+
* @param body content of the transaction to broadcast
|
108
|
+
* @param proposer function to obtain proposer key from
|
109
|
+
* @param payer function to obtain payer key from
|
110
|
+
* @returns txId id of the transaction in the blockchain
|
111
|
+
*/
|
112
|
+
sendCustomTransaction: (testnet: boolean, body: TransferFlowCustomTx, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
113
|
+
txId: string;
|
114
|
+
events: any[];
|
115
|
+
}>;
|
116
|
+
/**
|
117
|
+
* Send FLOW or FUSD from account to account.
|
118
|
+
* @param testnet
|
119
|
+
* @param body content of the transaction to broadcast
|
120
|
+
* @param proposer function to obtain proposer key from
|
121
|
+
* @param payer function to obtain payer key from
|
122
|
+
* @returns txId id of the transaction in the blockchain
|
123
|
+
*/
|
124
|
+
sendTransaction: (testnet: boolean, body: TransferFlow, proposer?: (isPayer: boolean) => any, payer?: (isPayer: boolean) => any) => Promise<{
|
125
|
+
txId: string;
|
126
|
+
}>;
|
127
|
+
};
|