conseiljs
Advanced tools
Comparing version 5.0.9-beta.0 to 5.0.9-beta.1
@@ -7,3 +7,3 @@ import { KeyStore, Signer } from '../../../types/ExternalInterfaces'; | ||
function getOperatorList(server: string, mapid: number): Promise<string[]>; | ||
function getTokenMetadata(server: string, mapid: number): Promise<any>; | ||
function getTokenMetadata(server: string, mapid?: number): Promise<any>; | ||
function getSimpleStorage(server: string, address: string): Promise<{ | ||
@@ -13,2 +13,4 @@ mapid: number; | ||
}>; | ||
function getTokenSupply(server: string, mapid?: number): Promise<number>; | ||
function getPaused(server: string, mapid?: number): Promise<boolean>; | ||
function transferBalance(server: string, signer: Signer, keystore: KeyStore, contract: string, fee: number, source: string, destination: string, amount: number, gas?: number, freight?: number): Promise<string>; | ||
@@ -15,0 +17,0 @@ function approveBalance(server: string, signer: Signer, keystore: KeyStore, contract: string, fee: number, destination: string, amount: number, gas?: number, freight?: number): Promise<string>; |
@@ -20,2 +20,3 @@ "use strict"; | ||
const jsonpath_plus_1 = require("jsonpath-plus"); | ||
const TezosConstants_1 = require("../../../types/tezos/TezosConstants"); | ||
const TezosTypes = __importStar(require("../../../types/tezos/TezosChainTypes")); | ||
@@ -57,3 +58,3 @@ const TezosLanguageUtil_1 = require("../TezosLanguageUtil"); | ||
TzbtcTokenHelper.getOperatorList = getOperatorList; | ||
function getTokenMetadata(server, mapid) { | ||
function getTokenMetadata(server, mapid = 31) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -74,6 +75,20 @@ return yield queryMap(server, mapid, '"tokenMetadata"'); | ||
TzbtcTokenHelper.getSimpleStorage = getSimpleStorage; | ||
function getTokenSupply(server, mapid = 31) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const r = yield queryMap(server, mapid, '"totalSupply"'); | ||
return Number(jsonpath_plus_1.JSONPath({ path: '$.int', json: r })[0]); | ||
}); | ||
} | ||
TzbtcTokenHelper.getTokenSupply = getTokenSupply; | ||
function getPaused(server, mapid = 31) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const r = yield queryMap(server, mapid, '"paused"'); | ||
return (jsonpath_plus_1.JSONPath({ path: '$.prim', json: r })[0]).toLowerCase().startsWith('t'); | ||
}); | ||
} | ||
TzbtcTokenHelper.getPaused = getPaused; | ||
function transferBalance(server, signer, keystore, contract, fee, source, destination, amount, gas = 250000, freight = 1000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const parameters = `(Pair "${source}" (Pair "${destination}" ${amount}))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, 'transfer', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, 'transfer', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -86,3 +101,3 @@ }); | ||
const parameters = `(Right (Right (Right (Right (Left (Right (Right (Right (Pair "${destination}" ${amount})))))))))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -89,0 +104,0 @@ }); |
@@ -5,13 +5,12 @@ import { KeyStore, Signer } from '../../../../types/ExternalInterfaces'; | ||
tokens: number; | ||
balanceMap: number; | ||
operatorMap: number; | ||
paused: boolean; | ||
metadataMap: number; | ||
ledger: number; | ||
metadata: number; | ||
paused: string; | ||
operators: number; | ||
tokenMetadata: number; | ||
totalSupply: number; | ||
} | ||
interface MultiAssetTokenDefinition { | ||
tokenid: number; | ||
symbol: string; | ||
name: string; | ||
scale: number; | ||
supply: number; | ||
metadata: Record<string, string>; | ||
} | ||
@@ -21,8 +20,13 @@ interface TransferPair { | ||
tokenid: number; | ||
balance: number; | ||
amount: number; | ||
} | ||
interface UpdateOperator { | ||
owner: string; | ||
operator: string; | ||
tokenid: number; | ||
} | ||
export declare namespace MultiAssetTokenHelper { | ||
function verifyDestination(server: string, address: string): Promise<boolean>; | ||
function verifyScript(script: string): boolean; | ||
function deployContract(server: string, signer: Signer, keystore: KeyStore, fee: number, administrator: string, name: string, symbol: string, tokenid: number, scale: number, pause?: boolean, supply?: number, gas?: number, freight?: number): Promise<string>; | ||
function deployContract(server: string, signer: Signer, keystore: KeyStore, fee: number, administrator: string, metadataUrl: string, pause?: boolean, gas?: number, freight?: number): Promise<string>; | ||
function getSimpleStorage(server: string, address: string): Promise<MultiAssetSimpleStorage>; | ||
@@ -33,6 +37,8 @@ function getTokenDefinition(server: string, mapid: number, token?: number): Promise<MultiAssetTokenDefinition>; | ||
function changeAdministrator(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, administrator: string, gas?: number, freight?: number): Promise<string>; | ||
function mint(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, destination: string, balance: number, symbol: string, tokenid: number, gas?: number, freight?: number): Promise<string>; | ||
function mint(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, destination: string, amount: number, metadata: Record<string, string>, tokenid: number, gas?: number, freight?: number): Promise<string>; | ||
function transfer(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, source: string, transfers: TransferPair[], gas?: number, freight?: number): Promise<string>; | ||
function addOperators(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, updateOps: UpdateOperator[], gas?: number, freight?: number): Promise<string>; | ||
function removeOperators(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, updateOps: UpdateOperator[], gas?: number, freight?: number): Promise<string>; | ||
function getAccountBalance(server: string, mapid: number, account: string, tokenid: number): Promise<number>; | ||
} | ||
export {}; |
@@ -20,2 +20,3 @@ "use strict"; | ||
const jsonpath_plus_1 = require("jsonpath-plus"); | ||
const TezosConstants_1 = require("../../../../types/tezos/TezosConstants"); | ||
const TezosTypes = __importStar(require("../../../../types/tezos/TezosChainTypes")); | ||
@@ -38,8 +39,9 @@ const TezosMessageUtil_1 = require("../../TezosMessageUtil"); | ||
MultiAssetTokenHelper.verifyScript = verifyScript; | ||
function deployContract(server, signer, keystore, fee, administrator, name, symbol, tokenid, scale, pause = true, supply = 0, gas = 800000, freight = 20000) { | ||
function deployContract(server, signer, keystore, fee, administrator, metadataUrl, pause = true, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const contract = `parameter (or (or (or (pair %balance_of (list %requests (pair (address %owner) (nat %token_id))) (contract %callback (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))))) (pair %mint (pair (address %address) (nat %amount)) (pair (string %symbol) (nat %token_id)))) (or (address %set_administrator) (bool %set_pause))) (or (or (pair %token_metadata (list %token_ids nat) (lambda %handler (list (pair (nat %token_id) (pair (string %symbol) (pair (string %name) (pair (nat %decimals) (map %extras string string)))))) unit)) (contract %token_metadata_regitry address)) (or (list %transfer (pair (address %from_) (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount)))))) (list %update_operators (or (pair %add_operator (address %owner) (address %operator)) (pair %remove_operator (address %owner) (address %operator))))))) ; | ||
storage (pair (pair (address %administrator) (pair (nat %all_tokens) (big_map %ledger (pair address nat) nat))) (pair (pair (unit %version_20200615_tzip_a57dfe86_contract) (big_map %operators (pair (address %owner) (address %operator)) unit)) (pair (bool %paused) (big_map %tokens nat (pair (pair %metadata (nat %token_id) (pair (string %symbol) (pair (string %name) (pair (nat %decimals) (map %extras string string))))) (nat %total_supply)))))) ; | ||
code { DUP ; CDR ; SWAP ; CAR ; IF_LEFT { IF_LEFT { IF_LEFT { SWAP ; DUP ; DUG 2 ; { CDR ; CDR ; CAR } ; IF { PUSH string "WrongCondition: ~ self.data.paused" ; FAILWITH } {} ; NIL (pair (pair %request (address %owner) (nat %token_id)) (nat %balance)) ; SWAP ; DUP ; DUG 2 ; CAR ; ITER { SWAP ; DIG 3 ; DUP ; DUG 4 ; { CAR ; CDR ; CDR } ; DIG 2 ; DUP ; DUG 3 ; CDR ; DIG 3 ; DUP ; DUG 4 ; CAR ; PAIR ; GET ; { IF_NONE { PUSH string "Get-item:190" ; FAILWITH } {} } ; DIG 2 ; DUP ; DUG 3 ; CDR ; DIG 3 ; CAR ; PAIR %owner %token_id ; PAIR %request %balance ; CONS } ; NIL operation ; DIG 2 ; DUP ; DUG 3 ; CDR ; PUSH mutez 0 ; DIG 3 ; DUP ; DUG 4 ; NIL (pair (pair %request (address %owner) (nat %token_id)) (nat %balance)) ; SWAP ; ITER { CONS } ; DIG 4 ; DROP ; DIG 4 ; DROP ; TRANSFER_TOKENS ; CONS } { SWAP ; DUP ; DUG 2 ; { CAR ; CAR } ; SENDER ; COMPARE ; EQ ; IF {} { PUSH string "WrongCondition: sp.sender == self.data.administrator" ; FAILWITH } ; SWAP ; DUP ; DUG 2 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; { CDR ; CDR } ; DIG 4 ; DUP ; DUG 5 ; { CAR ; CDR ; CAR } ; DUP ; PUSH nat 1 ; DIG 6 ; DUP ; DUG 7 ; { CDR ; CDR } ; ADD ; DUP ; DUG 2 ; COMPARE ; LE ; IF { DROP } { SWAP ; DROP } ; DIG 5 ; DROP ; PAIR ; SWAP ; PAIR ; PAIR ; SWAP ; SWAP ; DUP ; DUG 2 ; { CAR ; CDR ; CDR } ; SWAP ; DUP ; DUG 2 ; { CDR ; CDR } ; DIG 2 ; DUP ; DUG 3 ; { CAR ; CAR } ; PAIR ; MEM ; IF { SWAP ; DUP ; DUG 2 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CDR } ; DIG 6 ; DUP ; DUG 7 ; { CAR ; CAR } ; PAIR ; DUP ; DUG 2 ; GET ; { IF_NONE { PUSH string "set_in_top-any" ; FAILWITH } {} } ; DROP ; DIG 5 ; DUP ; DUG 6 ; { CAR ; CDR } ; DIG 7 ; { CAR ; CDR ; CDR } ; DIG 7 ; DUP ; DUG 8 ; { CDR ; CDR } ; DIG 8 ; DUP ; DUG 9 ; { CAR ; CAR } ; PAIR ; GET ; { IF_NONE { PUSH string "Get-item:190" ; FAILWITH } {} } ; ADD ; SOME ; SWAP ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; SWAP } { SWAP ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DIG 4 ; DUP ; DUG 5 ; { CAR ; CDR } ; SOME ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CDR } ; DIG 6 ; DUP ; DUG 7 ; { CAR ; CAR } ; PAIR ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; SWAP } ; SWAP ; DUP ; DUG 2 ; { CDR ; CDR ; CDR } ; SWAP ; DUP ; DUG 2 ; { CDR ; CDR } ; MEM ; IF { SWAP ; DUP ; DUG 2 ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CDR } ; DUP ; DUG 2 ; GET ; { IF_NONE { PUSH string "set_in_top-any" ; FAILWITH } {} } ; CAR ; DIG 6 ; DUP ; DUG 7 ; { CAR ; CDR } ; DIG 8 ; { CDR ; CDR ; CDR } ; DIG 8 ; DUP ; DUG 9 ; { CDR ; CDR } ; GET ; { IF_NONE { PUSH string "Get-item:431" ; FAILWITH } {} } ; CDR ; ADD ; SWAP ; PAIR ; SOME ; SWAP ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; SWAP ; PAIR ; SWAP } { SWAP ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DIG 4 ; DUP ; DUG 5 ; { CAR ; CDR } ; PUSH (pair (string %name) (pair (nat %decimals) (map %extras string string))) (Pair "" (Pair 0 {})) ; DIG 6 ; DUP ; DUG 7 ; { CDR ; CAR } ; PAIR %symbol ; DIG 6 ; DUP ; DUG 7 ; { CDR ; CDR } ; PAIR %token_id ; PAIR %metadata %total_supply ; SOME ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CDR } ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; SWAP ; PAIR ; SWAP } ; DROP ; NIL operation } } { IF_LEFT { SWAP ; DUP ; DUG 2 ; { CAR ; CAR } ; SENDER ; COMPARE ; EQ ; IF {} { PUSH string "WrongCondition: sp.sender == self.data.administrator" ; FAILWITH } ; SWAP ; DUP ; CDR ; SWAP ; { CAR ; CDR } ; DIG 2 ; PAIR ; PAIR } { SWAP ; DUP ; DUG 2 ; { CAR ; CAR } ; SENDER ; COMPARE ; EQ ; IF {} { PUSH string "WrongCondition: sp.sender == self.data.administrator" ; FAILWITH } ; SWAP ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; { CDR ; CDR } ; DIG 3 ; PAIR ; SWAP ; PAIR ; SWAP ; PAIR } ; NIL operation } } { IF_LEFT { IF_LEFT { SWAP ; DUP ; DUG 2 ; { CDR ; CDR ; CAR } ; IF { PUSH string "WrongCondition: ~ self.data.paused" ; FAILWITH } {} ; NIL (pair (nat %token_id) (pair (string %symbol) (pair (string %name) (pair (nat %decimals) (map %extras string string))))) ; SWAP ; DUP ; DUG 2 ; CAR ; ITER { SWAP ; DIG 3 ; DUP ; DUG 4 ; { CDR ; CDR ; CDR } ; DIG 2 ; GET ; { IF_NONE { PUSH string "Get-item:523" ; FAILWITH } {} } ; CAR ; CONS } ; SWAP ; DUP ; DUG 2 ; CDR ; SWAP ; DUP ; DUG 2 ; NIL (pair (nat %token_id) (pair (string %symbol) (pair (string %name) (pair (nat %decimals) (map %extras string string))))) ; SWAP ; ITER { CONS } ; EXEC ; DROP 3 ; NIL operation } { SWAP ; DUP ; DUG 2 ; { CDR ; CDR ; CAR } ; IF { PUSH string "WrongCondition: ~ self.data.paused" ; FAILWITH } {} ; DUP ; NIL operation ; SWAP ; PUSH mutez 0 ; SELF ; DIG 4 ; DROP ; ADDRESS ; TRANSFER_TOKENS ; CONS } } { IF_LEFT { SWAP ; DUP ; DUG 2 ; { CDR ; CDR ; CAR } ; IF { PUSH string "WrongCondition: ~ self.data.paused" ; FAILWITH } {} ; DUP ; ITER { DIG 2 ; DUP ; DUG 3 ; { CAR ; CAR } ; SENDER ; COMPARE ; EQ ; IF { PUSH bool True } { DUP ; CAR ; SENDER ; COMPARE ; EQ } ; IF { PUSH bool True } { DIG 2 ; DUP ; DUG 3 ; { CDR ; CAR ; CDR } ; SENDER ; DIG 2 ; DUP ; DUG 3 ; CAR ; PAIR %owner %operator ; MEM } ; IF {} { PUSH string "WrongCondition: ((sp.sender == self.data.administrator) | (transfer.from_ == sp.sender)) | (self.data.operators.contains(sp.record(operator = sp.sender, owner = transfer.from_)))" ; FAILWITH } ; DUP ; CDR ; ITER { DUP ; { CDR ; CDR } ; PUSH nat 0 ; COMPARE ; LT ; IF {} { PUSH string "TRANSFER_OF_ZERO" ; FAILWITH } ; DUP ; { CDR ; CDR } ; DIG 4 ; DUP ; DUG 5 ; { CAR ; CDR ; CDR } ; DIG 2 ; DUP ; DUG 3 ; { CDR ; CAR } ; DIG 4 ; DUP ; DUG 5 ; CAR ; PAIR ; GET ; { IF_NONE { PUSH string "Get-item:190" ; FAILWITH } {} } ; COMPARE ; GE ; IF {} { PUSH string "WrongCondition: self.data.ledger[(transfer.from_, tx.token_id)].balance >= tx.amount" ; FAILWITH } ; DIG 3 ; DUP ; DUG 4 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CAR } ; DIG 7 ; DUP ; DUG 8 ; CAR ; PAIR ; DUP ; DUG 2 ; GET ; { IF_NONE { PUSH string "set_in_top-any" ; FAILWITH } {} } ; DROP ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CDR } ; DIG 9 ; { CAR ; CDR ; CDR } ; DIG 7 ; DUP ; DUG 8 ; { CDR ; CAR } ; DIG 9 ; DUP ; DUG 10 ; CAR ; PAIR ; GET ; { IF_NONE { PUSH string "Get-item:190" ; FAILWITH } {} } ; SUB ; ISNAT ; { IF_NONE { PUSH unit Unit ; FAILWITH } {} } ; SOME ; SWAP ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; DUG 3 ; DIG 3 ; DUP ; DUG 4 ; { CAR ; CDR ; CDR } ; SWAP ; DUP ; DUG 2 ; { CDR ; CAR } ; DIG 2 ; DUP ; DUG 3 ; CAR ; PAIR ; MEM ; IF { DIG 3 ; DUP ; DUG 4 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CAR } ; DIG 6 ; DUP ; DUG 7 ; CAR ; PAIR ; DUP ; DUG 2 ; GET ; { IF_NONE { PUSH string "set_in_top-any" ; FAILWITH } {} } ; DROP ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CDR } ; DIG 9 ; { CAR ; CDR ; CDR } ; DIG 7 ; DUP ; DUG 8 ; { CDR ; CAR } ; DIG 8 ; DUP ; DUG 9 ; CAR ; PAIR ; GET ; { IF_NONE { PUSH string "Get-item:190" ; FAILWITH } {} } ; ADD ; SOME ; SWAP ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; DUG 3 } { DIG 3 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DIG 4 ; DUP ; DUG 5 ; { CDR ; CDR } ; SOME ; DIG 5 ; DUP ; DUG 6 ; { CDR ; CAR } ; DIG 6 ; DUP ; DUG 7 ; CAR ; PAIR ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; DUG 3 } ; DROP } ; DROP } ; DROP } { DUP ; ITER { DUP ; IF_LEFT { DROP ; DUP ; SENDER ; SWAP ; IF_LEFT {} { DROP ; PUSH unit Unit ; FAILWITH } ; CAR ; COMPARE ; EQ ; IF { PUSH bool True } { DIG 2 ; DUP ; DUG 3 ; { CAR ; CAR } ; SENDER ; COMPARE ; EQ } ; IF {} { PUSH string "WrongCondition: (update.open_variant('add_operator').owner == sp.sender) | (sp.sender == self.data.administrator)" ; FAILWITH } ; DIG 2 ; DUP ; DUG 3 ; DUP ; CAR ; SWAP ; CDR ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; PUSH (option unit) (Some Unit) ; DIG 5 ; DUP ; DUG 6 ; IF_LEFT {} { DROP ; PUSH unit Unit ; FAILWITH } ; CDR ; DIG 6 ; DUP ; DUG 7 ; IF_LEFT {} { DROP ; PUSH unit Unit ; FAILWITH } ; DIG 9 ; DROP ; CAR ; PAIR %owner %operator ; UPDATE ; SWAP ; PAIR ; PAIR ; SWAP ; PAIR ; DUG 2 } { DROP ; DUP ; SENDER ; SWAP ; IF_LEFT { DROP ; PUSH unit Unit ; FAILWITH } {} ; CAR ; COMPARE ; EQ ; IF { PUSH bool True } { DIG 2 ; DUP ; DUG 3 ; { CAR ; CAR } ; SENDER ; COMPARE ; EQ } ; IF {} { PUSH string "WrongCondition: (update.open_variant('remove_operator').owner == sp.sender) | (sp.sender == self.data.administrator)" ; FAILWITH } ; DIG 2 ; DUP ; DUG 3 ; DUP ; CAR ; SWAP ; CDR ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; NONE unit ; DIG 5 ; DUP ; DUG 6 ; IF_LEFT { DROP ; PUSH unit Unit ; FAILWITH } {} ; CDR ; DIG 6 ; DUP ; DUG 7 ; IF_LEFT { DROP ; PUSH unit Unit ; FAILWITH } {} ; DIG 9 ; DROP ; CAR ; PAIR %owner %operator ; UPDATE ; SWAP ; PAIR ; PAIR ; SWAP ; PAIR ; DUG 2 } ; DROP } ; DROP } ; NIL operation } } ; PAIR } ;`; | ||
const storage = `( Pair ( Pair "${administrator}" ( Pair 0 { } ) ) ( Pair ( Pair Unit { } ) ( Pair ${pause ? 'True' : 'False'} { Elt ${tokenid} ( Pair ( Pair ${tokenid} ( Pair "${symbol}" ( Pair "${name}" ( Pair ${scale} { } ) ) ) ) ${supply} ) } ) ) )`; | ||
const contract = `parameter (or (or (pair %balance_of (list %requests (pair (address %owner) (nat %token_id))) (contract %callback (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))))) (or (pair %mint (pair (address %address) (nat %amount)) (pair (map %metadata string bytes) (nat %token_id))) (address %set_administrator))) (or (or (pair %set_metadata (string %k) (bytes %v)) (bool %set_pause)) (or (list %transfer (pair (address %from_) (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount)))))) (list %update_operators (or (pair %add_operator (address %owner) (pair (address %operator) (nat %token_id))) (pair %remove_operator (address %owner) (pair (address %operator) (nat %token_id)))))))); | ||
storage (pair (pair (pair (address %administrator) (nat %all_tokens)) (pair (big_map %ledger (pair address nat) nat) (big_map %metadata string bytes))) (pair (pair (big_map %operators (pair (address %owner) (pair (address %operator) (nat %token_id))) unit) (bool %paused)) (pair (big_map %token_metadata nat (pair (nat %token_id) (map %token_info string bytes))) (big_map %total_supply nat nat)))); | ||
code { CAST (pair (or (or (pair (list (pair address nat)) (contract (list (pair (pair address nat) nat)))) (or (pair (pair address nat) (pair (map string bytes) nat)) address)) (or (or (pair string bytes) bool) (or (list (pair address (list (pair address (pair nat nat))))) (list (or (pair address (pair address nat)) (pair address (pair address nat))))))) (pair (pair (pair address nat) (pair (big_map (pair address nat) nat) (big_map string bytes))) (pair (pair (big_map (pair address (pair address nat)) unit) bool) (pair (big_map nat (pair nat (map string bytes))) (big_map nat nat))))); UNPAIR; IF_LEFT { IF_LEFT { SWAP; DUP; DUG 2; GET 3; CDR; IF { PUSH string "FA2_PAUSED"; FAILWITH; } {}; DUP; CAR; MAP { DUP 3; GET 5; SWAP; DUP; DUG 2; CDR; MEM; IF {} { PUSH string "FA2_TOKEN_UNDEFINED"; FAILWITH; }; DUP 3; CAR; GET 3; SWAP; DUP; CDR; SWAP; DUP; DUG 3; CAR; PAIR; MEM; IF { DUP 3; CAR; GET 3; SWAP; DUP; CDR; SWAP; DUP; DUG 3; CAR; PAIR; GET; IF_SOME { } { PUSH int 430; FAILWITH; }; SWAP; PAIR; } { PUSH nat 0; SWAP; PAIR; }; }; NIL operation; DIG 2; CDR; PUSH mutez 0; DIG 3; TRANSFER_TOKENS; CONS; } { IF_LEFT { SWAP; DUP; DUG 2; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF {} { PUSH string "FA2_NOT_ADMIN"; FAILWITH; }; DUP; GET 4; DUP 3; CAR; CAR; CDR; COMPARE; EQ; IF {} { PUSH string "Token-IDs should be consecutive"; FAILWITH; }; SWAP; DUP; DUG 2; UNPAIR; UNPAIR; CAR; DIG 4; CAR; CAR; CDR; DUP; PUSH nat 1; DUP 7; GET 4; ADD; DUP; DUG 2; COMPARE; LE; IF { DROP; } { SWAP; DROP; }; SWAP; PAIR; PAIR; PAIR; DUP; DUG 2; CAR; GET 3; SWAP; DUP; GET 4; SWAP; DUP; DUG 3; CAR; CAR; PAIR; MEM; IF { SWAP; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP; DIG 5; DUP; GET 4; SWAP; DUP; DUG 7; CAR; CAR; PAIR; DUP; DUG 2; GET; IF_SOME {} { PUSH int 541; FAILWITH; }; DUP 7; CAR; CDR; ADD; SOME; SWAP; UPDATE; PAIR; SWAP; PAIR; PAIR; SWAP; } { SWAP; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP 5; CAR; CDR; SOME; DIG 5; DUP; GET 4; SWAP; DUP; DUG 7; CAR; CAR; PAIR; UPDATE; PAIR; SWAP; PAIR; PAIR; SWAP; }; SWAP; DUP; DUG 2; GET 5; SWAP; DUP; DUG 2; GET 4; MEM; IF { DROP; } { SWAP; DUP; GET 5; DIG 2; DUP; GET 3; SWAP; DUP; DUG 4; GET 4; PAIR; SOME; DUP 4; GET 4; UPDATE; UPDATE 5; DUP; GET 6; DUP 3; CAR; CDR; SOME; DIG 3; GET 4; UPDATE; UPDATE 6; }; } { SWAP; DUP; DUG 2; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF {} { PUSH string "FA2_NOT_ADMIN"; FAILWITH; }; SWAP; UNPAIR; UNPAIR; CDR; DIG 3; PAIR; PAIR; PAIR; }; NIL operation; }; } { IF_LEFT { IF_LEFT { SWAP; DUP; DUG 2; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF {} { PUSH string "FA2_NOT_ADMIN"; FAILWITH; }; SWAP; UNPAIR; UNPAIR; SWAP; UNPAIR; SWAP; DUP 5; CDR; SOME; DIG 5; CAR; UPDATE; SWAP; PAIR; SWAP; PAIR; PAIR; } { SWAP; DUP; DUG 2; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF {} { PUSH string "FA2_NOT_ADMIN"; FAILWITH; }; SWAP; UNPAIR; SWAP; UNPAIR; CAR; DIG 3; SWAP; PAIR; PAIR; SWAP; PAIR; }; } { IF_LEFT { SWAP; DUP; DUG 2; GET 3; CDR; IF { PUSH string "FA2_PAUSED"; FAILWITH; } {}; DUP; ITER { DUP; CDR; ITER { DUP 4; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF { PUSH bool True; } { SENDER; DUP 3; CAR; COMPARE; EQ; }; IF { PUSH bool True; } { DUP 4; GET 3; CAR; SWAP; DUP; DUG 2; GET 3; SENDER; DUP 5; CAR; PAIR 3; MEM; }; IF {} { PUSH string "FA2_NOT_OPERATOR"; FAILWITH; }; DUP 4; GET 5; SWAP; DUP; DUG 2; GET 3; MEM; IF {} { PUSH string "FA2_TOKEN_UNDEFINED"; FAILWITH; }; DUP; GET 4; PUSH nat 0; COMPARE; LT; IF { DUP; GET 4; DUP 5; CAR; GET 3; DUP 3; GET 3; DUP 5; CAR; PAIR; GET; IF_SOME { } { PUSH int 408; FAILWITH; }; COMPARE; GE; IF {} { PUSH string "FA2_INSUFFICIENT_BALANCE"; FAILWITH; }; DUP 4; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP; DUP 6; GET 3; DUP 8; CAR; PAIR; DUP; DUG 2; GET; IF_SOME { DROP; } { PUSH int 412; FAILWITH; }; DUP 6; GET 4; DIG 9; CAR; GET 3; DUP 8; GET 3; DUP 10; CAR; PAIR; GET; IF_SOME { } { PUSH int 412; FAILWITH; }; SUB; ISNAT; IF_SOME {} { PUSH int 412; FAILWITH; }; SOME; SWAP; UPDATE; PAIR; SWAP; PAIR; PAIR; DUP; DUG 4; CAR; GET 3; SWAP; DUP; GET 3; SWAP; DUP; DUG 3; CAR; PAIR; MEM; IF { DIG 3; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP; DIG 5; DUP; GET 3; SWAP; DUP; DUG 7; CAR; PAIR; DUP; DUG 2; GET; IF_SOME {} { PUSH int 415; FAILWITH; }; DIG 6; GET 4; ADD; SOME; SWAP; UPDATE; PAIR; SWAP; PAIR; PAIR; DUG 2; } { DIG 3; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP 5; GET 4; SOME; DIG 5; DUP; GET 3; SWAP; CAR; PAIR; UPDATE; PAIR; SWAP; PAIR; PAIR; DUG 2; }; } { DROP; }; }; DROP; }; DROP; } { DUP; ITER { IF_LEFT { DUP; CAR; SENDER; COMPARE; EQ; IF { PUSH bool True; } { DUP 3; CAR; CAR; CAR; SENDER; COMPARE; EQ; }; IF {} { PUSH string "FA2_NOT_ADMIN_OR_OPERATOR"; FAILWITH; }; DIG 2; UNPAIR; SWAP; UNPAIR; UNPAIR; PUSH (option unit) (Some Unit); DIG 5; DUP; GET 4; SWAP; DUP; GET 3; SWAP; CAR; PAIR 3; UPDATE; PAIR; PAIR; SWAP; PAIR; SWAP; } { DUP; CAR; SENDER; COMPARE; EQ; IF { PUSH bool True; } { DUP 3; CAR; CAR; CAR; SENDER; COMPARE; EQ; }; IF {} { PUSH string "FA2_NOT_ADMIN_OR_OPERATOR"; FAILWITH; }; DIG 2; UNPAIR; SWAP; UNPAIR; UNPAIR; NONE unit; DIG 5; DUP; GET 4; SWAP; DUP; GET 3; SWAP; CAR; PAIR 3; UPDATE; PAIR; PAIR; SWAP; PAIR; SWAP; }; }; DROP; }; }; NIL operation; }; PAIR; };`; | ||
const paused = pause ? "True" : "False"; | ||
const storage = `(Pair (Pair (Pair "${administrator}" 0) (Pair {} {Elt "" 0x${Buffer.from(metadataUrl, "utf-8").toString("hex")}})) (Pair (Pair {} ${paused}) (Pair {} {})))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractOriginationOperation(server, signer, keystore, 0, undefined, fee, freight, gas, contract, storage, TezosTypes.TezosParameterFormat.Michelson); | ||
@@ -54,8 +56,10 @@ return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult['operationGroupID']); | ||
return { | ||
administrator: jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].string', json: storageResult })[0], | ||
tokens: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].args[0].int', json: storageResult })[0]), | ||
balanceMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].args[1].int', json: storageResult })[0]), | ||
operatorMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[1].int', json: storageResult })[0]), | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[0].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t'), | ||
metadataMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[1].int', json: storageResult })[0]), | ||
administrator: jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].args[0].string', json: storageResult })[0], | ||
tokens: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].args[1].int', json: storageResult })[0]), | ||
ledger: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].int', json: storageResult })[0]), | ||
metadata: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[2].int', json: storageResult })[0]), | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t'), | ||
operators: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].int', json: storageResult })[0]), | ||
tokenMetadata: Number(jsonpath_plus_1.JSONPath({ path: '$.args[2].int', json: storageResult })[0]), | ||
totalSupply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[3].int', json: storageResult })[0]) | ||
}; | ||
@@ -72,9 +76,10 @@ }); | ||
} | ||
return { | ||
tokenid: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].int', json: mapResult })[0]), | ||
symbol: jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].args[0].string', json: mapResult })[0], | ||
name: jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].args[1].args[0].string', json: mapResult })[0], | ||
scale: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].args[1].args[1].args[0].int', json: mapResult })[0]), | ||
supply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].int', json: mapResult })[0]) | ||
const tokenData = { | ||
tokenid: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].int', json: mapResult })[0]), | ||
metadata: {} | ||
}; | ||
mapResult["args"][1].forEach(item => { | ||
tokenData.metadata[item["args"][0]["string"]] = Buffer.from(item["args"][1]["bytes"], "hex").toString(); | ||
}); | ||
return tokenData; | ||
}); | ||
@@ -110,6 +115,13 @@ } | ||
MultiAssetTokenHelper.changeAdministrator = changeAdministrator; | ||
function mint(server, address, signer, keystore, fee, destination, balance, symbol, tokenid, gas = 800000, freight = 20000) { | ||
function mint(server, address, signer, keystore, fee, destination, amount, metadata, tokenid, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const entryPoint = 'mint'; | ||
const parameters = `(Pair (Pair "${destination}" ${balance}) (Pair "${symbol}" ${tokenid}))`; | ||
const keys = Object.keys(metadata).sort(); | ||
let metaString = ""; | ||
for (let key of keys) { | ||
if (metaString !== "") | ||
metaString += "; "; | ||
metaString += `Elt "${key}" 0x${Buffer.from(metadata[key], "utf-8").toString("hex")}`; | ||
} | ||
const parameters = `(Pair (Pair "${destination}" ${amount}) (Pair {${metaString}} ${tokenid}))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
@@ -123,3 +135,18 @@ return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
const entryPoint = 'transfer'; | ||
const parameters = `{ Pair "${source}" { ${transfers.map(t => '( Pair "' + t.address + '" ( Pair ' + t.tokenid + ' ' + t.balance + ' ) )').join(' ; ')} } }`; | ||
const parameters = `{ Pair 0x${TezosMessageUtil_1.TezosMessageUtils.writeAddress(source)} { ${transfers.map(t => '( Pair 0x' + TezosMessageUtil_1.TezosMessageUtils.writeAddress(t.address) + ' ( Pair ' + t.tokenid + ' ' + t.amount + ' ) )').join(' ; ')} } }`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
}); | ||
} | ||
MultiAssetTokenHelper.transfer = transfer; | ||
function addOperators(server, address, signer, keystore, fee, updateOps, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const entryPoint = 'update_operators'; | ||
let parameters = "{"; | ||
updateOps.forEach(op => { | ||
if (parameters !== "{") | ||
parameters += "; "; | ||
parameters += `Left (Pair "${op.owner}" (Pair "${op.operator}" ${op.tokenid}))`; | ||
}); | ||
parameters += "}"; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
@@ -129,3 +156,18 @@ return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
} | ||
MultiAssetTokenHelper.transfer = transfer; | ||
MultiAssetTokenHelper.addOperators = addOperators; | ||
function removeOperators(server, address, signer, keystore, fee, updateOps, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const entryPoint = 'update_operators'; | ||
let parameters = "{"; | ||
updateOps.forEach(op => { | ||
if (parameters !== "{") | ||
parameters += "; "; | ||
parameters += `Right (Pair "${op.owner}" (Pair "${op.operator}" ${op.tokenid}))`; | ||
}); | ||
parameters += "}"; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
}); | ||
} | ||
MultiAssetTokenHelper.removeOperators = removeOperators; | ||
function getAccountBalance(server, mapid, account, tokenid) { | ||
@@ -132,0 +174,0 @@ return __awaiter(this, void 0, void 0, function* () { |
import { KeyStore, Signer } from '../../../../types/ExternalInterfaces'; | ||
interface SingleAssetSimpleStorage { | ||
administrator: string; | ||
paused: boolean; | ||
pendingAdmin: string; | ||
balanceMap: number; | ||
operatorMap: number; | ||
metadataMap: number; | ||
supply: number; | ||
tokens: number; | ||
ledger: number; | ||
metadata: number; | ||
paused: string; | ||
operators: number; | ||
tokenMetadata: number; | ||
totalSupply: number; | ||
} | ||
interface SingleAssetTokenDefinition { | ||
tokenid: number; | ||
symbol: string; | ||
name: string; | ||
scale: number; | ||
metadata: Record<string, string>; | ||
} | ||
interface BalancePair { | ||
address: string; | ||
balance: number; | ||
} | ||
interface TransferPair { | ||
address: string; | ||
tokenid: number; | ||
balance: number; | ||
amount: number; | ||
} | ||
interface UpdateOperator { | ||
owner: string; | ||
operator: string; | ||
} | ||
export declare namespace SingleAssetTokenHelper { | ||
function verifyDestination(server: string, address: string): Promise<boolean>; | ||
function verifyScript(script: string): boolean; | ||
function deployContract(server: string, signer: Signer, keystore: KeyStore, fee: number, administrator: string, name: string, symbol: string, tokenid: number, scale: number, pause?: boolean, supply?: number, gas?: number, freight?: number): Promise<string>; | ||
function deployContract(server: string, signer: Signer, keystore: KeyStore, fee: number, administrator: string, metadataUrl: string, pause?: boolean, gas?: number, freight?: number): Promise<string>; | ||
function getSimpleStorage(server: string, address: string): Promise<SingleAssetSimpleStorage>; | ||
function getTokenDefinition(server: string, mapid: number, token?: number): Promise<SingleAssetTokenDefinition>; | ||
function getTokenDefinition(server: string, mapid: number): Promise<SingleAssetTokenDefinition>; | ||
function activate(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, gas?: number, freight?: number): Promise<string>; | ||
function deactivate(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, gas?: number, freight?: number): Promise<string>; | ||
function mint(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, issue: BalancePair[], gas?: number, freight?: number): Promise<string>; | ||
function changeAdministrator(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, administrator: string, gas?: number, freight?: number): Promise<string>; | ||
function mint(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, destination: string, amount: number, metadata: Record<string, string>, gas?: number, freight?: number): Promise<string>; | ||
function transfer(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, source: string, transfers: TransferPair[], gas?: number, freight?: number): Promise<string>; | ||
function getAccountBalance(server: string, mapid: number, account: string): Promise<number>; | ||
function addOperators(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, updateOps: UpdateOperator[], gas?: number, freight?: number): Promise<string>; | ||
function removeOperators(server: string, address: string, signer: Signer, keystore: KeyStore, fee: number, updateOps: UpdateOperator[], gas?: number, freight?: number): Promise<string>; | ||
function getAccountBalance(server: string, mapid: number, account: string, balancePath?: string): Promise<number>; | ||
} | ||
export {}; |
@@ -25,2 +25,3 @@ "use strict"; | ||
const TezosContractUtils_1 = require("../TezosContractUtils"); | ||
const TezosConstants_1 = require("../../../../types/tezos/TezosConstants"); | ||
var SingleAssetTokenHelper; | ||
@@ -38,8 +39,9 @@ (function (SingleAssetTokenHelper) { | ||
SingleAssetTokenHelper.verifyScript = verifyScript; | ||
function deployContract(server, signer, keystore, fee, administrator, name, symbol, tokenid, scale, pause = true, supply = 0, gas = 800000, freight = 20000) { | ||
function deployContract(server, signer, keystore, fee, administrator, metadataUrl, pause = true, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const contract = `parameter (or (or (or %admin (or (unit %confirm_admin) (bool %pause)) (address %set_admin)) (or %assets (or (pair %balance_of (list %requests (pair (address %owner) (nat %token_id))) (contract %callback (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))))) (contract %token_metadata_registry address)) (or (list %transfer (pair (address %from_) (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount)))))) (list %update_operators (or (pair %add_operator (address %owner) (address %operator)) (pair %remove_operator (address %owner) (address %operator))))))) (or %tokens (list %burn_tokens (pair (nat %amount) (address %owner))) (list %mint_tokens (pair (nat %amount) (address %owner))))) ; | ||
storage (pair (pair %admin (pair (address %admin) (bool %paused)) (option %pending_admin address)) (pair %assets (pair (big_map %ledger address nat) (big_map %operators (pair address address) unit)) (pair (big_map %token_metadata nat (pair (nat %token_id) (pair (string %symbol) (pair (string %name) (pair (nat %decimals) (map %extras string string)))))) (nat %total_supply)))) ; | ||
code { PUSH string "FA2_TOKEN_UNDEFINED" ; PUSH string "FA2_INSUFFICIENT_BALANCE" ; LAMBDA (pair address address) (pair address address) { DUP ; CAR ; DIG 1 ; DUP ; DUG 2 ; CDR ; PAIR ; DIP { DROP } } ; LAMBDA (pair address (big_map address nat)) nat { DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; GET ; IF_NONE { PUSH nat 0 } { DUP ; DIP { DROP } } ; DIP { DROP } } ; DUP ; LAMBDA (pair (lambda (pair address (big_map address nat)) nat) (pair (pair address nat) (big_map address nat))) (big_map address nat) { DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; CAR ; DIG 1 ; DUP ; DUG 2 ; CDR ; DUP ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DIG 4 ; DUP ; DUG 5 ; SWAP ; EXEC ; DIG 3 ; DUP ; DUG 4 ; CAR ; CDR ; DIG 1 ; DUP ; DUG 2 ; ADD ; DIG 2 ; DUP ; DUG 3 ; DIG 1 ; DUP ; DUG 2 ; SOME ; DIG 5 ; DUP ; DUG 6 ; UPDATE ; DIP { DROP 6 } } ; SWAP ; APPLY ; DIP { DIP { DIP { DUP } ; SWAP } ; DUP ; DIP { PAIR } ; SWAP } ; SWAP ; LAMBDA (pair (pair (lambda (pair address (big_map address nat)) nat) string) (pair (pair address nat) (big_map address nat))) (big_map address nat) { DUP ; CAR ; SWAP ; CDR ; DIP { DUP ; CDR ; SWAP ; CAR } ; DUP ; CAR ; CAR ; DIG 1 ; DUP ; DUG 2 ; CDR ; DUP ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DIG 4 ; DUP ; DUG 5 ; SWAP ; EXEC ; DIG 3 ; DUP ; DUG 4 ; CAR ; CDR ; DIG 1 ; DUP ; DUG 2 ; SUB ; ISNAT ; IF_NONE { DIG 5 ; DUP ; DUG 6 ; FAILWITH } { PUSH nat 0 ; DIG 1 ; DUP ; DUG 2 ; COMPARE ; EQ ; IF { DIG 2 ; DUP ; DUG 3 ; DIG 4 ; DUP ; DUG 5 ; NONE nat ; SWAP ; UPDATE } { DIG 2 ; DUP ; DUG 3 ; DIG 1 ; DUP ; DUG 2 ; SOME ; DIG 5 ; DUP ; DUG 6 ; UPDATE } ; DIP { DROP } } ; DIP { DROP 6 } } ; SWAP ; APPLY ; LAMBDA (list (pair nat address)) nat { PUSH nat 0 ; DIG 1 ; DUP ; DUG 2 ; ITER { SWAP ; PAIR ; DUP ; CDR ; CAR ; DIG 1 ; DUP ; DUG 2 ; CAR ; ADD ; DIP { DROP } } ; DIP { DROP } } ; LAMBDA (pair (pair address bool) (option address)) unit { DUP ; CAR ; CAR ; SENDER ; COMPARE ; NEQ ; IF { PUSH string "NOT_AN_ADMIN" ; FAILWITH } { UNIT } ; DIP { DROP } } ; DIG 8 ; DUP ; DUG 9 ; CDR ; DIG 9 ; DUP ; DUG 10 ; CAR ; IF_LEFT { DUP ; IF_LEFT { DIG 2 ; DUP ; DUG 3 ; CAR ; DIG 1 ; DUP ; DUG 2 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; IF_LEFT { DUP ; IF_LEFT { DIG 2 ; DUP ; DUG 3 ; CDR ; IF_NONE { PUSH string "NO_PENDING_ADMIN" ; FAILWITH } { DUP ; SENDER ; COMPARE ; EQ ; IF { DIG 3 ; DUP ; DUG 4 ; CAR ; NONE address ; SWAP ; PAIR ; DUP ; CDR ; SWAP ; CAR ; CDR ; SENDER ; PAIR ; PAIR } { PUSH string "NOT_AN_ADMIN" ; FAILWITH } ; DIP { DROP } } ; DUP ; NIL operation ; PAIR ; DIP { DROP 2 } } { DIG 2 ; DUP ; DUG 3 ; DIG 8 ; DUP ; DUG 9 ; SWAP ; EXEC ; DIG 3 ; DUP ; DUG 4 ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; DIP { DUP ; CDR ; SWAP ; CAR ; CAR } ; SWAP ; PAIR ; PAIR ; DIP { DROP } ; NIL operation ; PAIR ; DIP { DROP 2 } } ; DIP { DROP } } { DIG 1 ; DUP ; DUG 2 ; DIG 7 ; DUP ; DUG 8 ; SWAP ; EXEC ; DIG 2 ; DUP ; DUG 3 ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; SOME ; SWAP ; CAR ; PAIR ; DIP { DROP } ; NIL operation ; PAIR ; DIP { DROP 2 } } ; DIP { DROP 2 } ; DIG 3 ; DUP ; DUG 4 ; DIG 1 ; DUP ; DUG 2 ; CDR ; SWAP ; CDR ; SWAP ; PAIR ; DIG 1 ; DUP ; DUG 2 ; CAR ; PAIR ; DIP { DROP 2 } } { DIG 2 ; DUP ; DUG 3 ; CAR ; CAR ; CDR ; IF { PUSH string "PAUSED" ; FAILWITH } { UNIT } ; DIG 3 ; DUP ; DUG 4 ; CDR ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; IF_LEFT { DUP ; IF_LEFT { DUP ; CAR ; DIG 1 ; DUP ; DUG 2 ; CDR ; PAIR ; DUP ; CDR ; MAP { DUP ; DIP { DROP } } ; DUP ; DIG 2 ; DUP ; DUG 3 ; CAR ; PAIR ; DIP { DROP 2 } ; DIG 3 ; DUP ; DUG 4 ; CAR ; CAR ; DIG 1 ; DUP ; DUG 2 ; PAIR ; DUP ; CAR ; DUP ; CDR ; MAP { PUSH nat 0 ; DIG 1 ; DUP ; DUG 2 ; CDR ; COMPARE ; NEQ ; IF { DIG 19 ; DUP ; DUG 20 ; FAILWITH } { DIG 2 ; DUP ; DUG 3 ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; PAIR ; DIG 17 ; DUP ; DUG 18 ; SWAP ; EXEC ; DIG 1 ; DUP ; DUG 2 ; DIG 1 ; DUP ; DUG 2 ; PAIR ; DUP ; CDR ; CDR ; DIG 1 ; DUP ; DUG 2 ; CDR ; CAR ; PAIR ; DIG 1 ; DUP ; DUG 2 ; CAR ; PAIR ; DUP ; CAR ; DIG 1 ; DUP ; DUG 2 ; CDR ; PAIR ; DIP { DROP 3 } } ; DIP { DROP } } ; DIG 1 ; DUP ; DUG 2 ; CAR ; PUSH mutez 0 ; DIG 2 ; DUP ; DUG 3 ; TRANSFER_TOKENS ; DIP { DROP 3 } ; DIG 4 ; DUP ; DUG 5 ; NIL operation ; DIG 2 ; DUP ; DUG 3 ; CONS ; PAIR ; DIP { DROP 3 } } { DUP ; PUSH mutez 0 ; SELF ; ADDRESS ; TRANSFER_TOKENS ; DIG 3 ; DUP ; DUG 4 ; NIL operation ; DIG 2 ; DUP ; DUG 3 ; CONS ; PAIR ; DIP { DROP 2 } } ; DIP { DROP } } { DUP ; IF_LEFT { DUP ; MAP { DUP ; CDR ; MAP { DUP ; CDR ; CAR ; DIG 1 ; DUP ; DUG 2 ; CAR ; DIG 2 ; DUP ; DUG 3 ; CDR ; CDR ; PAIR ; PAIR ; DIP { DROP } } ; DIG 1 ; DUP ; DUG 2 ; CAR ; PAIR ; DIP { DROP } } ; DUP ; MAP { DUP ; CDR ; MAP { PUSH nat 0 ; DIG 1 ; DUP ; DUG 2 ; CDR ; COMPARE ; NEQ ; IF { DIG 18 ; DUP ; DUG 19 ; FAILWITH } { DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; CDR ; SOME ; DIG 2 ; DUP ; DUG 3 ; CAR ; CAR ; PAIR ; PAIR } ; DIP { DROP } } ; DUP ; DIG 2 ; DUP ; DUG 3 ; CAR ; SOME ; PAIR ; DIP { DROP 2 } } ; SENDER ; DUP ; LAMBDA (pair address (pair address (big_map (pair address address) unit))) unit { DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; DIG 2 ; DUP ; DUG 3 ; DIG 1 ; DUP ; DUG 2 ; COMPARE ; EQ ; IF { UNIT } { DIG 1 ; DUP ; DUG 2 ; CDR ; DIG 3 ; DUP ; DUG 4 ; DIG 2 ; DUP ; DUG 3 ; PAIR ; MEM ; IF { UNIT } { PUSH string "FA2_NOT_OPERATOR" ; FAILWITH } } ; DIP { DROP 3 } } ; SWAP ; APPLY ; DIP { DROP } ; DIG 5 ; DUP ; DUG 6 ; CAR ; CAR ; DIG 6 ; DUP ; DUG 7 ; CAR ; CDR ; PAIR ; DIG 1 ; DUP ; DUG 2 ; DIG 3 ; DUP ; DUG 4 ; PAIR ; PAIR ; DUP ; CDR ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; CAR ; ITER { SWAP ; PAIR ; DUP ; CDR ; DUP ; CAR ; IF_NONE { UNIT } { DIG 3 ; DUP ; DUG 4 ; CDR ; CAR ; DIG 1 ; DUP ; DUG 2 ; PAIR ; DIG 4 ; DUP ; DUG 5 ; CAR ; CDR ; SWAP ; EXEC ; DIP { DROP } } ; DIG 2 ; DUP ; DUG 3 ; CAR ; DIG 2 ; DUP ; DUG 3 ; CDR ; ITER { SWAP ; PAIR ; DUP ; CAR ; DIG 1 ; DUP ; DUG 2 ; CDR ; PUSH nat 0 ; DIG 1 ; DUP ; DUG 2 ; CDR ; COMPARE ; NEQ ; IF { DIG 25 ; DUP ; DUG 26 ; FAILWITH } { DIG 4 ; DUP ; DUG 5 ; CAR ; IF_NONE { DIG 1 ; DUP ; DUG 2 } { DIG 2 ; DUP ; DUG 3 ; DIG 2 ; DUP ; DUG 3 ; CAR ; CAR ; DIG 2 ; DUP ; DUG 3 ; PAIR ; PAIR ; DIG 22 ; DUP ; DUG 23 ; SWAP ; EXEC ; DIP { DROP } } ; DIG 1 ; DUP ; DUG 2 ; CAR ; CDR ; IF_NONE { DUP } { DIG 1 ; DUP ; DUG 2 ; DIG 3 ; DUP ; DUG 4 ; CAR ; CAR ; DIG 2 ; DUP ; DUG 3 ; PAIR ; PAIR ; DIG 24 ; DUP ; DUG 25 ; SWAP ; EXEC ; DIP { DROP } } ; DIP { DROP } } ; DIP { DROP 3 } } ; DIP { DROP 3 } } ; DIP { DROP } ; DIG 6 ; DUP ; DUG 7 ; DIG 1 ; DUP ; DUG 2 ; DIP { DUP ; CDR ; SWAP ; CAR ; CDR } ; PAIR ; PAIR ; NIL operation ; PAIR ; DIP { DROP 5 } } { DUP ; MAP { DUP ; IF_LEFT { DUP ; LEFT (pair (address %owner) (address %operator)) ; DIP { DROP } } { DUP ; RIGHT (pair (address %owner) (address %operator)) ; DIP { DROP } } ; DUP ; IF_LEFT { DUP ; DIG 17 ; DUP ; DUG 18 ; SWAP ; EXEC ; LEFT (pair (address %operator) (address %owner)) ; DIP { DROP } } { DUP ; DIG 17 ; DUP ; DUG 18 ; SWAP ; EXEC ; RIGHT (pair (address %operator) (address %owner)) ; DIP { DROP } } ; DIP { DROP 2 } } ; SENDER ; DIG 4 ; DUP ; DUG 5 ; CAR ; CDR ; DIG 2 ; DUP ; DUG 3 ; ITER { SWAP ; PAIR ; DUP ; CDR ; DIG 2 ; DUP ; DUG 3 ; DIG 1 ; DUP ; DUG 2 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; IF_LEFT { DUP ; DIP { DROP } } { DUP ; DIP { DROP } } ; CDR ; COMPARE ; EQ ; IF { UNIT } { PUSH string "FA2_NOT_OWNER" ; FAILWITH } ; DIP { DROP } ; DIG 2 ; DUP ; DUG 3 ; CAR ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; IF_LEFT { DIG 1 ; DUP ; DUG 2 ; UNIT ; SOME ; DIG 2 ; DUP ; DUG 3 ; CAR ; DIG 3 ; DUP ; DUG 4 ; CDR ; PAIR ; UPDATE ; DIP { DROP } } { DIG 1 ; DUP ; DUG 2 ; DIG 1 ; DUP ; DUG 2 ; CAR ; DIG 2 ; DUP ; DUG 3 ; CDR ; PAIR ; NONE unit ; SWAP ; UPDATE ; DIP { DROP } } ; DIP { DROP 5 } } ; DIG 5 ; DUP ; DUG 6 ; DIG 1 ; DUP ; DUG 2 ; DIP { DUP ; CDR ; SWAP ; CAR ; CAR } ; SWAP ; PAIR ; PAIR ; NIL operation ; PAIR ; DIP { DROP 4 } } ; DIP { DROP } } ; DIP { DROP 2 } ; DIG 4 ; DUP ; DUG 5 ; DIG 1 ; DUP ; DUG 2 ; CDR ; SWAP ; CAR ; PAIR ; DIG 1 ; DUP ; DUG 2 ; CAR ; PAIR ; DIP { DROP 3 } } ; DIP { DROP } } { DIG 1 ; DUP ; DUG 2 ; CAR ; DIG 3 ; DUP ; DUG 4 ; SWAP ; EXEC ; DIG 2 ; DUP ; DUG 3 ; CDR ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; IF_LEFT { DIG 1 ; DUP ; DUG 2 ; DIG 1 ; DUP ; DUG 2 ; PAIR ; DUP ; CAR ; DIG 1 ; DUP ; DUG 2 ; CDR ; DUP ; CAR ; CAR ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; ITER { SWAP ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; DIG 1 ; DUP ; DUG 2 ; CAR ; DIG 2 ; DUP ; DUG 3 ; CDR ; PAIR ; PAIR ; DIG 15 ; DUP ; DUG 16 ; SWAP ; EXEC ; DIP { DROP 2 } } ; DIP { DROP } ; DIG 2 ; DUP ; DUG 3 ; DIG 12 ; DUP ; DUG 13 ; SWAP ; EXEC ; DUP ; DIG 3 ; DUP ; DUG 4 ; CDR ; CDR ; SUB ; ISNAT ; DUP ; IF_NONE { DIG 18 ; DUP ; DUG 19 ; FAILWITH } { DUP ; DIP { DROP } } ; DIG 4 ; DUP ; DUG 5 ; DIG 4 ; DUP ; DUG 5 ; DIP { DUP ; CDR ; SWAP ; CAR ; CDR } ; PAIR ; PAIR ; DIG 1 ; DUP ; DUG 2 ; DIP { DUP ; CAR ; SWAP ; CDR ; CAR } ; SWAP ; PAIR ; SWAP ; PAIR ; NIL operation ; PAIR ; DIP { DROP 8 } } { DIG 1 ; DUP ; DUG 2 ; DIG 1 ; DUP ; DUG 2 ; PAIR ; DUP ; CAR ; DIG 1 ; DUP ; DUG 2 ; CDR ; DUP ; CAR ; CAR ; DIG 2 ; DUP ; DUG 3 ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; ITER { SWAP ; PAIR ; DUP ; CDR ; DIG 1 ; DUP ; DUG 2 ; CAR ; DIG 1 ; DUP ; DUG 2 ; CAR ; DIG 2 ; DUP ; DUG 3 ; CDR ; PAIR ; PAIR ; DIG 16 ; DUP ; DUG 17 ; SWAP ; EXEC ; DIP { DROP 2 } } ; DIP { DROP } ; DIG 2 ; DUP ; DUG 3 ; DIG 12 ; DUP ; DUG 13 ; SWAP ; EXEC ; DIG 2 ; DUP ; DUG 3 ; DIG 2 ; DUP ; DUG 3 ; DIP { DUP ; CDR ; SWAP ; CAR ; CDR } ; PAIR ; PAIR ; DIG 1 ; DUP ; DUG 2 ; DIG 4 ; DUP ; DUG 5 ; CDR ; CDR ; ADD ; DIP { DUP ; CAR ; SWAP ; CDR ; CAR } ; SWAP ; PAIR ; SWAP ; PAIR ; DUP ; NIL operation ; PAIR ; DIP { DROP 7 } } ; DIP { DROP 2 } ; DIG 3 ; DUP ; DUG 4 ; DIG 1 ; DUP ; DUG 2 ; CDR ; SWAP ; CAR ; PAIR ; DIG 1 ; DUP ; DUG 2 ; CAR ; PAIR ; DIP { DROP 3 } } ; DIP { DROP 10 } } ; `; | ||
const storage = `( Pair ( Pair ( Pair "${administrator}" ${pause ? 'True' : 'False'} ) None ) ( Pair ( Pair { } { } ) ( Pair { Elt ${tokenid} ( Pair ${tokenid} ( Pair "${symbol}" ( Pair "${name}" ( Pair ${scale} { } ) ) ) ) } ${supply} ) ) )`; | ||
const contract = `parameter (or (or (pair %balance_of (list %requests (pair (address %owner) (nat %token_id))) (contract %callback (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))))) (or (pair %mint (pair (address %address) (nat %amount)) (pair (map %metadata string bytes) (nat %token_id))) (address %set_administrator))) (or (or (pair %set_metadata (string %k) (bytes %v)) (bool %set_pause)) (or (list %transfer (pair (address %from_) (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount)))))) (list %update_operators (or (pair %add_operator (address %owner) (pair (address %operator) (nat %token_id))) (pair %remove_operator (address %owner) (pair (address %operator) (nat %token_id)))))))); | ||
storage (pair (pair (pair (address %administrator) (nat %all_tokens)) (pair (big_map %ledger address nat) (big_map %metadata string bytes))) (pair (pair (big_map %operators (pair (address %owner) (pair (address %operator) (nat %token_id))) unit) (bool %paused)) (pair (big_map %token_metadata nat (pair (nat %token_id) (map %token_info string bytes))) (big_map %total_supply nat nat)))); | ||
code { CAST (pair (or (or (pair (list (pair address nat)) (contract (list (pair (pair address nat) nat)))) (or (pair (pair address nat) (pair (map string bytes) nat)) address)) (or (or (pair string bytes) bool) (or (list (pair address (list (pair address (pair nat nat))))) (list (or (pair address (pair address nat)) (pair address (pair address nat))))))) (pair (pair (pair address nat) (pair (big_map address nat) (big_map string bytes))) (pair (pair (big_map (pair address (pair address nat)) unit) bool) (pair (big_map nat (pair nat (map string bytes))) (big_map nat nat))))); UNPAIR; IF_LEFT { IF_LEFT { SWAP; DUP; DUG 2; GET 3; CDR; IF { PUSH string "FA2_PAUSED"; FAILWITH; } {}; DUP; CAR; MAP { DUP 3; GET 5; SWAP; DUP; DUG 2; CDR; MEM; IF {} { PUSH string "FA2_TOKEN_UNDEFINED"; FAILWITH; }; DUP 3; CAR; GET 3; SWAP; DUP; DUG 2; CAR; MEM; IF { DUP 3; CAR; GET 3; SWAP; DUP; DUG 2; CAR; GET; IF_SOME { } { PUSH int 430; FAILWITH; }; SWAP; PAIR; } { PUSH nat 0; SWAP; PAIR; }; }; NIL operation; DIG 2; CDR; PUSH mutez 0; DIG 3; TRANSFER_TOKENS; CONS; } { IF_LEFT { SWAP; DUP; DUG 2; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF {} { PUSH string "FA2_NOT_ADMIN"; FAILWITH; }; DUP; GET 4; PUSH nat 0; COMPARE; EQ; IF {} { PUSH string "single-asset: token-id <> 0"; FAILWITH; }; DUP; GET 4; DUP 3; CAR; CAR; CDR; COMPARE; EQ; IF {} { PUSH string "Token-IDs should be consecutive"; FAILWITH; }; SWAP; DUP; DUG 2; UNPAIR; UNPAIR; CAR; DIG 4; CAR; CAR; CDR; DUP; PUSH nat 1; DUP 7; GET 4; ADD; DUP; DUG 2; COMPARE; LE; IF { DROP; } { SWAP; DROP; }; SWAP; PAIR; PAIR; PAIR; DUP; DUG 2; CAR; GET 3; SWAP; DUP; DUG 2; CAR; CAR; MEM; IF { SWAP; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP; DUP 6; CAR; CAR; DUP; DUG 2; GET; IF_SOME {} { PUSH int 541; FAILWITH; }; DUP 7; CAR; CDR; ADD; SOME; SWAP; UPDATE; PAIR; SWAP; PAIR; PAIR; SWAP; } { SWAP; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP 5; CAR; CDR; SOME; DUP 6; CAR; CAR; UPDATE; PAIR; SWAP; PAIR; PAIR; SWAP; }; SWAP; DUP; DUG 2; GET 5; SWAP; DUP; DUG 2; GET 4; MEM; IF { DROP; } { SWAP; DUP; GET 5; DIG 2; DUP; GET 3; SWAP; DUP; DUG 4; GET 4; PAIR; SOME; DUP 4; GET 4; UPDATE; UPDATE 5; DUP; GET 6; DUP 3; CAR; CDR; SOME; DIG 3; GET 4; UPDATE; UPDATE 6; }; } { SWAP; DUP; DUG 2; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF {} { PUSH string "FA2_NOT_ADMIN"; FAILWITH; }; SWAP; UNPAIR; UNPAIR; CDR; DIG 3; PAIR; PAIR; PAIR; }; NIL operation; }; } { IF_LEFT { IF_LEFT { SWAP; DUP; DUG 2; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF {} { PUSH string "FA2_NOT_ADMIN"; FAILWITH; }; SWAP; UNPAIR; UNPAIR; SWAP; UNPAIR; SWAP; DUP 5; CDR; SOME; DIG 5; CAR; UPDATE; SWAP; PAIR; SWAP; PAIR; PAIR; } { SWAP; DUP; DUG 2; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF {} { PUSH string "FA2_NOT_ADMIN"; FAILWITH; }; SWAP; UNPAIR; SWAP; UNPAIR; CAR; DIG 3; SWAP; PAIR; PAIR; SWAP; PAIR; }; } { IF_LEFT { SWAP; DUP; DUG 2; GET 3; CDR; IF { PUSH string "FA2_PAUSED"; FAILWITH; } {}; DUP; ITER { DUP; CDR; ITER { DUP; GET 3; PUSH nat 0; COMPARE; EQ; IF {} { PUSH string "single-asset: token-id <> 0"; FAILWITH; }; DUP 4; CAR; CAR; CAR; SENDER; COMPARE; EQ; IF { PUSH bool True; } { SENDER; DUP 3; CAR; COMPARE; EQ; }; IF { PUSH bool True; } { DUP 4; GET 3; CAR; SWAP; DUP; DUG 2; GET 3; SENDER; DUP 5; CAR; PAIR 3; MEM; }; IF {} { PUSH string "FA2_NOT_OPERATOR"; FAILWITH; }; DUP 4; GET 5; SWAP; DUP; DUG 2; GET 3; MEM; IF {} { PUSH string "FA2_TOKEN_UNDEFINED"; FAILWITH; }; DUP; GET 4; PUSH nat 0; COMPARE; LT; IF { DUP; GET 4; DUP 5; CAR; GET 3; DUP 4; CAR; GET; IF_SOME { } { PUSH int 408; FAILWITH; }; COMPARE; GE; IF {} { PUSH string "FA2_INSUFFICIENT_BALANCE"; FAILWITH; }; DUP 4; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP; DUP 7; CAR; DUP; DUG 2; GET; IF_SOME { DROP; } { PUSH int 412; FAILWITH; }; DUP 6; GET 4; DIG 9; CAR; GET 3; DUP 9; CAR; GET; IF_SOME { } { PUSH int 412; FAILWITH; }; SUB; ISNAT; IF_SOME {} { PUSH int 412; FAILWITH; }; SOME; SWAP; UPDATE; PAIR; SWAP; PAIR; PAIR; DUP; DUG 4; CAR; GET 3; SWAP; DUP; DUG 2; CAR; MEM; IF { DIG 3; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP; DUP 6; CAR; DUP; DUG 2; GET; IF_SOME {} { PUSH int 415; FAILWITH; }; DIG 6; GET 4; ADD; SOME; SWAP; UPDATE; PAIR; SWAP; PAIR; PAIR; DUG 2; } { DIG 3; UNPAIR; UNPAIR; SWAP; UNPAIR; DUP 5; GET 4; SOME; DIG 5; CAR; UPDATE; PAIR; SWAP; PAIR; PAIR; DUG 2; }; } { DROP; }; }; DROP; }; DROP; } { DUP; ITER { IF_LEFT { DUP; CAR; SENDER; COMPARE; EQ; IF { PUSH bool True; } { DUP 3; CAR; CAR; CAR; SENDER; COMPARE; EQ; }; IF {} { PUSH string "FA2_NOT_ADMIN_OR_OPERATOR"; FAILWITH; }; DIG 2; UNPAIR; SWAP; UNPAIR; UNPAIR; PUSH (option unit) (Some Unit); DIG 5; DUP; GET 4; SWAP; DUP; GET 3; SWAP; CAR; PAIR 3; UPDATE; PAIR; PAIR; SWAP; PAIR; SWAP; } { DUP; CAR; SENDER; COMPARE; EQ; IF { PUSH bool True; } { DUP 3; CAR; CAR; CAR; SENDER; COMPARE; EQ; }; IF {} { PUSH string "FA2_NOT_ADMIN_OR_OPERATOR"; FAILWITH; }; DIG 2; UNPAIR; SWAP; UNPAIR; UNPAIR; NONE unit; DIG 5; DUP; GET 4; SWAP; DUP; GET 3; SWAP; CAR; PAIR 3; UPDATE; PAIR; PAIR; SWAP; PAIR; SWAP; }; }; DROP; }; }; NIL operation; }; PAIR; };`; | ||
const paused = pause ? "True" : "False"; | ||
const storage = `(Pair (Pair (Pair "${administrator}" 0) (Pair {} {Elt "" 0x${Buffer.from(metadataUrl, "utf-8").toString("hex")}})) (Pair (Pair {} ${paused}) (Pair {} {})))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractOriginationOperation(server, signer, keystore, 0, undefined, fee, freight, gas, contract, storage, TezosTypes.TezosParameterFormat.Michelson); | ||
@@ -55,8 +57,9 @@ return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult['operationGroupID']); | ||
administrator: jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].args[0].string', json: storageResult })[0], | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].args[1].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t'), | ||
pendingAdmin: jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].prim', json: storageResult })[0], | ||
balanceMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[0].int', json: storageResult })[0]), | ||
operatorMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].args[1].int', json: storageResult })[0]), | ||
metadataMap: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[0].int', json: storageResult })[0]), | ||
supply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[1].int', json: storageResult })[0]) | ||
tokens: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[0].args[1].int', json: storageResult })[0]), | ||
ledger: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[1].int', json: storageResult })[0]), | ||
metadata: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].args[2].int', json: storageResult })[0]), | ||
paused: (jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].prim', json: storageResult })[0]).toString().toLowerCase().startsWith('t'), | ||
operators: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].int', json: storageResult })[0]), | ||
tokenMetadata: Number(jsonpath_plus_1.JSONPath({ path: '$.args[2].int', json: storageResult })[0]), | ||
totalSupply: Number(jsonpath_plus_1.JSONPath({ path: '$.args[3].int', json: storageResult })[0]), | ||
}; | ||
@@ -66,15 +69,17 @@ }); | ||
SingleAssetTokenHelper.getSimpleStorage = getSimpleStorage; | ||
function getTokenDefinition(server, mapid, token = 0) { | ||
function getTokenDefinition(server, mapid) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const packedKey = TezosMessageUtil_1.TezosMessageUtils.encodeBigMapKey(Buffer.from(TezosMessageUtil_1.TezosMessageUtils.writePackedData(token, 'nat'), 'hex')); | ||
const packedKey = TezosMessageUtil_1.TezosMessageUtils.encodeBigMapKey(Buffer.from(TezosMessageUtil_1.TezosMessageUtils.writePackedData(0, 'nat'), 'hex')); | ||
const mapResult = yield TezosNodeReader_1.TezosNodeReader.getValueForBigMapKey(server, mapid, packedKey); | ||
if (mapResult === undefined) { | ||
throw new Error(`Map ${mapid} does not contain a record for token ${token}`); | ||
throw new Error(`Map ${mapid} does not contain a record for token 0`); | ||
} | ||
return { | ||
const tokenData = { | ||
tokenid: Number(jsonpath_plus_1.JSONPath({ path: '$.args[0].int', json: mapResult })[0]), | ||
symbol: jsonpath_plus_1.JSONPath({ path: '$.args[1].args[0].string', json: mapResult })[0], | ||
name: jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[0].string', json: mapResult })[0], | ||
scale: Number(jsonpath_plus_1.JSONPath({ path: '$.args[1].args[1].args[1].args[0].int', json: mapResult })[0]) | ||
metadata: {} | ||
}; | ||
mapResult["args"][1].forEach(item => { | ||
tokenData.metadata[item["args"][0]["string"]] = Buffer.from(item["args"][1]["bytes"], "hex").toString(); | ||
}); | ||
return tokenData; | ||
}); | ||
@@ -85,3 +90,3 @@ } | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const entryPoint = 'pause'; | ||
const entryPoint = 'set_pause'; | ||
const parameters = 'False'; | ||
@@ -95,3 +100,3 @@ const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const entryPoint = 'pause'; | ||
const entryPoint = 'set_pause'; | ||
const parameters = 'True'; | ||
@@ -103,6 +108,6 @@ const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
SingleAssetTokenHelper.deactivate = deactivate; | ||
function mint(server, address, signer, keystore, fee, issue, gas = 800000, freight = 20000) { | ||
function changeAdministrator(server, address, signer, keystore, fee, administrator, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const entryPoint = 'mint_tokens'; | ||
const parameters = `{ ${issue.map(i => '( Pair ' + i.balance + ' "' + i.address + '" )').join(' ; ')} }`; | ||
const entryPoint = 'set_administrator'; | ||
const parameters = `"${administrator}"`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
@@ -112,2 +117,18 @@ return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
} | ||
SingleAssetTokenHelper.changeAdministrator = changeAdministrator; | ||
function mint(server, address, signer, keystore, fee, destination, amount, metadata, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const entryPoint = 'mint'; | ||
const keys = Object.keys(metadata).sort(); | ||
let metaString = ""; | ||
for (let key of keys) { | ||
if (metaString !== "") | ||
metaString += "; "; | ||
metaString += `Elt "${key}" 0x${Buffer.from(metadata[key], "utf-8").toString("hex")}`; | ||
} | ||
const parameters = `(Pair (Pair "${destination}" ${amount}) (Pair {${metaString}} 1))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
}); | ||
} | ||
SingleAssetTokenHelper.mint = mint; | ||
@@ -117,4 +138,4 @@ function transfer(server, address, signer, keystore, fee, source, transfers, gas = 800000, freight = 20000) { | ||
const entryPoint = 'transfer'; | ||
const parameters = `{ Pair "${source}" { ${transfers.map(t => '( Pair "' + t.address + '" ( Pair ' + t.tokenid + ' ' + t.balance + ' ) )').join(' ; ')} } }`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
const parameters = `{ Pair 0x${TezosMessageUtil_1.TezosMessageUtils.writeAddress(source)} { ${transfers.map(t => '( Pair 0x' + TezosMessageUtil_1.TezosMessageUtils.writeAddress(t.address) + ' ( Pair ' + 0 + ' ' + t.amount + ' ) )').join(' ; ')} } }`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -124,5 +145,35 @@ }); | ||
SingleAssetTokenHelper.transfer = transfer; | ||
function getAccountBalance(server, mapid, account) { | ||
function addOperators(server, address, signer, keystore, fee, updateOps, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const packedKey = TezosMessageUtil_1.TezosMessageUtils.encodeBigMapKey(Buffer.from(TezosMessageUtil_1.TezosMessageUtils.writePackedData(account, 'address'), 'hex')); | ||
const entryPoint = 'update_operators'; | ||
let parameters = "{"; | ||
updateOps.forEach(op => { | ||
if (parameters !== "{") | ||
parameters += "; "; | ||
parameters += `Left (Pair "${op.owner}" (Pair "${op.operator}" 0))`; | ||
}); | ||
parameters += "}"; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
}); | ||
} | ||
SingleAssetTokenHelper.addOperators = addOperators; | ||
function removeOperators(server, address, signer, keystore, fee, updateOps, gas = 800000, freight = 20000) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const entryPoint = 'update_operators'; | ||
let parameters = "{"; | ||
updateOps.forEach(op => { | ||
if (parameters !== "{") | ||
parameters += "; "; | ||
parameters += `Right (Pair "${op.owner}" (Pair "${op.operator}" 0))`; | ||
}); | ||
parameters += "}"; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, address, 0, fee, freight, gas, entryPoint, parameters, TezosTypes.TezosParameterFormat.Michelson); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
}); | ||
} | ||
SingleAssetTokenHelper.removeOperators = removeOperators; | ||
function getAccountBalance(server, mapid, account, balancePath = '$.int') { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const packedKey = TezosMessageUtil_1.TezosMessageUtils.encodeBigMapKey(Buffer.from(TezosMessageUtil_1.TezosMessageUtils.writePackedData(account, "address"), 'hex')); | ||
const mapResult = yield TezosNodeReader_1.TezosNodeReader.getValueForBigMapKey(server, mapid, packedKey); | ||
@@ -132,4 +183,4 @@ if (mapResult === undefined) { | ||
} | ||
const jsonresult = jsonpath_plus_1.JSONPath({ path: '$.int', json: mapResult }); | ||
return Number(jsonresult[0]); | ||
const balance = Number(jsonpath_plus_1.JSONPath({ path: balancePath, json: mapResult })[0]); | ||
return balance; | ||
}); | ||
@@ -136,0 +187,0 @@ } |
@@ -6,3 +6,3 @@ import { KeyStore, Signer } from '../../../types/ExternalInterfaces'; | ||
function deployContract(server: string, signer: Signer, keystore: KeyStore, fee: number, administrator: string, pause?: boolean, supply?: number, gas?: number, freight?: number): Promise<string>; | ||
function getAccountBalance(server: string, mapid: number, account: string): Promise<number>; | ||
function getAccountBalance(server: string, mapid: number, account: string, balancePath?: string): Promise<number>; | ||
function getAccountAllowance(server: string, mapid: number, account: string, source: string): Promise<any>; | ||
@@ -9,0 +9,0 @@ function getSimpleStorage(server: string, address: string): Promise<{ |
@@ -49,3 +49,3 @@ "use strict"; | ||
Tzip7ReferenceTokenHelper.deployContract = deployContract; | ||
function getAccountBalance(server, mapid, account) { | ||
function getAccountBalance(server, mapid, account, balancePath = '$.args[0].int') { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -57,3 +57,3 @@ const packedKey = TezosMessageUtil_1.TezosMessageUtils.encodeBigMapKey(Buffer.from(TezosMessageUtil_1.TezosMessageUtils.writePackedData(account, 'address'), 'hex')); | ||
} | ||
const jsonresult = jsonpath_plus_1.JSONPath({ path: '$.args[0].int', json: mapResult }); | ||
const jsonresult = jsonpath_plus_1.JSONPath({ path: balancePath, json: mapResult }); | ||
return Number(jsonresult[0]); | ||
@@ -111,4 +111,4 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const parameters = `(Left (Left (Left (Pair "${source}" (Pair "${destination}" ${amount})))))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
const parameters = `(Pair "${source}" (Pair "${destination}" ${amount}))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, 'transfer', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -120,4 +120,4 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const parameters = `(Left (Left (Right (Pair "${destination}" ${amount}))))`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, '', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
const parameters = `(Pair "${destination}" ${amount})`; | ||
const nodeResult = yield TezosNodeWriter_1.TezosNodeWriter.sendContractInvocationOperation(server, signer, keystore, contract, 0, fee, freight, gas, 'approve', parameters, TezosTypes.TezosParameterFormat.Michelson, TezosConstants_1.TezosConstants.HeadBranchOffset, true); | ||
return TezosContractUtils_1.TezosContractUtils.clearRPCOperationGroupHash(nodeResult.operationGroupID); | ||
@@ -124,0 +124,0 @@ }); |
@@ -42,5 +42,5 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const tokenMatched = TezosContractUtils_1.TezosContractUtils.verifyDestination(nodeUrl, tokenContractAddress, CONTRACT_CHECKSUMS.token); | ||
const ovenMatched = TezosContractUtils_1.TezosContractUtils.verifyDestination(nodeUrl, ovenContractAddress, CONTRACT_CHECKSUMS.oven); | ||
const coreMatched = TezosContractUtils_1.TezosContractUtils.verifyDestination(nodeUrl, coreContractAddress, CONTRACT_CHECKSUMS.core); | ||
const tokenMatched = yield TezosContractUtils_1.TezosContractUtils.verifyDestination(nodeUrl, tokenContractAddress, CONTRACT_CHECKSUMS.token); | ||
const ovenMatched = yield TezosContractUtils_1.TezosContractUtils.verifyDestination(nodeUrl, ovenContractAddress, CONTRACT_CHECKSUMS.oven); | ||
const coreMatched = yield TezosContractUtils_1.TezosContractUtils.verifyDestination(nodeUrl, coreContractAddress, CONTRACT_CHECKSUMS.core); | ||
return tokenMatched && ovenMatched && coreMatched; | ||
@@ -47,0 +47,0 @@ }); |
@@ -44,3 +44,4 @@ import { KeyStore, Signer } from '../../types/ExternalInterfaces'; | ||
function dryRunOperation(server: string, chainid: string, ...operations: TezosP2PMessageTypes.Operation[]): Promise<any>; | ||
function prepareOperationGroup(server: string, keyStore: KeyStore, counter: number, operations: TezosP2PMessageTypes.StackableOperation[], optimizeFee?: boolean): Promise<(TezosP2PMessageTypes.Transaction | TezosP2PMessageTypes.Delegation | TezosP2PMessageTypes.Reveal)[]>; | ||
function parseRPCError(response: string): void; | ||
} |
@@ -462,2 +462,17 @@ "use strict"; | ||
} | ||
function prepareOperationGroup(server, keyStore, counter, operations, optimizeFee = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const operationGroup = yield appendRevealOperation(server, keyStore.publicKey, keyStore.publicKeyHash, counter, operations); | ||
if (optimizeFee) { | ||
const estimate = yield estimateOperationGroup(server, 'main', operationGroup); | ||
operationGroup[0].fee = estimate.estimatedFee.toString(); | ||
for (let i = 0; i < operationGroup.length; i++) { | ||
operationGroup[i].gas_limit = estimate.operationResources[i].gas.toString(); | ||
operationGroup[i].storage_limit = estimate.operationResources[i].storageCost.toString(); | ||
} | ||
} | ||
return operationGroup; | ||
}); | ||
} | ||
TezosNodeWriter.prepareOperationGroup = prepareOperationGroup; | ||
function parseRPCError(response) { | ||
@@ -464,0 +479,0 @@ let errors = ''; |
@@ -10,2 +10,3 @@ export * from './chain/tezos/TezosContractIntrospector'; | ||
export * from './chain/tezos/contracts/DexterPoolHelper'; | ||
export * from './chain/tezos/contracts/HicNFT'; | ||
export * from './chain/tezos/contracts/KolibriTokenHelper'; | ||
@@ -12,0 +13,0 @@ export * from './chain/tezos/contracts/MurbardMultisigHelper'; |
@@ -22,2 +22,3 @@ "use strict"; | ||
__export(require("./chain/tezos/contracts/DexterPoolHelper")); | ||
__export(require("./chain/tezos/contracts/HicNFT")); | ||
__export(require("./chain/tezos/contracts/KolibriTokenHelper")); | ||
@@ -24,0 +25,0 @@ __export(require("./chain/tezos/contracts/MurbardMultisigHelper")); |
@@ -12,2 +12,3 @@ export declare function registerLogger(logger: any): void; | ||
export * from './chain/tezos/contracts/DexterPoolHelper'; | ||
export * from './chain/tezos/contracts/HicNFT'; | ||
export * from './chain/tezos/contracts/KolibriTokenHelper'; | ||
@@ -14,0 +15,0 @@ export * from './chain/tezos/contracts/MurbardMultisigHelper'; |
@@ -28,2 +28,3 @@ "use strict"; | ||
__export(require("./chain/tezos/contracts/DexterPoolHelper")); | ||
__export(require("./chain/tezos/contracts/HicNFT")); | ||
__export(require("./chain/tezos/contracts/KolibriTokenHelper")); | ||
@@ -30,0 +31,0 @@ __export(require("./chain/tezos/contracts/MurbardMultisigHelper")); |
{ | ||
"name": "conseiljs", | ||
"version": "5.0.9-beta.0", | ||
"version": "5.0.9-beta.1", | ||
"description": "Client-side library for Tezos dApp development.", | ||
@@ -73,3 +73,3 @@ "browser": "dist/index-web.js", | ||
"bs58check": "2.1.2", | ||
"jsonpath-plus": "5.0.2", | ||
"jsonpath-plus": "5.0.7", | ||
"moo": "0.5.0", | ||
@@ -89,10 +89,10 @@ "nearley": "2.19.1" | ||
"chai-as-promised": "7.1.1", | ||
"conseiljs-softsigner": "5.0.3", | ||
"conseiljs-softsigner": "5.0.4-1", | ||
"copyfiles": "2.3.0", | ||
"coveralls": "3.1.0", | ||
"eslint": "7.18.0", | ||
"glob": "7.1.6", | ||
"glob": "7.1.7", | ||
"loglevel": "1.7.1", | ||
"mocha": "8.2.1", | ||
"nock": "13.0.6", | ||
"mocha": "8.4.0", | ||
"nock": "13.0.11", | ||
"node-fetch": "2.6.1", | ||
@@ -103,3 +103,3 @@ "nyc": "15.1.0", | ||
"tsconfig-paths-webpack-plugin": "3.3.0", | ||
"typedoc": "0.18.0", | ||
"typedoc": "^0.20.36", | ||
"typedoc-plugin-markdown": "2.4.2", | ||
@@ -106,0 +106,0 @@ "typescript": "3.8.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
814510
7849
+ Addedjsonpath-plus@5.0.7(transitive)
- Removedjsonpath-plus@5.0.2(transitive)
Updatedjsonpath-plus@5.0.7