└── ed-collection.js /ed-collection.js: -------------------------------------------------------------------------------- 1 | import { ArchwayClient } from '@archwayhq/arch3.js'; 2 | import { SigningArchwayClient } from '@archwayhq/arch3.js'; 3 | import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'; 4 | import { GasPrice, calculateFee } from "@cosmjs/stargate"; 5 | 6 | const network = { 7 | chainId: 'constantine-3', 8 | endpoint: 'https://rpc.constantine.archway.tech', 9 | prefix: 'archway', 10 | }; 11 | 12 | const mnemonic = 'core wear goose congress elephant afraid amazing diet holiday crush better expect provide envelope involve slide hotel prepare dad zoo fatal media cute already'; 13 | const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, { prefix: network.prefix }); 14 | const accounts = await wallet.getAccounts(); 15 | const client = await SigningArchwayClient.connectWithSigner(network.endpoint, wallet); 16 | 17 | const contractAddress = 'archway165hs0sh68507r9mf9epk4j5gh224stud7jlqcyvxdndvc9sh4mwsnptz75'; 18 | 19 | const data = { 20 | collection_name: 'test4', 21 | token_symbol: 'TS', 22 | metadata: { 23 | social_links: { 24 | website: 'test.website.com', 25 | medium: 'test.medium.com', 26 | twitter: 'test.twitter.com', 27 | instagram: 'test.instagram.com', 28 | discord: 'test.discord.com', 29 | telegram: 'test.telegram.com', 30 | }, 31 | sensitive_content: true, 32 | finalize_collection: true, 33 | category: ['pfps', 'memes', 'collectibles', 'photography'], 34 | description: 'test description', 35 | banner_image: 'https://ik.imagekit.io/fmivn9lzw/1_AxPM09Ot1.png', 36 | profile_image: 'https://ik.imagekit.io/fmivn9lzw/1_C_FB4vklOD.png', 37 | wallet_address: { '0': { address: 'test_wallet', value: '5' }, '1': { address: 'test_wallet_2', value: '5' } } 38 | } 39 | }; 40 | 41 | const createCollectionMsgNew = { 42 | "update_collection_metadata": { 43 | "metadata": JSON.stringify(data.metadata) 44 | } 45 | }; 46 | 47 | const gasPrice = GasPrice.fromString("1000000000000aconst"); 48 | 49 | const { transactionHash } = await client.execute( 50 | accounts[0].address, 51 | contractAddress, 52 | createCollectionMsgNew, 53 | 'auto', 54 | "test" 55 | ); 56 | 57 | console.log(transactionHash); --------------------------------------------------------------------------------