@tatumio/flow 2.0.1-alpha.375 → 2.0.1-alpha.377
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 +10 -10
- package/src/lib/flow.sdk.d.ts +56 -57
- package/src/lib/flow.sdk.js +7 -17
- package/src/lib/flow.sdk.js.map +1 -1
- package/src/lib/services/flow.account.d.ts +25 -0
- package/src/lib/services/flow.account.js +92 -0
- package/src/lib/services/flow.account.js.map +1 -0
- package/src/lib/services/flow.kms.d.ts +1 -1
- package/src/lib/services/flow.kms.js +8 -8
- package/src/lib/services/flow.kms.js.map +1 -1
- package/src/lib/services/flow.nft.d.ts +57 -0
- package/src/lib/services/flow.nft.js +213 -0
- package/src/lib/services/flow.nft.js.map +1 -0
- package/src/lib/services/flow.sdk.wallet.d.ts +1 -4
- package/src/lib/services/flow.sdk.wallet.js +5 -22
- package/src/lib/services/flow.sdk.wallet.js.map +1 -1
- package/src/lib/services/flow.tx.d.ts +42 -104
- package/src/lib/services/flow.tx.js +57 -448
- package/src/lib/services/flow.tx.js.map +1 -1
- package/src/lib/services/flow.virtualAccount.js +1 -1
- package/src/lib/services/flow.virtualAccount.js.map +1 -1
- package/src/lib/utils/flow.utils.d.ts +47 -0
- package/src/lib/utils/flow.utils.js +143 -0
- package/src/lib/utils/flow.utils.js.map +1 -0
- package/src/lib/utils/flow.wallet.utils.d.ts +7 -0
- package/src/lib/utils/flow.wallet.utils.js +37 -0
- package/src/lib/utils/flow.wallet.utils.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tatumio/flow",
|
|
3
|
-
"version": "2.0.1-alpha.
|
|
3
|
+
"version": "2.0.1-alpha.377",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@tatumio/api-client": "2.0.1-alpha.
|
|
8
|
+
"@tatumio/api-client": "2.0.1-alpha.377",
|
|
9
9
|
"axios": "^0.26.0",
|
|
10
10
|
"form-data": "^4.0.0",
|
|
11
|
-
"@tatumio/shared-testing-common": "2.0.1-alpha.
|
|
11
|
+
"@tatumio/shared-testing-common": "2.0.1-alpha.377",
|
|
12
12
|
"dedent-js": "^1.0.1",
|
|
13
|
-
"@tatumio/shared-core": "2.0.1-alpha.
|
|
14
|
-
"@tatumio/shared-abstract-sdk": "2.0.1-alpha.
|
|
13
|
+
"@tatumio/shared-core": "2.0.1-alpha.377",
|
|
14
|
+
"@tatumio/shared-abstract-sdk": "2.0.1-alpha.377",
|
|
15
15
|
"bignumber.js": "^9.0.2",
|
|
16
16
|
"lodash": "^4.17.21",
|
|
17
|
-
"@tatumio/shared-blockchain-abstract": "2.0.1-alpha.
|
|
17
|
+
"@tatumio/shared-blockchain-abstract": "2.0.1-alpha.377",
|
|
18
|
+
"@onflow/util-encode-key": "^1.0.3",
|
|
19
|
+
"sha3": "^2.1.4",
|
|
20
|
+
"@onflow/fcl": "^1.3.2",
|
|
21
|
+
"@onflow/types": "^1.0.5",
|
|
18
22
|
"bip32": "^2.0.5",
|
|
19
23
|
"bip39": "^3.0.2",
|
|
20
24
|
"hdkey": "^2.0.1",
|
|
21
|
-
"@onflow/fcl": "^1.3.2",
|
|
22
|
-
"@onflow/types": "^1.0.5",
|
|
23
|
-
"@onflow/util-encode-key": "^1.0.3",
|
|
24
|
-
"sha3": "^2.1.4",
|
|
25
25
|
"tslib": "^2.0.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {}
|
package/src/lib/flow.sdk.d.ts
CHANGED
|
@@ -20,61 +20,77 @@ export declare const TatumFlowSDK: (args: FlowSDKArguments) => {
|
|
|
20
20
|
wallet: {
|
|
21
21
|
generateAddressFromXPub: (xpub: string, i: number) => string;
|
|
22
22
|
generateAddressFromPrivateKey: (privateKey: string) => string;
|
|
23
|
-
generateWallet: (mnemonic?: string | undefined) => Promise<
|
|
24
|
-
mnemonic: string;
|
|
25
|
-
xpub: string;
|
|
26
|
-
}>;
|
|
23
|
+
generateWallet: (mnemonic?: string | undefined) => Promise<import("@tatumio/api-client").Wallet>;
|
|
27
24
|
generatePrivateKeyFromMnemonic: (mnemonic: string, i: number) => Promise<string>;
|
|
28
25
|
};
|
|
29
26
|
transaction: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
getApiSigner: (isPayer: boolean) => {
|
|
35
|
-
signer: (account: import("./flow.types").Account) => Promise<import("./flow.types").AccountAuthorization>;
|
|
36
|
-
keyHash: string;
|
|
37
|
-
};
|
|
38
|
-
createAccountFromPublicKey: (body: import("./services/flow.tx").CreateAddressFromPubKey, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").SignatureId | {
|
|
39
|
-
txId?: string | undefined;
|
|
40
|
-
address?: string | undefined;
|
|
41
|
-
}>;
|
|
42
|
-
addPublicKeyToAccount: (body: import("./services/flow.tx").CreateAddressFromPubKey, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
43
|
-
nft: {
|
|
44
|
-
getNftMetadata: (account: string, id: string, contractAddress: string) => Promise<any>;
|
|
45
|
-
getNftTokenByAddress: (account: string, tokenType: string) => Promise<any>;
|
|
46
|
-
sendNftMintToken: (body: import("./services/flow.tx").MintFlowNft, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId | import("@tatumio/api-client").FlowMintedResult | import("@tatumio/api-client").SolanaMintedResult | import("@tatumio/api-client").AlgorandMintedResult>;
|
|
47
|
-
sendNftMintMultipleToken: (body: import("./services/flow.tx").MintMultipleFlowNft, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId | import("@tatumio/api-client").FlowMintedMultipleResult>;
|
|
48
|
-
sendNftTransferToken: (body: import("./services/flow.tx").TransferFlowNft, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
49
|
-
sendNftBurnToken: (body: import("./services/flow.tx").BurnFlowNft, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
27
|
+
send: {
|
|
28
|
+
transferSignedTransaction: (body: import("./utils/flow.utils").TransferFlow, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
29
|
+
customSignedTransaction: (body: import("./utils/flow.utils").TransferFlowCustomTx, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
50
30
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
burnNftTokenTxTemplate: (testnet: boolean) => string;
|
|
60
|
-
transferNftTokenTxTemplate: (testnet: boolean) => string;
|
|
61
|
-
prepareAddPublicKeyToAccountTxTemplate: () => string;
|
|
62
|
-
prepareTransferTxTemplate: (testnet: boolean, tokenAddress: string, tokenName: string, tokenStorage: string) => string;
|
|
63
|
-
prepareBalanceTxTemplate: (testnet: boolean, tokenAddress: string, tokenName: string, tokenStorage: string) => string;
|
|
64
|
-
prepareCreateAccountWithFUSDFromPublicKeyTxTemplate: (testnet: boolean) => string;
|
|
31
|
+
};
|
|
32
|
+
account: {
|
|
33
|
+
send: {
|
|
34
|
+
createSignedTransaction: (body: import("./utils/flow.utils").CreateAddressFromPubKey, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").SignatureId | {
|
|
35
|
+
txId?: string | undefined;
|
|
36
|
+
address?: string | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
publicKeySignedTransaction: (body: import("./utils/flow.utils").CreateAddressFromPubKey, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
65
39
|
};
|
|
66
40
|
};
|
|
67
41
|
nft: {
|
|
68
42
|
deployNFTSmartContract: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftDeployErc721;
|
|
43
|
+
addNFTMinter: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftAddMinter;
|
|
69
44
|
mintNFT: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftMintErc721;
|
|
70
|
-
transferNFT: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftTransferErc721;
|
|
71
45
|
mintMultipleNFTs: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftMintMultipleErc721;
|
|
72
46
|
burnNFT: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftBurnErc721;
|
|
47
|
+
transferNFT: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftTransferErc721;
|
|
48
|
+
updateNFTRoyalty: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftUpdateCashbackErc721;
|
|
73
49
|
getNFTTransaction: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetTransactErc721;
|
|
74
|
-
|
|
50
|
+
getNFTTransactionsByToken: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetTransactionByToken;
|
|
51
|
+
getNFTTransactionsByAddress: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetTransactionByAddress;
|
|
52
|
+
getNFTsByAddress: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetTokensByAddressErc721;
|
|
53
|
+
getNFTProvenanceData: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetProvenanceDataErc721;
|
|
75
54
|
getNFTMetadataURI: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetMetadataErc721;
|
|
55
|
+
getNFTRoyalty: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetRoyaltyErc721;
|
|
56
|
+
getNFTAccountBalance: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetBalanceErc721;
|
|
57
|
+
getNFTContractAddress: typeof import("@tatumio/api-client").NftErc721OrCompatibleService.nftGetContractAddress;
|
|
58
|
+
getNFTImage: (chain: "FLOW" | "ETH" | "MATIC" | "KCS" | "SOL" | "ONE" | "KLAY" | "CELO" | "TRON" | "BSC", contractAddress: string, tokenId: string, account?: string | undefined) => Promise<{
|
|
59
|
+
originalUrl: string;
|
|
60
|
+
publicUrl: string;
|
|
61
|
+
}>;
|
|
62
|
+
prepareAddNftMinterAbstraction: (body: import("@tatumio/api-client").AddNftMinter | import("@tatumio/api-client").AddNftMinterKMS) => string[];
|
|
63
|
+
getNftMetadata: (account: string, id: string, contractAddress: string) => Promise<any>;
|
|
64
|
+
getNftTokenByAddress: (account: string, tokenType: string) => Promise<any>;
|
|
65
|
+
send: {
|
|
66
|
+
mintSignedTransaction: (body: import("./utils/flow.utils").MintFlowNft, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId | import("@tatumio/api-client").FlowMintedResult | import("@tatumio/api-client").SolanaMintedResult | import("@tatumio/api-client").AlgorandMintedResult>;
|
|
67
|
+
mintMultipleSignedTransaction: (body: import("./utils/flow.utils").MintMultipleFlowNft, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId | import("@tatumio/api-client").FlowMintedMultipleResult>;
|
|
68
|
+
transferSignedTransaction: (body: import("./utils/flow.utils").TransferFlowNft, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
69
|
+
burnSignedTransaction: (body: import("./utils/flow.utils").BurnFlowNft, proposer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined, payer?: ((isPayer: boolean) => import("./flow.types").AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
storage: {
|
|
73
|
+
upload: typeof import("@tatumio/api-client").IpfsService.storeIpfs;
|
|
74
|
+
get: typeof import("@tatumio/api-client").IpfsService.getIpfsData;
|
|
75
|
+
};
|
|
76
|
+
templates: {
|
|
77
|
+
deployNftTokenTypeWithMinterTxTemplate: (testnet: boolean) => string;
|
|
78
|
+
metadataNftTokenScript: (testnet: boolean) => string;
|
|
79
|
+
tokenByAddressNftTokenScript: (testnet: boolean) => string;
|
|
80
|
+
mintNftTokenTxTemplate: (testnet: boolean) => string;
|
|
81
|
+
mintMultipleNftTokenTxTemplate: (testnet: boolean) => string;
|
|
82
|
+
burnNftTokenTxTemplate: (testnet: boolean) => string;
|
|
83
|
+
transferNftTokenTxTemplate: (testnet: boolean) => string;
|
|
84
|
+
prepareAddPublicKeyToAccountTxTemplate: () => string;
|
|
85
|
+
prepareTransferTxTemplate: (testnet: boolean, tokenAddress: string, tokenName: string, tokenStorage: string) => string;
|
|
86
|
+
prepareBalanceTxTemplate: (testnet: boolean, tokenAddress: string, tokenName: string, tokenStorage: string) => string;
|
|
87
|
+
prepareCreateAccountWithFUSDFromPublicKeyTxTemplate: (testnet: boolean) => string;
|
|
76
88
|
};
|
|
77
89
|
blockchain: {
|
|
90
|
+
broadcast: (txData: string, signatureId?: string | undefined, proposalKey?: number | undefined) => Promise<{
|
|
91
|
+
txId: string;
|
|
92
|
+
failed?: boolean | undefined;
|
|
93
|
+
}>;
|
|
78
94
|
getCurrentBlock: typeof FlowService.flowGetBlockChainInfo;
|
|
79
95
|
getBlock: typeof FlowService.flowGetBlock;
|
|
80
96
|
getAccount: typeof FlowService.flowGetAccount;
|
|
@@ -104,17 +120,7 @@ export declare const TatumFlowSDK: (args: FlowSDKArguments) => {
|
|
|
104
120
|
};
|
|
105
121
|
storeTokenAddress: any;
|
|
106
122
|
};
|
|
107
|
-
call: {
|
|
108
|
-
broadcast: (txData: string, signatureId?: string | undefined, proposalKey?: number | undefined) => Promise<{
|
|
109
|
-
txId: string;
|
|
110
|
-
failed?: boolean | undefined;
|
|
111
|
-
}>;
|
|
112
|
-
};
|
|
113
123
|
getExchangeRate(basePair?: import("@tatumio/api-client").Fiat | undefined): import("@tatumio/api-client").CancelablePromise<import("@tatumio/api-client").ExchangeRate>;
|
|
114
|
-
storage: {
|
|
115
|
-
upload: typeof import("@tatumio/api-client").IpfsService.storeIpfs;
|
|
116
|
-
get: typeof import("@tatumio/api-client").IpfsService.getIpfsData;
|
|
117
|
-
};
|
|
118
124
|
subscriptions: typeof import("@tatumio/api-client").NotificationSubscriptionsService;
|
|
119
125
|
security: {
|
|
120
126
|
checkMaliciousAddress: typeof import("@tatumio/api-client").MaliciousAddressService.checkMalicousAddress;
|
|
@@ -125,13 +131,6 @@ export declare const TatumFlowSDK: (args: FlowSDKArguments) => {
|
|
|
125
131
|
freezeApiKey: typeof import("@tatumio/api-client").ServiceUtilsService.freezeApiKey;
|
|
126
132
|
unfreezeApiKey: typeof import("@tatumio/api-client").ServiceUtilsService.unfreezeApiKey;
|
|
127
133
|
};
|
|
128
|
-
custodialManagedWallet: {
|
|
129
|
-
transfer: typeof import("@tatumio/api-client").CustodialManagedWalletsService.custodialTransferManagedAddress;
|
|
130
|
-
getAll: typeof import("@tatumio/api-client").CustodialManagedWalletsService.custodialGetWallets;
|
|
131
|
-
create: typeof import("@tatumio/api-client").CustodialManagedWalletsService.custodialCreateWallet;
|
|
132
|
-
delete: typeof import("@tatumio/api-client").CustodialManagedWalletsService.custodialDeleteWallet;
|
|
133
|
-
get: typeof import("@tatumio/api-client").CustodialManagedWalletsService.custodialGetWallet;
|
|
134
|
-
};
|
|
135
134
|
ledger: {
|
|
136
135
|
customer: {
|
|
137
136
|
get: typeof import("@tatumio/api-client").CustomerService.getCustomerByExternalOrInternalId;
|
package/src/lib/flow.sdk.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TatumFlowSDK = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const api_client_1 = require("@tatumio/api-client");
|
|
6
5
|
const shared_blockchain_abstract_1 = require("@tatumio/shared-blockchain-abstract");
|
|
7
6
|
const shared_core_1 = require("@tatumio/shared-core");
|
|
7
|
+
const shared_abstract_sdk_1 = require("@tatumio/shared-abstract-sdk");
|
|
8
8
|
const flow_sdk_wallet_1 = require("./services/flow.sdk.wallet");
|
|
9
9
|
const flow_tx_1 = require("./services/flow.tx");
|
|
10
10
|
const flow_kms_1 = require("./services/flow.kms");
|
|
@@ -14,31 +14,21 @@ const flow_virtualAccount_1 = require("./services/flow.virtualAccount");
|
|
|
14
14
|
const blockchain = shared_core_1.Blockchain.FLOW;
|
|
15
15
|
const TatumFlowSDK = (args) => {
|
|
16
16
|
const api = api_client_1.FlowService;
|
|
17
|
-
const
|
|
17
|
+
const abstractSdk = (0, shared_blockchain_abstract_1.abstractBlockchainSdk)(Object.assign(Object.assign({}, args), { blockchain }));
|
|
18
|
+
const { nft, storage } = (0, shared_abstract_sdk_1.abstractSdkNft)();
|
|
18
19
|
const virtualAccount = (0, flow_virtualAccount_1.virtualAccountService)({ blockchain });
|
|
19
20
|
const provider = (0, flow_provider_1.flowProvider)(Object.assign({}, args));
|
|
20
21
|
const flowBlockchainCalls = (0, flow_blockchain_1.flowBlockchain)(args);
|
|
21
|
-
const txService = (0, flow_tx_1.flowTxService)(provider,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
deployNFTSmartContract,
|
|
25
|
-
mintNFT,
|
|
26
|
-
transferNFT,
|
|
27
|
-
mintMultipleNFTs,
|
|
28
|
-
burnNFT,
|
|
29
|
-
getNFTTransaction,
|
|
30
|
-
getNFTAccountBalance,
|
|
31
|
-
getNFTMetadataURI,
|
|
32
|
-
}, blockchain: {
|
|
22
|
+
const txService = (0, flow_tx_1.flowTxService)(provider, flowBlockchainCalls);
|
|
23
|
+
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: txService.native, account: txService.account, nft: Object.assign(Object.assign({}, txService.nft), nft), storage, templates: txService.templates, blockchain: {
|
|
24
|
+
broadcast: flowBlockchainCalls.broadcast,
|
|
33
25
|
getCurrentBlock: api_client_1.FlowService.flowGetBlockChainInfo,
|
|
34
26
|
getBlock: api_client_1.FlowService.flowGetBlock,
|
|
35
27
|
getAccount: api_client_1.FlowService.flowGetAccount,
|
|
36
28
|
getTransaction: api_client_1.FlowService.flowGetRawTransaction,
|
|
37
29
|
smartContractGetAddress: api_client_1.BlockchainUtilsService.scGetContractAddress,
|
|
38
30
|
generateAddress: api_client_1.FlowService.flowGenerateAddress,
|
|
39
|
-
}, virtualAccount
|
|
40
|
-
broadcast: flowBlockchainCalls.broadcast,
|
|
41
|
-
} });
|
|
31
|
+
}, virtualAccount });
|
|
42
32
|
};
|
|
43
33
|
exports.TatumFlowSDK = TatumFlowSDK;
|
|
44
34
|
//# sourceMappingURL=flow.sdk.js.map
|
package/src/lib/flow.sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.sdk.js","sourceRoot":"","sources":["../../../../../../packages/blockchain/flow/src/lib/flow.sdk.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow.sdk.js","sourceRoot":"","sources":["../../../../../../packages/blockchain/flow/src/lib/flow.sdk.ts"],"names":[],"mappings":";;;AAAA,oDAAyE;AACzE,oFAA2E;AAC3E,sDAAiD;AACjD,sEAA2E;AAC3E,gEAAuD;AACvD,gDAAkD;AAClD,kDAAoD;AACpD,gEAA2D;AAC3D,4DAAuD;AACvD,wEAAsE;AAEtE,MAAM,UAAU,GAAG,wBAAU,CAAC,IAAI,CAAA;AAM3B,MAAM,YAAY,GAAG,CAAC,IAAsB,EAAE,EAAE;IACrD,MAAM,GAAG,GAAG,wBAAW,CAAA;IACvB,MAAM,WAAW,GAAG,IAAA,kDAAqB,kCAAM,IAAI,KAAE,UAAU,IAAG,CAAA;IAClE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,IAAA,oCAAc,GAAE,CAAA;IACzC,MAAM,cAAc,GAAG,IAAA,2CAAqB,EAAC,EAAE,UAAU,EAAE,CAAC,CAAA;IAC5D,MAAM,QAAQ,GAAG,IAAA,4BAAY,oBAAM,IAAI,EAAG,CAAA;IAC1C,MAAM,mBAAmB,GAAG,IAAA,gCAAc,EAAC,IAAI,CAAC,CAAA;IAChD,MAAM,SAAS,GAAG,IAAA,uBAAa,EAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAA;IAE9D,uCACK,WAAW,KACd,GAAG,EACH,GAAG,EAAE,IAAA,yBAAc,kCAAM,IAAI,KAAE,UAAU,IAAG,EAC5C,MAAM,EAAE,IAAA,4BAAU,GAAE,EACpB,WAAW,EAAE,SAAS,CAAC,MAAM,EAC7B,OAAO,EAAE,SAAS,CAAC,OAAO,EAC1B,GAAG,kCACE,SAAS,CAAC,GAAG,GACb,GAAG,GAER,OAAO,EACP,SAAS,EAAE,SAAS,CAAC,SAAS,EAC9B,UAAU,EAAE;YACV,SAAS,EAAE,mBAAmB,CAAC,SAAS;YACxC,eAAe,EAAE,wBAAW,CAAC,qBAAqB;YAClD,QAAQ,EAAE,wBAAW,CAAC,YAAY;YAClC,UAAU,EAAE,wBAAW,CAAC,cAAc;YACtC,cAAc,EAAE,wBAAW,CAAC,qBAAqB;YACjD,uBAAuB,EAAE,mCAAsB,CAAC,oBAAoB;YACpE,eAAe,EAAE,wBAAW,CAAC,mBAAmB;SACjD,EACD,cAAc,IACf;AACH,CAAC,CAAA;AAjCY,QAAA,YAAY,gBAiCxB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FlowProvider } from './flow.provider';
|
|
2
|
+
import { CreateAddressFromPubKey, FlowApiCalls } from '../utils/flow.utils';
|
|
3
|
+
import { AccountSigner } from '@tatumio/flow';
|
|
4
|
+
export declare const flowAccountService: (provider: FlowProvider, apiCalls: FlowApiCalls) => {
|
|
5
|
+
send: {
|
|
6
|
+
/**
|
|
7
|
+
* Create account on the FLOW network. It automatically creates 100 0-weight proposal keys, which are managed by Tatum API - index 1-100.
|
|
8
|
+
* Main 1000 weight authorizer key is stored as a first one on index 0.
|
|
9
|
+
* @param body content of the transaction to broadcast
|
|
10
|
+
* @param proposer function to obtain proposer key from
|
|
11
|
+
* @param payer function to obtain payer key from
|
|
12
|
+
*/
|
|
13
|
+
createSignedTransaction: (body: CreateAddressFromPubKey, proposer?: ((isPayer: boolean) => AccountSigner) | undefined, payer?: ((isPayer: boolean) => AccountSigner) | undefined) => Promise<import("@tatumio/api-client").SignatureId | {
|
|
14
|
+
txId?: string | undefined;
|
|
15
|
+
address?: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Add public key to existing blockchain address with defined weight
|
|
19
|
+
* @param body content of the transaction to broadcast
|
|
20
|
+
* @param proposer function to obtain proposer key from
|
|
21
|
+
* @param payer function to obtain payer key from
|
|
22
|
+
*/
|
|
23
|
+
publicKeySignedTransaction: (body: CreateAddressFromPubKey, proposer?: ((isPayer: boolean) => AccountSigner) | undefined, payer?: ((isPayer: boolean) => AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flowAccountService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const flow_utils_1 = require("../utils/flow.utils");
|
|
6
|
+
const flow_tx_templates_1 = require("./flow.tx.templates");
|
|
7
|
+
const util_encode_key_1 = require("@onflow/util-encode-key");
|
|
8
|
+
const flow_sdk_errors_1 = require("../flow.sdk.errors");
|
|
9
|
+
const shared_abstract_sdk_1 = require("@tatumio/shared-abstract-sdk");
|
|
10
|
+
const api_client_1 = require("@tatumio/api-client");
|
|
11
|
+
const flowAccountService = (provider, apiCalls) => {
|
|
12
|
+
const txTemplates = (0, flow_tx_templates_1.flowTxTemplates)();
|
|
13
|
+
const createSignedTransaction = (body, proposer, payer) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
var _a;
|
|
15
|
+
const code = txTemplates.prepareCreateAccountWithFUSDFromPublicKeyTxTemplate(provider.isTestnet());
|
|
16
|
+
const encodedPublicKey = (0, util_encode_key_1.encodeKey)(body.publicKey, util_encode_key_1.ECDSA_secp256k1, util_encode_key_1.SHA3_256, 1000);
|
|
17
|
+
const txArgs = [{ type: 'String', value: encodedPublicKey }];
|
|
18
|
+
const pk = yield flow_utils_1.flowUtils.getPrivateKey(body);
|
|
19
|
+
if (!pk)
|
|
20
|
+
throw new flow_sdk_errors_1.FlowSdkError({ code: shared_abstract_sdk_1.SdkErrorCode.FLOW_MISSING_PRIVATE_KEY });
|
|
21
|
+
const auth = flow_utils_1.flowUtils.getSigner(pk, body.account).signer;
|
|
22
|
+
const { signer: proposalSigner, keyHash } = proposer
|
|
23
|
+
? proposer(false)
|
|
24
|
+
: flow_utils_1.flowUtils.getApiSigner(apiCalls, false);
|
|
25
|
+
const { signer: payerSigner } = payer ? payer(true) : flow_utils_1.flowUtils.getApiSigner(apiCalls, true);
|
|
26
|
+
const result = yield flow_utils_1.flowUtils.sendTransaction(apiCalls, {
|
|
27
|
+
code,
|
|
28
|
+
txArgs,
|
|
29
|
+
proposer: proposalSigner,
|
|
30
|
+
authorizations: [auth],
|
|
31
|
+
payer: payerSigner,
|
|
32
|
+
keyHash,
|
|
33
|
+
}, provider.getProvider());
|
|
34
|
+
return {
|
|
35
|
+
txId: result.id,
|
|
36
|
+
address: (_a = result.events.find((e) => e.type === 'flow.AccountCreated')) === null || _a === void 0 ? void 0 : _a.data.address,
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const publicKeySignedTransaction = (body, proposer, payer) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const code = txTemplates.prepareAddPublicKeyToAccountTxTemplate();
|
|
41
|
+
const encodedPublicKey = (0, util_encode_key_1.encodeKey)(body.publicKey, util_encode_key_1.ECDSA_secp256k1, util_encode_key_1.SHA3_256, body.weight || 0);
|
|
42
|
+
const txArgs = [{ type: 'String', value: encodedPublicKey }];
|
|
43
|
+
const pk = yield flow_utils_1.flowUtils.getPrivateKey(body);
|
|
44
|
+
if (!pk)
|
|
45
|
+
throw new flow_sdk_errors_1.FlowSdkError({ code: shared_abstract_sdk_1.SdkErrorCode.FLOW_MISSING_PRIVATE_KEY });
|
|
46
|
+
const auth = flow_utils_1.flowUtils.getSigner(pk, body.account).signer;
|
|
47
|
+
const { signer: proposalSigner, keyHash } = proposer
|
|
48
|
+
? proposer(false)
|
|
49
|
+
: flow_utils_1.flowUtils.getApiSigner(apiCalls, false);
|
|
50
|
+
const { signer: payerSigner } = payer ? payer(true) : flow_utils_1.flowUtils.getApiSigner(apiCalls, true);
|
|
51
|
+
const result = yield flow_utils_1.flowUtils.sendTransaction(apiCalls, {
|
|
52
|
+
code,
|
|
53
|
+
txArgs,
|
|
54
|
+
proposer: proposalSigner,
|
|
55
|
+
authorizations: [auth],
|
|
56
|
+
keyHash,
|
|
57
|
+
payer: payerSigner,
|
|
58
|
+
}, provider.getProvider());
|
|
59
|
+
return { txId: result.id, address: result.events[0].data.address };
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
send: {
|
|
63
|
+
/**
|
|
64
|
+
* Create account on the FLOW network. It automatically creates 100 0-weight proposal keys, which are managed by Tatum API - index 1-100.
|
|
65
|
+
* Main 1000 weight authorizer key is stored as a first one on index 0.
|
|
66
|
+
* @param body content of the transaction to broadcast
|
|
67
|
+
* @param proposer function to obtain proposer key from
|
|
68
|
+
* @param payer function to obtain payer key from
|
|
69
|
+
*/
|
|
70
|
+
createSignedTransaction: (body, proposer, payer) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
+
if (body.signatureId) {
|
|
72
|
+
return api_client_1.ApiServices.blockchain.flow.flowCreateAddressFromPubKey(body);
|
|
73
|
+
}
|
|
74
|
+
return createSignedTransaction(body, proposer, payer);
|
|
75
|
+
}),
|
|
76
|
+
/**
|
|
77
|
+
* Add public key to existing blockchain address with defined weight
|
|
78
|
+
* @param body content of the transaction to broadcast
|
|
79
|
+
* @param proposer function to obtain proposer key from
|
|
80
|
+
* @param payer function to obtain payer key from
|
|
81
|
+
*/
|
|
82
|
+
publicKeySignedTransaction: (body, proposer, payer) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
83
|
+
if (body.signatureId) {
|
|
84
|
+
return api_client_1.ApiServices.blockchain.flow.flowAddPubKeyToAddress(body);
|
|
85
|
+
}
|
|
86
|
+
return publicKeySignedTransaction(body, proposer, payer);
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
exports.flowAccountService = flowAccountService;
|
|
92
|
+
//# sourceMappingURL=flow.account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.account.js","sourceRoot":"","sources":["../../../../../../../packages/blockchain/flow/src/lib/services/flow.account.ts"],"names":[],"mappings":";;;;AACA,oDAAsF;AACtF,2DAAqD;AAErD,6DAA8E;AAC9E,wDAAiD;AACjD,sEAA2D;AAC3D,oDAAiF;AAE1E,MAAM,kBAAkB,GAAG,CAAC,QAAsB,EAAE,QAAsB,EAAE,EAAE;IACnF,MAAM,WAAW,GAAG,IAAA,mCAAe,GAAE,CAAA;IAErC,MAAM,uBAAuB,GAAG,CAC9B,IAA6B,EAC7B,QAA8C,EAC9C,KAA2C,EACC,EAAE;;QAC9C,MAAM,IAAI,GAAG,WAAW,CAAC,mDAAmD,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAA;QAClG,MAAM,gBAAgB,GAAG,IAAA,2BAAS,EAAC,IAAI,CAAC,SAAS,EAAE,iCAAe,EAAE,0BAAQ,EAAE,IAAI,CAAC,CAAA;QACnF,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAA;QAE5D,MAAM,EAAE,GAAG,MAAM,sBAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;QAC9C,IAAI,CAAC,EAAE;YAAE,MAAM,IAAI,8BAAY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MG;YACH,uBAAuB,EAAE,CACvB,IAA6B,EAC7B,QAA8C,EAC9C,KAA2C,EAC3C,EAAE;gBACF,IAAI,IAAI,CAAC,WAAW,EAAE;oBACpB,OAAO,wBAAW,CAAC,UAAU,CAAC,IAAI,CAAC,2BAA2B,CAC5D,IAAsC,CACvC,CAAA;iBACF;gBACD,OAAO,uBAAuB,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;YACvD,CAAC,CAAA;YACD;;;;;eAKG;YACH,0BAA0B,EAAE,CAC1B,IAA6B,EAC7B,QAA8C,EAC9C,KAA2C,EAC3C,EAAE;gBACF,IAAI,IAAI,CAAC,WAAW,EAAE;oBACpB,OAAO,wBAAW,CAAC,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAsC,CAAC,CAAA;iBAClG;gBACD,OAAO,0BAA0B,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;YAC1D,CAAC,CAAA;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAhHY,QAAA,kBAAkB,sBAgH9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Blockchain } from '@tatumio/shared-core';
|
|
2
2
|
import { PendingTransaction } from '@tatumio/api-client';
|
|
3
|
-
import { FlowSDKArguments } from '
|
|
3
|
+
import { FlowSDKArguments } from '../flow.sdk';
|
|
4
4
|
declare type TransactionHashPromise = Promise<{
|
|
5
5
|
txId: string;
|
|
6
6
|
address: string;
|
|
@@ -18,29 +18,29 @@ const flowKmsService = (args) => {
|
|
|
18
18
|
const txService = (0, flow_tx_1.flowTxService)(provider, Object.assign({}, flowBlockchainCalls));
|
|
19
19
|
switch (type) {
|
|
20
20
|
case flow_constants_1.FlowTxType.CREATE_ACCOUNT:
|
|
21
|
-
return (yield txService.
|
|
21
|
+
return (yield txService.account.send.createSignedTransaction({
|
|
22
22
|
publicKey: body.publicKey,
|
|
23
23
|
account: body.account,
|
|
24
24
|
privateKey: fromPrivateKeys[0],
|
|
25
25
|
}));
|
|
26
26
|
case flow_constants_1.FlowTxType.ADD_PK_TO_ACCOUNT:
|
|
27
|
-
return (yield txService.
|
|
27
|
+
return (yield txService.account.send.publicKeySignedTransaction({
|
|
28
28
|
publicKey: body.publicKey,
|
|
29
29
|
account: body.account,
|
|
30
30
|
privateKey: fromPrivateKeys[0],
|
|
31
31
|
}));
|
|
32
32
|
case flow_constants_1.FlowTxType.TRANSFER:
|
|
33
|
-
return (yield txService.
|
|
33
|
+
return (yield txService.native.send.transferSignedTransaction(Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] })));
|
|
34
34
|
case flow_constants_1.FlowTxType.TRANSFER_NFT:
|
|
35
|
-
return (yield txService.nft.
|
|
35
|
+
return (yield txService.nft.send.transferSignedTransaction(Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] })));
|
|
36
36
|
case flow_constants_1.FlowTxType.MINT_NFT:
|
|
37
|
-
return (yield txService.nft.
|
|
37
|
+
return (yield txService.nft.send.mintSignedTransaction(Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] })));
|
|
38
38
|
case flow_constants_1.FlowTxType.MINT_MULTIPLE_NFT:
|
|
39
|
-
return (yield txService.nft.
|
|
39
|
+
return (yield txService.nft.send.mintMultipleSignedTransaction(Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] })));
|
|
40
40
|
case flow_constants_1.FlowTxType.BURN_NFT:
|
|
41
|
-
return (yield txService.nft.
|
|
41
|
+
return (yield txService.nft.send.burnSignedTransaction(Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] })));
|
|
42
42
|
default:
|
|
43
|
-
return (yield txService.
|
|
43
|
+
return (yield txService.native.send.customSignedTransaction(Object.assign(Object.assign({}, body), { privateKey: fromPrivateKeys[0] })));
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
} });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.kms.js","sourceRoot":"","sources":["../../../../../../../packages/blockchain/flow/src/lib/services/flow.kms.ts"],"names":[],"mappings":";;;;AAAA,sDAAiD;AACjD,uCAAyC;AACzC,oFAA2E;AAC3E,sDAA8C;AAE9C,uDAAkD;AAClD,mDAA8C;AAKvC,MAAM,cAAc,GAAG,CAAC,IAAmD,EAAE,EAAE;IACpF,uCACK,IAAA,kDAAqB,EAAC,IAAI,CAAC,KACxB,IAAI,CAAC,EAAsB,EAAE,eAAyB;;gBAC1D,MAAM,WAAW,mCAAQ,EAAE,KAAE,KAAK,EAAE,wBAAU,CAAC,IAAI,GAAE,CAAA;gBAErD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAiE,IAAI,CAAC,KAAK,CAC7F,WAAW,CAAC,qBAAqB,CAClC,CAAA;gBACD,MAAM,QAAQ,GAAG,IAAA,4BAAY,oBAAM,IAAI,EAAG,CAAA;gBAC1C,MAAM,mBAAmB,GAAG,IAAA,gCAAc,EAAC,IAAI,CAAC,CAAA;gBAChD,MAAM,SAAS,GAAG,IAAA,uBAAa,EAAC,QAAQ,oBAAO,mBAAmB,EAAG,CAAA;gBACrE,QAAQ,IAAI,EAAE;oBACZ,KAAK,2BAAU,CAAC,cAAc;wBAC5B,OAAO,CAAC,MAAM,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"flow.kms.js","sourceRoot":"","sources":["../../../../../../../packages/blockchain/flow/src/lib/services/flow.kms.ts"],"names":[],"mappings":";;;;AAAA,sDAAiD;AACjD,uCAAyC;AACzC,oFAA2E;AAC3E,sDAA8C;AAE9C,uDAAkD;AAClD,mDAA8C;AAKvC,MAAM,cAAc,GAAG,CAAC,IAAmD,EAAE,EAAE;IACpF,uCACK,IAAA,kDAAqB,EAAC,IAAI,CAAC,KACxB,IAAI,CAAC,EAAsB,EAAE,eAAyB;;gBAC1D,MAAM,WAAW,mCAAQ,EAAE,KAAE,KAAK,EAAE,wBAAU,CAAC,IAAI,GAAE,CAAA;gBAErD,MAAM,EAAE,IAAI,EAAE,IAAI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,MAAM,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,qBAAqB,iCACjD,IAAI,KACP,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAC9B,CAAoB,CAAA;oBACxB,KAAK,2BAAU,CAAC,iBAAiB;wBAC/B,OAAO,CAAC,MAAM,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,iCACzD,IAAI,KACP,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAC9B,CAAoB,CAAA;oBACxB,KAAK,2BAAU,CAAC,QAAQ;wBACtB,OAAO,CAAC,MAAM,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,qBAAqB,iCACjD,IAAI,KACP,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAC9B,CAAoB,CAAA;oBACxB;wBACE,OAAO,CAAC,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,iCACtD,IAAI,KACP,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,IAC9B,CAAoB,CAAA;iBACzB;YACH,CAAC;SAAA,IACF;AACH,CAAC,CAAA;AA1DY,QAAA,cAAc,kBA0D1B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AccountSigner } from '../flow.types';
|
|
2
|
+
import { FlowProvider } from './flow.provider';
|
|
3
|
+
import { BurnFlowNft, MintFlowNft, MintMultipleFlowNft, TransferFlowNft } from '../utils/flow.utils';
|
|
4
|
+
export declare const flowNftService: (provider: FlowProvider, apiCalls: {
|
|
5
|
+
getSignKey: (isPayer: boolean) => Promise<{
|
|
6
|
+
keyId: number;
|
|
7
|
+
address: string;
|
|
8
|
+
}>;
|
|
9
|
+
signWithKey: (data: string, isPayer: boolean) => Promise<{
|
|
10
|
+
signature: string;
|
|
11
|
+
}>;
|
|
12
|
+
broadcast: (txData: string, signatureId?: string, proposalKey?: number) => Promise<{
|
|
13
|
+
txId: string;
|
|
14
|
+
failed?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
}) => {
|
|
17
|
+
getNftMetadata: (account: string, id: string, contractAddress: string) => Promise<any>;
|
|
18
|
+
getNftTokenByAddress: (account: string, tokenType: string) => Promise<any>;
|
|
19
|
+
send: {
|
|
20
|
+
/**
|
|
21
|
+
* Send Flow NFT mint token transaction to the blockchain. This method broadcasts signed transaction to the blockchain.
|
|
22
|
+
* This operation is irreversible.
|
|
23
|
+
* @param body content of the transaction to broadcast
|
|
24
|
+
* @param proposer function to obtain proposer key from
|
|
25
|
+
* @param payer function to obtain payer key from
|
|
26
|
+
* @returns txId id of the transaction in the blockchain
|
|
27
|
+
*/
|
|
28
|
+
mintSignedTransaction: (body: MintFlowNft, proposer?: ((isPayer: boolean) => AccountSigner) | undefined, payer?: ((isPayer: boolean) => AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId | import("@tatumio/api-client").FlowMintedResult | import("@tatumio/api-client").SolanaMintedResult | import("@tatumio/api-client").AlgorandMintedResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Send Flow NFT mint multiple tokens transaction to the blockchain. This method broadcasts signed transaction to the blockchain.
|
|
31
|
+
* This operation is irreversible.
|
|
32
|
+
* @param body content of the transaction to broadcast
|
|
33
|
+
* @param proposer function to obtain proposer key from
|
|
34
|
+
* @param payer function to obtain payer key from
|
|
35
|
+
* @returns txId id of the transaction in the blockchain
|
|
36
|
+
*/
|
|
37
|
+
mintMultipleSignedTransaction: (body: MintMultipleFlowNft, proposer?: ((isPayer: boolean) => AccountSigner) | undefined, payer?: ((isPayer: boolean) => AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId | import("@tatumio/api-client").FlowMintedMultipleResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Send Flow NFT transfer token transaction to the blockchain. This method broadcasts signed transaction to the blockchain.
|
|
40
|
+
* This operation is irreversible.
|
|
41
|
+
* @param body content of the transaction to broadcast
|
|
42
|
+
* @param proposer function to obtain proposer key from
|
|
43
|
+
* @param payer function to obtain payer key from
|
|
44
|
+
* @returns {txId: string, events: any[]} id of the transaction in the blockchain and events this tx produced
|
|
45
|
+
*/
|
|
46
|
+
transferSignedTransaction: (body: TransferFlowNft, proposer?: ((isPayer: boolean) => AccountSigner) | undefined, payer?: ((isPayer: boolean) => AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
47
|
+
/**
|
|
48
|
+
* Send Flow NFT burn token transaction to the blockchain. This method broadcasts signed transaction to the blockchain.
|
|
49
|
+
* This operation is irreversible.
|
|
50
|
+
* @param body content of the transaction to broadcast
|
|
51
|
+
* @param proposer function to obtain proposer key from
|
|
52
|
+
* @param payer function to obtain payer key from
|
|
53
|
+
* @returns txId id of the transaction in the blockchain
|
|
54
|
+
*/
|
|
55
|
+
burnSignedTransaction: (body: BurnFlowNft, proposer?: ((isPayer: boolean) => AccountSigner) | undefined, payer?: ((isPayer: boolean) => AccountSigner) | undefined) => Promise<import("@tatumio/api-client").TransactionHash | import("@tatumio/api-client").SignatureId>;
|
|
56
|
+
};
|
|
57
|
+
};
|