Skip to content

Commit

Permalink
Updates imports & transaction results
Browse files Browse the repository at this point in the history
  • Loading branch information
MightOfOaks committed Apr 29, 2024
1 parent 7772a8a commit 135e40a
Show file tree
Hide file tree
Showing 26 changed files with 53 additions and 50 deletions.
2 changes: 1 addition & 1 deletion config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
// NFT.storage endpoint
nftStorageEndpoint: 'https://api.nft.storage',
// NFT.storage API key
nftStorageApiKey: '',
nftStorageApiKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDJBODk5OGI4ZkE2YTM1NzMyYmMxQTRDQzNhOUU2M0Y2NUM3ZjA1RWIiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY1NTE5MTcwNDQ2MiwibmFtZSI6IlRlc3QifQ.IbdV_26bkPHSdd81sxox5AoG-5a4CCEY4aCrdbCXwAE',
// Pinata API Key (optional)
pinataApiKey: '',
// Pinata Secret Key (optional)
Expand Down
2 changes: 1 addition & 1 deletion devops/rarity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// ex: yarn devops-rarity

import { CosmWasmClient } from 'cosmwasm';
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';
const fetch = require('node-fetch');
const config = require('../config');
require('dotenv').config();
Expand Down
2 changes: 1 addition & 1 deletion devops/testnet-launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const collection3 = require('./collection3');
import { create_minter as create_minter } from '../src/create-collection/minter';
import { batchMint } from '../src/collection-actions/execute/mint';
import { toStars } from '../src/helpers/utils';
import { CosmWasmClient } from 'cosmwasm';
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';
import { naturalCompare } from '../src/helpers/sort';

// Define constants to use for launch. overrides config.js
Expand Down
8 changes: 2 additions & 6 deletions src/account.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {
encodeSecp256k1Pubkey,
Secp256k1HdWallet,
Bip39,
Random,
} from 'cosmwasm';
import { Bip39, Random } from '@cosmjs/crypto';
import { Secp256k1HdWallet, encodeSecp256k1Pubkey } from '@cosmjs/amino';

async function createAccount() {
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
Expand Down
3 changes: 2 additions & 1 deletion src/collection-actions/execute/airdrop-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
// Accepts cosmos, stars addresses.

import { ExecuteMsg } from '@stargazezone/types/contracts/minter/execute_msg';
import { coin, MsgExecuteContractEncodeObject } from 'cosmwasm';
import { coin } from '@cosmjs/amino';
import { MsgExecuteContractEncodeObject } from '@cosmjs/cosmwasm-stargate';
import { toStars } from '../../helpers/utils';
import inquirer from 'inquirer';
import { getClient } from '../../helpers/client';
Expand Down
2 changes: 1 addition & 1 deletion src/collection-actions/execute/burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getClient } from '../../helpers/client';
import { toStars } from '../../helpers/utils';
import inquirer from 'inquirer';
import { mintTo } from './mint';
import { SigningCosmWasmClient } from 'cosmwasm';
import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';

const config = require('../../../config');
const BATCH_BURN_LIMIT = 50;
Expand Down
9 changes: 3 additions & 6 deletions src/collection-actions/execute/mint-for-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@

// Accepts cosmos, stars addresses.

import {
calculateFee,
coin,
GasPrice,
MsgExecuteContractEncodeObject,
} from 'cosmwasm';
import { MsgExecuteContractEncodeObject } from '@cosmjs/cosmwasm-stargate';
import { calculateFee, coin, GasPrice } from '@cosmjs/stargate';

import { toStars } from '../../helpers/utils';
import { getClient } from '../../helpers/client';
import inquirer from 'inquirer';
Expand Down
6 changes: 4 additions & 2 deletions src/collection-actions/execute/mint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { MsgExecuteContractEncodeObject, coins, toUtf8, Coin } from 'cosmwasm';
import { MsgExecuteContractEncodeObject } from '@cosmjs/cosmwasm-stargate';
import { coins, Coin } from '@cosmjs/amino';
import { toUtf8 } from '@cosmjs/encoding';
import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx';
import { getClient } from '../../helpers/client';
import { isValidIpfsUrl, toStars } from '../../helpers/utils';
Expand Down Expand Up @@ -248,7 +250,7 @@ async function format_funds(funds: Coin) {

const args = process.argv.slice(2);
if (args.length == 0) {
console.log('No arguments provided, need --to or --for');
console.log('No arguments provided, need --to, --for or --token-uri');
} else if (args.length == 1 && args[0] == '--test-whitelist') {
test_whitelist();
} else if (args.length == 2 && args[0] == '--to') {
Expand Down
2 changes: 1 addition & 1 deletion src/collection-actions/execute/shuffle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Shuffling can act as a countermeasure against rarity snipers.
// Shuffle Fee is meant to be controlled by governance proposal. It is currently hardcoded to 500 stars.

import { coins } from 'cosmwasm';
import { coins } from '@cosmjs/amino';
import { toStars } from '../../helpers/utils';
import { getClient } from '../../helpers/client';

Expand Down
2 changes: 1 addition & 1 deletion src/collection-actions/execute/transfer-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// Accepts cosmos, stars addresses.

import { coin, MsgExecuteContractEncodeObject } from 'cosmwasm';
import { MsgExecuteContractEncodeObject } from '@cosmjs/cosmwasm-stargate';
import { toStars } from '../../helpers/utils';
import { getClient } from '../../helpers/client';
import inquirer from 'inquirer';
Expand Down
3 changes: 2 additions & 1 deletion src/collection-actions/execute/update-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Update metadata for token ids using metadata.csv
// Requires the collection is sg721-updatable contract

import { MsgExecuteContractEncodeObject, toUtf8 } from 'cosmwasm';
import { MsgExecuteContractEncodeObject } from '@cosmjs/cosmwasm-stargate';
import { toUtf8 } from '@cosmjs/encoding';
import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx';
import inquirer from 'inquirer';
import { assertIsDeliverTxSuccess } from '@cosmjs/stargate';
Expand Down
2 changes: 1 addition & 1 deletion src/collection-actions/query/query-mint-count.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmWasmClient } from 'cosmwasm';
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';
import { toStars } from '../../helpers/utils';

import * as fs from 'fs';
Expand Down
2 changes: 1 addition & 1 deletion src/collection-actions/query/query-minters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmWasmClient } from 'cosmwasm';
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';

const config = require('../../../config');

Expand Down
13 changes: 7 additions & 6 deletions src/create-collection/base-minter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CreateMinterMsgForNullable_Empty } from '@stargazezone/launchpad/src/BaseMinter.types';
import { coins, Decimal } from 'cosmwasm';
import { coins } from '@cosmjs/amino';
import { Decimal } from '@cosmjs/math';
import inquirer from 'inquirer';
import { getClient } from '../helpers/client';
import {
Expand Down Expand Up @@ -113,15 +114,15 @@ export async function create_minter() {
'The `wasm` event emitted by the contract execution:',
wasmEvent
);
console.info('Tx Hash: ', result.transactionHash);
if (wasmEvent != undefined) {
console.info('Add these contract addresses to config.js:');
console.info('factory address: ', wasmEvent.attributes[0]['value']);
console.info('minter address: ', wasmEvent.attributes[2]['value']);
console.info('Minter address: ', result.logs[0].events[16].attributes[0].value);
console.info(
'collection contract address: ',
wasmEvent.attributes[7]['value']
'Collection contract address: ',
result.logs[0].events[18].attributes[0].value
);
return wasmEvent.attributes[2]['value'];
return result.logs[0].events[16].attributes[0].value;
}
}

Expand Down
11 changes: 6 additions & 5 deletions src/create-collection/minter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {
CreateMinterMsgForVendingMinterInitMsgExtension,
Timestamp,
} from '@stargazezone/launchpad/src/VendingMinter.types';
import { coins, Decimal } from 'cosmwasm';
import { coins } from '@cosmjs/amino';
import { Decimal } from '@cosmjs/math';
import inquirer from 'inquirer';
import { getClient } from '../helpers/client';
import {
Expand Down Expand Up @@ -209,12 +210,12 @@ export async function create_minter(params: MinterParams) {
'The `wasm` event emitted by the contract execution:',
wasmEvent
);
console.info('Transaction Hash:', result.transactionHash);
if (wasmEvent != undefined) {
console.info('Add these contract addresses to config.js:');
console.info('factory address: ', wasmEvent.attributes[0]['value']);
console.info('minter address: ', wasmEvent.attributes[2]['value']);
console.info('sg721 contract address: ', wasmEvent.attributes[7]['value']);
return wasmEvent.attributes[2]['value'];
console.info('Minter address: ', result.logs[0].events[16].attributes[0].value);
console.info('Collection contract address: ', result.logs[0].events[18].attributes[0].value);
return result.logs[0].events[16].attributes[0].value;
}
}

Expand Down
11 changes: 6 additions & 5 deletions src/create-collection/open-edition-minter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Timestamp } from '@stargazezone/launchpad/src/VendingMinter.types';
import { coins, Decimal } from 'cosmwasm';
import { coins } from '@cosmjs/amino';
import { Decimal } from '@cosmjs/math';
import inquirer from 'inquirer';
import { getClient } from '../helpers/client';
import {
Expand Down Expand Up @@ -213,12 +214,12 @@ export async function create_minter(params: OpenEditionMinterParams) {
'The `wasm` event emitted by the contract execution:',
wasmEvent
);
console.info('Tx Hash: ', result.transactionHash);
if (wasmEvent != undefined) {
console.info('You may add these contract addresses to config.js to perform actions for the collection:');
console.info('Open Edition Factory address: ', wasmEvent.attributes[0]['value']);
console.info('Open Edition Minter address: ', wasmEvent.attributes[2]['value']);
console.info('sg721 contract address: ', wasmEvent.attributes[7]['value']);
return wasmEvent.attributes[2]['value'];
console.info('Open Edition Minter address: ', result.logs[0].events[16].attributes[0].value);
console.info('Collection contract address: ', result.logs[0].events[18].attributes[0].value);
return result.logs[0].events[16].attributes[0].value;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toBech32, fromBech32 } from 'cosmwasm';
import { toBech32, fromBech32 } from '@cosmjs/encoding';
const config = require('../../config');

export const toStars = (addr: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/marketplace/floor-price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Queries AsksSortedByPrice
// Outputs to console as csv

import { CosmWasmClient } from 'cosmwasm';
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';
import { toStars } from '../helpers/utils';
const config = require('../../config');
const fetch = require('node-fetch');
Expand Down
5 changes: 4 additions & 1 deletion src/marketplace/floor-sweeper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { toStars } from '../helpers/utils';
const config = require('../../config');
import inquirer from 'inquirer';
import { getClient } from '../helpers/client';
import { coin, MsgExecuteContractEncodeObject, toUtf8 } from 'cosmwasm';
import { MsgExecuteContractEncodeObject } from '@cosmjs/cosmwasm-stargate';
import { coin } from '@cosmjs/amino';
import { toUtf8 } from '@cosmjs/encoding';

import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx';
import { assertIsDeliverTxSuccess } from '@cosmjs/stargate';

Expand Down
2 changes: 1 addition & 1 deletion src/query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmWasmClient } from 'cosmwasm';
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';
import { toStars } from './helpers/utils';

const config = require('../config');
Expand Down
2 changes: 1 addition & 1 deletion src/splits/query-splits.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmWasmClient } from 'cosmwasm';
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';
import { toStars } from '../helpers/utils';

const config = require('../../config');
Expand Down
2 changes: 1 addition & 1 deletion src/splits/splits.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import inquirer from 'inquirer';
import { toStars } from '../helpers/utils';
import { getClient } from '../helpers/client';
import { toBase64 } from 'cosmwasm';
import { toBase64 } from '@cosmjs/encoding';
import { toUtf8 } from '@cosmjs/encoding';
import { InstantiateMsg as SplitsInstantiateMsg } from '@stargazezone/launchpad/src/Splits.types';

Expand Down
2 changes: 1 addition & 1 deletion src/vending-snapshot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmWasmClient } from 'cosmwasm';
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';
import { appendFileSync } from 'fs';

const config = require('../config');
Expand Down
2 changes: 1 addition & 1 deletion src/whitelist/whitelist-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// If you run into an error with `member_limit`, run `yarn whitelist --increase-member-limit`

import { ExecuteMsg } from '@stargazezone/types/contracts/whitelist/execute_msg';
import { MsgExecuteContractEncodeObject } from 'cosmwasm';
import { MsgExecuteContractEncodeObject } from '@cosmjs/cosmwasm-stargate';
import { toStars } from '../helpers/utils';
import inquirer from 'inquirer';
import { getClient } from '../helpers/client';
Expand Down
2 changes: 1 addition & 1 deletion src/whitelist/whitelist-flex.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { InstantiateMsg } from '@stargazezone/types/contracts/whitelist/instantiate_msg';
import { ExecuteMsg } from '@stargazezone/types/contracts/whitelist/execute_msg';
import { Timestamp } from '@stargazezone/types/contracts/minter/shared-types';
import { coins } from 'cosmwasm';
import { coins } from '@cosmjs/amino';
import inquirer from 'inquirer';
import { toStars } from '../helpers/utils';
import { getClient } from '../helpers/client';
Expand Down
2 changes: 1 addition & 1 deletion src/whitelist/whitelist.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { InstantiateMsg } from '@stargazezone/types/contracts/whitelist/instantiate_msg';
import { ExecuteMsg } from '@stargazezone/types/contracts/whitelist/execute_msg';
import { Timestamp } from '@stargazezone/types/contracts/minter/shared-types';
import { coins } from 'cosmwasm';
import { coins } from '@cosmjs/amino';
import inquirer from 'inquirer';
import { toStars, nameToAddress } from '../helpers/utils';
import { getClient } from '../helpers/client';
Expand Down

0 comments on commit 135e40a

Please sign in to comment.