XRPL Docs (Korean)
  • XRPL Docs(Kor)
  • Introduction
    • XRP Ledger란?
    • XRP란?
    • Crypto Wallets
    • Transactions and Requests
    • Software Ecosystem
  • Use Cases
    • 결제(Payments)
      • P2P 결제(Peer-to-Peer Payments)
      • 예금 제한(Restricting Deposits)
      • 스마트 컨트랙트(Smart Contracts)
    • 토큰화(Tokenization)
      • 스테이블코인 발행인(Stablecoin Issuer)
      • NFT 마켓플레이스 개요(NFT Marketplace Overview)
    • 탈중앙화 금융(Decentralized Finance)
      • 알고리즘 트레이딩(Algorithmic Trading)
      • 거래소에 XRP 상장하기((List XRP as an Exchange)
  • Concepts
    • 소개
      • 컨센서스 소개
      • XRP
      • 소프트웨어 생태계
    • XRP Ledger 서버
      • rippled 서버 모드(rippled Server Modes)
      • 클러스터링(Clustering)
      • Ledger 역사
      • 피어 프로토콜(Peer Protocol)
      • 트랜잭션 검열 감지(Transaction Censorship Detection)
      • 병렬 네트워크(Parallel Networks)
      • 수정안(Amendments)
        • XRP Ledger에 코드를 기여하는 방법
        • 알려진 수정안
      • 클리오 서버(The Clio Server)
    • 컨센서스 네트워크(Consensus Protocol)
      • 컨센서스 구조(Consensus Structure)
      • 컨센서스 원칙과 규칙(Consensus Principles and Rules)
      • 공격과 실패 모드에 대한 컨센서스 보호(Consensus Protections Against Attacks and Failure Modes)
      • 불변성 체크
      • 부정 UNL
      • 트랜잭션 취소 정보
      • 트랜잭션 변조 가능성
      • 수수료 투표
      • 컨센서스 연구
    • Ledgers
      • Ledger 구조(Ledger Structure)
      • 개방형, 폐쇄형, 검증형 Ledgers(Open, Closed, and Validated Ledgers)
      • Ledger 마감 시간(Ledger Close Times)
    • 트랜잭션(Transactions)
      • 수수료(Fees)
      • 신뢰할 수 있는 트랜잭션 제출(Reliable Transaction Submission)
      • 보안 서명(Secure Signing)
      • 출발, 데스티네이션 태그(Source and Destination Tags)
      • 트랜잭션 비용(Transaction Cost)
      • 트랜잭션 대기열(Transaction Queue)
      • 결과의 불변성(Finality of Results)
        • 트랜잭션 결과 조회(Look Up Transaction Results)
        • Transaction Malleability
    • 결제 유형
      • XRP 직접 결제
      • 교차 화폐 결제
      • 수표
      • 에스크로
      • 부분 결제
      • 결제 채널
    • 토큰(Tokens)
      • Non-Fungible Tokens
        • NFT 정보 저장소(NFT Payload Storage)
        • XRP Ledger에서 NFT 토큰 거래(Trading NFTokens on the XRP Ledger)
        • NFT Reserve Requirements
        • 일괄 발행(Batch minting)
        • 다른 계정에게 NFT 발행 권한 부여(Authorizing Another Account to Mint Your NFTs)
        • NFT 경매 진행하기(Running an NFT Auction)
        • NFT를 컬렉션으로 발행하기(Minting NFTs into Collections)
        • NFT의 고정 공급 보장하기(Guaranteeing a Fixed Supply of NFTs)
        • NFT 관련 API(NFT APIs)
      • 신뢰선과 발급(Trust Lines and Issuing)
      • 승인된 신뢰선(Authorized Trust Lines)
      • 토큰 환수(Clawing Back Tokens)
      • Freezing Tokens(토큰 동결)
        • 동결에 대한 일반적인 오해(Common Misunderstandings about Freezes )
      • Rippling
      • 이체 수수료(Transfer Fees)
      • 경로(Paths)
      • Demurrage(과잉보유비용)
      • 탈중앙화 거래소(Decentralized Exchange)
        • 제안(Offers)
        • Auto-Bridging
        • Tick Size
        • AMM(Automated Market Makers)
    • 계정
      • 다중 서명
      • 티켓
      • 계정 유형
      • 계정 삭제
      • 준비금(Reserves)
      • 주소(Addresses)
      • 암호화 키(Cryptographic Keys)
      • 입금 승인(Deposit Authorization)
  • Tutorials
    • 퍼블릭 서버(Public Servers)
    • Python
      • Python으로 시작하기(Get Started Using Python)
      • python 모듈형 튜토리얼(Modular Tutorials in Python)
        • python을 이용한 Send Payments(Send Payments Using Python)
          • 계정 생성 및 XRP 전송(Create Accounts and Send XRP Using Python)
          • 신뢰 생성 및 Currency 전송 (Create Trust Line and Send Currency Using Python)
          • 시간 보류 에스크로 생성(Create Time-based Escrows Using Python)
        • python을 이용한 NFTs(NFTs Using Python)
          • NFTs 발행과 소각(Mint and Burn NFTs Using Python)
          • NFTs 전송 (Transfer NFTs Using Python)
          • NFT 판매 중개 (Broker an NFT Sale Using Python)
          • 공인 발행인 지정 (Assign an Authorized Minter Using Python)
          • NFTs 일괄 발행 (Batch Mint NFTs Using Python)
        • Python에서 데스크톱 지갑 구축(Build a Desktop Wallet in Python)
    • JavaScript
      • JavaScript로 시작하기(Get Started Using JavaScript)
      • JavaScript 모듈형 튜토리얼(Modular Tutorials in JavaScript)
        • JavaScript를 이용한 Send Payments(Send Payments Using JavaScript)
          • JavaScript를 이용한 계정 생성 및 XRP 전송(Create Accounts and Send XRP Using JavaScript)
          • JavaScript를 이용한 신뢰선 생성 및 화폐 전송(Create Trust Line and Send Currency Using JavaScript)
          • 시간 기반 에스크로 생성하기(Create Time-based Escrows Using JavaScript)
          • 조건부 에스크로 생성하기(Create Conditional Escrows Using JavaScript)
        • JavaScript를 이용한 NFTs(NFTs Using JavaScript)
          • JavaScript를 이용한 NFTs 발행 및 소각(Mint and Burn NFTs Using JavaScript)
          • JavaScript를 이용한 NFTs 전송(Transfer NFTs Using JavaScript)
          • JavaScript를 이용한 NFT 판매 중개(Broker an NFT Sale Using JavaScript)
          • JavaScript를 이용한 공인 발행인 지정(Assign an Authorized Minter Using JavaScript)
          • JavaScript를 이용한 NFTs 일괄 발행(Batch Mint NFTs Using JavaScript)
      • JavaScript를 이용한 브라우저 지갑 개발(Build a Browser Wallet in JavaScript)
      • JavaScript를 이용한 데스크탑 지갑 개발(Build a Desktop Wallet in JavaScript)
    • Java
      • Java로 시작하기(Get Started Using Java)
    • HTTP / Websocket APIs
      • HTTP/WebSocket API 사용 시작하기(Get Started Using HTTP / WebSocket APIs)
      • WebSocket으로 수신 결제 모니터링(Monitor Incoming Payments with WebSocket)
    • Tasks
      • 계정 설정 관리(Manage Account Settings)
        • 일반 키 쌍 할당
        • 일반 키 쌍 변경 또는 제거
        • 마스터 키 쌍 비활성화
        • 다중 서명 설정
        • 다중 서명 트랜잭션 전송
        • 데스티네이션 태그 필요
        • 오프라인 계정 설정 튜토리얼
        • 티켓 사용(Use Tickets)
      • XRP 보내기(Send XRP)
      • 특수 결제 유형 사용(Use Specialized Payment Types)
        • 에스크로 사용(Use escrow)
          • 시간 보류 에스크로 보내기(Send a Time-Held Escrow)
          • 조건부 보류 에스크로 보내기(Send a Conditionally-Held Escrow)
          • 만료된 에스크로 취소(Cancel an Expired Escrow)
          • 에스크로 조회(Look up Escrows)
          • 에스크로를 스마트 컨트랙트로 사용(Use an Escrow as a Smart Contract)
        • 결제 채널 사용(Use Payment Channels)
          • 결제 채널을 열어 거래소 간 네트워크 활성화(Open a Payment Channel to Enable an Inter-Exchange Network)
        • 수표 사용(Use Checks)
          • 수표 전송(Send a Check)
          • 정확한 금액의 수표 현금화(Cash a Check for an Exact Amount)
          • 유연한 금액의 수표 현금화(Cash a Check for a Flexible Amount)
          • 수표 취소(Cancel a Check)
          • 발신자별 수표 조회(Look Up Checks by Sender)
          • 수취인별 수표 조회(Look Up Checks by Recipient)
      • 토큰 사용(Use Tokens)
        • 대체가능한 토큰 발행(Issue a Fungible Token)
        • 탈중앙화 거래소에서 거래(Trade in the Decentralized Exchange)
        • 동결 금지 활성화
        • 글로벌 동결 시행
        • 신뢰선 동결하기
    • Apps 구축
      • JS에서 데스크톱 지갑 구축
      • JS에서 브라우저 지갑 구축
    • XRP Ledger 비즈니스
      • XRP 차트에 거래소 등록하기
      • 스테이블코인 발행자 되기
    • rippled 서버 관리
      • rippled 설치
        • 시스템 요구 사항
        • CentOS/Red Hat에 yum으로 설치하기
        • 우분투 또는 데비안 리눅스에 설치
        • 리눅스에서 자동 업데이트
        • CentOS/Red Hat에서 수동 업데이트
        • 우분투 또는 데비안에서 수동 업데이트
        • 리포팅 모드에서 rippled 빌드 및 실행
        • 용량 계획
        • rippled v1.3.x 마이그레이션 지침
      • rippled 구성
        • rippled를 검증인으로 실행하기
        • rippled를 스톡 서버로 실행
        • 수정안 투표 구성
        • 수정안 테스트
        • StatsD 구성
        • rippled를 병렬 네트워크에 연결하기
        • 온라인 삭제 구성
        • 권고 삭제 구성
        • 히스토리 샤딩 구성
        • 전체 히스토리 구성
        • gRPC 구성
        • 공개 서명 사용
      • 피어링 구성
        • 클러스터 rippled 서버
        • 비공개 서버 구성
        • 피어 크롤러 구성
        • 링크 압축 사용
        • 피어링을 위한 포트 포워드
        • 특정 피어에 수동으로 연결
        • 최대 피어 수 설정
        • 피어 예약 사용
      • stand-alone 모드에서 rippled 기능 테스트하기
        • stand-alone 모드에서 새 제네시스 ledger 시작하기
        • stand-alone 모드에서 저장된 ledger 불러오기
        • stand-alone 모드에서 ledger 진행하기
      • 문제 해결
        • rippled 문제 진단하기
        • 상태 확인 개입
        • 로그 메시지 이해
        • rippled 서버가 동기화되지 않음
        • rippled 서버가 수정이 차단됨
        • rippled 서버가 시작되지 않음
        • SQLite 트랜잭션 데이터베이스 페이지 크기 문제 해결
    • 클리오 서버 관리
      • 우분투 리눅스에 클리오 설치
  • References
    • XRP Ledger 프로토콜 참조(XRP Ledger Protocol Reference)
      • 기본 데이터 유형(Basic Data Types)
        • base58 인코딩(base58 Encodings)
        • 화폐 형식(Currency Formats)
        • NFToken
      • Ledger 데이터 형식(Ledger Data Formats)
        • Ledger 헤더(Ledger Header)
        • Ledger 객체 IDs
        • Ledger 객체 유형
          • AccountRoot
          • Amendments
          • AMM(experimental - 수정중)
          • Check
          • DepositPreauth
          • DirectoryNode
          • Escrow
          • FeeSettings
          • LedgerHashes
          • NegativeUNL
          • NFTokenOffer
          • NFTokenPage
          • Offer
          • PayChannel
          • RippleState
          • SignerList
          • Ticket
      • 트랜잭션 참조(Transaction Reference)
        • 트랜잭션 공통 필드(Transaction Common Fields)
        • 트랜잭션 유형(Transaction Types)
          • AccountSet
          • AccountDelete
          • AMMBid
          • AMMCreate
          • AMMDelete
          • AMMDeposit
          • CheckCancel
          • CheckCash
          • CheckCreate
          • DepositPreauth
          • EscrowCancel
          • EscrowCreate
          • EscrowFinish
          • NFTokenAcceptOffer
          • NFTokenBurn
          • NFTokenCancelOffer
          • NFTokenCreateOffer
          • NFTokenMint
          • OfferCancel
          • OfferCreate
          • Payment
          • PaymentChannelClaim
          • PaymentChannelCreate
          • PaymentChannelFund
          • SetRegularKey
          • SignerListSet
          • TicketCreate
          • TrustSet
        • Pseudo-Transactions
          • EnableAmendment
          • SetFee
          • UNLModify
        • 트랜잭션 결과(Transaction Results)
          • tec Codes
          • tef Codes
          • tel Codes
          • tem Codes
          • ter Codes
          • tes Success
        • 트랜잭션 메타데이터(Transaction Metadata)
      • Binary Format
    • 클라이언트 라이브러리
      • JavaScript / TypeScript 클라이언트 라이브러
        • ripple-lib 1.x에서 xrpl.js 2.x로의 마이그레이션 가이드
      • Python 클라이언트 라이브러리
      • Java 클라이언트 라이브러리
      • Ruby 클라이언트 라이브러리
    • HTTP / WebSocket APIs
      • API 규칙
        • 요청 형식
        • 응답 형식
        • 오류 형식
        • 마커 및 페이지네이션
        • 속도 제한
        • rippled 서버 상태
      • 공개 API 메소드
        • 계정 메소드
          • account_channels
          • account_currencies
          • account_info
          • account_lines
          • account_nfts
          • account_objects
          • account_offers
          • account_tx
          • gateway_balances
          • noripple_check
        • Ledger 메소드
          • ledger
          • ledger_closed
          • ledger_current
          • ledger_data
          • ledger_entry
        • 트랜잭션 메소드
          • submit
          • submit_multisigned
          • transaction_entry
          • tx
          • tx_history
        • 경로와 오더북 메소드
          • book_offers
          • deposit_authorized
          • nft_buy_offers
          • nft_sell_offers
          • path_find
          • ripple_path_find
        • 결제 채널 메소드
          • channel_authorize
          • channel_verify
        • 구독 메소드
          • 구독
          • 구독 취소
        • Server Info 메소드
          • fee
          • manifest
          • server_info (rippled)
          • server_state
        • 클리오 서버
          • server_info
          • ledger
          • nft_history
          • nft_info
        • 유틸리티 메소드
          • json
          • ping
          • random
      • 관리자 API 메소드
        • 키 생성 방법
          • validation_create
          • wallet_propose
        • 로깅 및 데이터 관리 메소드
          • can_delete
          • crawl_shards
          • download_shard
          • ledger_cleaner
          • ledger_request
          • log_level
          • logrotate
          • node_to_shard
        • 서버 컨트롤 메소드
          • ledger_accept
          • stop
          • validation_seed
        • 서명 메소드
          • sign
          • sign_for
        • 피어 관리 메소드
          • connect
          • peer_reservations_add
          • peer_reservations_del
          • peer_reservations_list
          • peers
        • 상태 및 디버깅 메소드
          • consensus_info
          • feature
          • fetch_info
          • get_counts
          • print
          • validator_info
          • validators
        • rippled 커맨드라인 사용 참조
        • 피어 포트 메소드
          • 상태 확인
          • 피어 크롤러
          • 유효성 검증인 목록 메소드
    • xrp-ledger.toml File
  • Infrastructure
    • 커맨드 라인 사용법(Commandline Usage)
    • Install rippled
      • System Requirements
      • Install on CentOS/RedHat with yum
      • Install on Ubuntu or Debian Linux
      • Update Automatically on Linux
      • Update Manually on CentOS/Red Hat
      • Update Manually on Ubuntu or Debian
      • Build and Run rippled in Reporting Mode
      • Capacity Planning
    • Configure rippled
      • Server Modes
        • Run rippled as a Validator
        • Run rippled as a Stock Server
      • Data Retention
        • Configure Full History
        • 온라인 삭제(Online Deletion)
        • Configure Online Deletion
        • Configure Advisory Deletion
        • 히스토리 샤딩(History Sharding)
        • Configure History Sharding
      • Configure Amendment Voting
      • Test Amendments
      • Configure StatsD
      • Connect Your rippled to a Parallel Network
      • Configure gRPC
      • Enable Public Signing
    • Peering
      • Cluster rippled Servers
      • Configure a Private Server
      • Configure the Peer Crawler
      • Enable Link Compression
      • Forward Ports for Peering
      • Manually Connect to a Specific Peer
      • Set Maximum Number of Peers
      • Use a Peer Reservation
    • Testing and Auditing
      • Start a New Genesis Ledger in Stand-Alone Mode
      • Load a Saved Ledger in Stand-Alone Mode
      • Advance the Ledger in Stand-Alone Mode
    • Troubleshooting
      • Diagnosing Problems with rippled
      • Health Check Interventions
      • Understanding Log Messages
      • rippled Server Doesn't Sync
      • rippled Server is Amendment Blocked
      • rippled Server Won't Start
    • Install Clio on Ubuntu Linux
    • Run a Private Network with Docker
Powered by GitBook
On this page
  • 사용법(Usage)
  • 계정 가져오기(Get an Account)
  • Batch Mint NFTs
  • Get Batch NFTs
  • Code Walkthrough
  • Batch Mint
  • lesson7-batch-minting.py
  1. Tutorials
  2. Python
  3. python 모듈형 튜토리얼(Modular Tutorials in Python)
  4. python을 이용한 NFTs(NFTs Using Python)

NFTs 일괄 발행 (Batch Mint NFTs Using Python)

Previous공인 발행인 지정 (Assign an Authorized Minter Using Python)NextPython에서 데스크톱 지갑 구축(Build a Desktop Wallet in Python)

Last updated 1 year ago

한 번에 여러 개의 NFT를 채굴하는 애플리케이션을 생성하고, for 루프를 사용해 트랜잭션을 차례로 전송할 수 있습니다. 가장 좋은 방법은 티켓을 사용해 트랜잭션 시퀀스 번호를 예약하는 것입니다. 티켓을 사용하지 않고 NFT를 생성하는 애플리케이션을 만들 경우, 어떤 이유로든 트랜잭션이 실패하면 애플리케이션이 오류와 함께 중지됩니다. 티켓을 사용하는 경우 애플리케이션은 트랜잭션을 계속 전송하며, 나중에 개별 실패의 원인을 조사할 수 있습니다.

사용법(Usage)

계정 가져오기(Get an Account)

  1. lesson7-batch-minting.py을 열고 실행합니다.

  2. 테스트 계정을 받습니다.

    1. 기존 계정 시드를 사용하려는 경우:

      1. Standby Seed 필드에 계정 시드를 붙여넣습니다.

      2. Get Standby Account 클릭

    2. 기존 계정 시드를 사용하지 않으려면 Get Standby Account Info를 클릭합니다.

  3. Get Standby Account Info를 클릭하여 현재 XRP 잔액을 확인합니다.

Batch Mint NFTs

이 예시를 통해 하나의 고유 아이템에 대해 여러 개의 NFT를 발행할 수 있습니다. NFT는 오리지널 아트워크의 "프린트", 이벤트 티켓 또는 기타 한정된 고유 아이템 세트를 나타낼 수 있습니다.

To batch mint non-fungible token objects:

  1. NFT URI를 입력합니다. 이는 NFT 객체와 관련된 데이터 또는 메타데이터를 가리키는 URI입니다. 고유한 URI가 없는 경우 이 샘플 URI를 사용할 수 있습니다: ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi.

  2. flage 필드를 설정합니다. 테스트 목적으로 값을 8로 설정하는 것이 좋습니다. 이렇게 하면 tsTransferable 플래그가 설정되어 NFT 객체를 다른 계정으로 전송할 수 있습니다. 그렇지 않으면 NFT 개체는 발행 계정으로만 다시 전송할 수 있습니다. 사용 가능한 NFT 발행 플래그는 NFTokenMint를 참조하세요.

  3. Enter the Transfer Fee, a percentage of the proceeds that the original creator receives from future sales of the NFT. This is a value of 0-50000 inclusive, allowing transfer fees between 0.000% and 50.000% in increments of 0.001%. If you do not set the Flags field to allow the NFT to be transferrable, set this field to 0.

  4. 값은 0-50000을 포함하여 0.000%에서 50.000% 사이의 전송 수수료를 0.001% 단위로 허용합니다. NFT를 양도할 수 있도록 플래그 필드를 설정하지 않은 경우 이 필드를 0으로 설정합니다.

  5. Enter the Taxon for the NFT. If you do not have a need for the Taxon field, set this value to 0.

  6. Enter an NFT Count of up to 200 NFTs to create in one batch.

  7. Click Batch Mint NFTs.

Get Batch NFTs

Click Get Batch NFTs to get the current list of NFTs for your account.

The difference between this function and the getTokens() function used earlier is that it allows for larger lists of tokens, sending multiple requests if the tokens exceed the number of objects allowed in a single request.

Code Walkthrough

Import dependencies and define the testnet_url variable.

import xrpl
from xrpl.clients import JsonRpcClient
from xrpl.wallet import Wallet
from xrpl.models.requests import AccountNFTs

testnet_url = "https://s.altnet.rippletest.net:51234"

Batch Mint

Pass the values seed, uri, flags, transfer_fee, taxon, and count.

def batch_mint(seed, uri, flags, transfer_fee, taxon, count):
    """batch_mint"""

Get the account wallet and a client instance.

    wallet=Wallet.from_seed(seed)
    client=JsonRpcClient(testnet_url)

Request the full account info.

    acct_info = xrpl.models.requests.account_info.AccountInfo(
        account=wallet.classic_address,
        ledger_index='validated'
    )
    get_seq_request = client.request(acct_info)

Parse the current sequence value.

    current_sequence=get_seq_request.result['account_data']['Sequence']

Create a transaction to create tickets, starting at the current sequence number.

    ticket_tx=xrpl.models.transactions.TicketCreate(
        account=wallet.address,
        ticket_count=int(count),
        sequence=current_sequence  
    )

Submit the ticket transaction and wait for the result.

    response=xrpl.transaction.submit_and_wait(ticket_tx,client,wallet)

Create a request to obtain the next ticket number.

    ticket_numbers_req=xrpl.models.requests.AccountObjects(
        account=wallet.address,
        type='ticket'
    )
    ticket_response=client.request(ticket_numbers_req)

Create the tickets variable to store an array of tickets.

    tickets=[int(0)] * int(count)
    acct_objs= ticket_response.result['account_objects']

Create an array of ticket numbers.

    for x in range(int(count)):
        tickets[x] = acct_objs[x]['TicketSequence']

Initialize variables to be used in the mint loop.

    reply=""
    create_count=0

Use a for loop to send repeated mint requests, using the ticket_sequence field to uniquely identify the mint transactions.

    for x in range(int(count)):
        mint_tx=xrpl.models.transactions.NFTokenMint(
            account=wallet.classic_address,
            uri=xrpl.utils.str_to_hex(uri),
            flags=int(flags),
            transfer_fee=int(transfer_fee),
            ticket_sequence=tickets[x],
            sequence=0,
            nftoken_taxon=int(taxon)
        )

Submit each transaction and report the results.

        try:
            response=xrpl.transaction.submit_and_wait(mint_tx,client,
                wallet)
            create_count+=1 
        except xrpl.transaction.XRPLReliableSubmissionException as e:
            reply+=f"Submit failed: {e}\n"
    reply+=str(create_count)+' NFTs generated.'
    return reply

Get Batch

This version of getTokens() allows for a larger set of NFTs by watching for a marker at the end of each batch of NFTs. Subsequent requests get the next batch of NFTs starting at the previous marker, until all NFTs are retrieved.

def get_batch(seed, account):
    """get_batch"""

Get a client instance. Since this is a request for publicly available information, no wallet is required.

    client=JsonRpcClient(testnet_url)

Define the request for account NFTs. Set a return limit of 400 objects.

    acct_nfts=AccountNFTs(
        account=account,
        limit=400
    )

Send the request.

    response=client.request(acct_nfts)

Capture the result in the responses variable.

    responses=response.result

While there is a marker value in the response, continue to define and send requests for 400 account NFTs at a time. Capture the result from each request in the responses variable.

    while(acct_nfts.marker):
        acct_nfts=AccountNFTs(
            account=account,
            limit=400,
            marker=acct_nfts.marker
        )
        response=client.request(acct_nfts)
        responses+=response.result

Return the responses variable.

    return responses

lesson7-batch-minting.py

This form is based on earlier examples, with unused fields, handlers, and buttons removed. Additions are highlighted below.

import tkinter as tk
import xrpl
import json

from mod1 import get_account, get_account_info

Import dependencies from mod7.py.

from mod7 import batch_mint, get_batch

Add Module 7 handlers.

def batch_mint_nfts():
    results = batch_mint(
        ent_standby_seed.get(),
        ent_standby_uri.get(),
        ent_standby_flags.get(),
        ent_standby_transfer_fee.get(),
        ent_standby_taxon.get(),
        ent_standby_nft_count.get()
    )
    text_standby_results.delete("1.0", tk.END)
    text_standby_results.insert("1.0", json.dumps(results, indent=4))

def standby_get_batch_nfts():
    results = get_batch(
        ent_standby_seed.get(),
        ent_standby_account.get()
    )
    text_standby_results.delete("1.0", tk.END)
    text_standby_results.insert("1.0", json.dumps(results, indent=4))

# Module 1 Handlers
def get_standby_account():
    new_wallet = get_account(ent_standby_seed.get())
    ent_standby_account.delete(0, tk.END)
    ent_standby_seed.delete(0, tk.END)
    ent_standby_account.insert(0, new_wallet.classic_address)
    ent_standby_seed.insert(0, new_wallet.seed)

def get_standby_account_info():
    accountInfo = get_account_info(ent_standby_account.get())
    ent_standby_balance.delete(0, tk.END)
    ent_standby_balance.insert(0,accountInfo['Balance'])
    text_standby_results.delete("1.0", tk.END)
    text_standby_results.insert("1.0",json.dumps(accountInfo, indent=4))

Rename the window for Module 7.

# Create a new window with the title "Python Module - Batch Minting"
window = tk.Tk()
window.title("Python Module - Batch Minting")



# Form frame
frm_form = tk.Frame(relief=tk.SUNKEN, borderwidth=3)
frm_form.pack()

# Create the Label and Entry widgets for "Standby Account"
lbl_standy_seed = tk.Label(master=frm_form, text="Standby Seed")
ent_standby_seed = tk.Entry(master=frm_form, width=50)
lbl_standby_account = tk.Label(master=frm_form, text="Standby Account")
ent_standby_account = tk.Entry(master=frm_form, width=50)
lbl_standby_balance = tk.Label(master=frm_form, text="XRP Balance")
ent_standby_balance = tk.Entry(master=frm_form, width=50)
lbl_standby_uri = tk.Label(master=frm_form, text="NFT URI")
ent_standby_uri = tk.Entry(master=frm_form, width=50)
lbl_standby_flags = tk.Label(master=frm_form, text="Flags")
ent_standby_flags = tk.Entry(master=frm_form, width=50)
lbl_standby_transfer_fee = tk.Label(master=frm_form, text="Transfer Fee")
ent_standby_transfer_fee = tk.Entry(master=frm_form, width="50")
lbl_standby_taxon = tk.Label(master=frm_form, text="Taxon")
ent_standby_taxon = tk.Entry(master=frm_form, width="50")
lbl_standby_nft_id = tk.Label(master=frm_form, text="NFT ID")
ent_standby_nft_id = tk.Entry(master=frm_form, width="50")
lbl_standby_nft_offer_index = tk.Label(master=frm_form, text="NFT Offer Index")
ent_standby_nft_offer_index = tk.Entry(master=frm_form, width="50")

Add the NFT Count field for batch minting.

lbl_standby_nft_count=tk.Label(master=frm_form, text="NFT Count")
ent_standby_nft_count=tk.Entry(master=frm_form, width="50")
lbl_standby_results = tk.Label(master=frm_form,text="Results")
text_standby_results = tk.Text(master=frm_form, height = 20, width = 65)

# Place field in a grid.
lbl_standy_seed.grid(row=0, column=0, sticky="w")
ent_standby_seed.grid(row=0, column=1)
lbl_standby_account.grid(row=2, column=0, sticky="e")
ent_standby_account.grid(row=2, column=1)
lbl_standby_balance.grid(row=5, column=0, sticky="e")
ent_standby_balance.grid(row=5, column=1)
lbl_standby_uri.grid(row=8, column=0, sticky="e")
ent_standby_uri.grid(row=8, column=1, sticky="w")
lbl_standby_flags.grid(row=9, column=0, sticky="e")
ent_standby_flags.grid(row=9, column=1, sticky="w")
lbl_standby_transfer_fee.grid(row=10, column=0, sticky="e")
ent_standby_transfer_fee.grid(row=10, column=1, sticky="w")
lbl_standby_taxon.grid(row=11, column=0, sticky="e")
ent_standby_taxon.grid(row=11, column=1, sticky="w")

Place the NFT Count field in the grid.

lbl_standby_nft_count.grid(row=13, column=0, sticky="e")
ent_standby_nft_count.grid(row=13, column=1, sticky="w")
lbl_standby_results.grid(row=14, column=0, sticky="ne")
text_standby_results.grid(row=14, column=1, sticky="nw")

#############################################
## Buttons ##################################
#############################################

# Create the Standby Account Buttons
btn_get_standby_account = tk.Button(master=frm_form, text="Get Standby Account",
                                    command = get_standby_account)
btn_get_standby_account.grid(row=0, column=2, sticky = "nsew")
btn_get_standby_account_info = tk.Button(master=frm_form,
                                         text="Get Standby Account Info",
                                         command = get_standby_account_info)
btn_get_standby_account_info.grid(row=1, column=2, sticky = "nsew")

Add the Batch Mint NFTs and Get Batch NFTs buttons.

btn_standby_batch_mint = tk.Button(master=frm_form,
                                         text="Batch Mint NFTs",
                                         command = standby_batch_mint)
btn_standby_batch_mint.grid(row=5, column=2, sticky = "nsew")
btn_standby_get_batch_nfts = tk.Button(master=frm_form,
                                         text="Get Batch NFTs",
                                         command = standby_get_batch_nfts)
btn_standby_get_batch_nfts.grid(row=8, column=2, sticky = "nsew")
# Start the application
window.mainloop()

Was this page helpful?

을 다운로드하거나 복제하여 자신의 브라우저에서 샘플을 사용해 볼 수 있습니다.

You can download or clone the to try each of the samples locally.

Quickstart Samples
Quickstart Samples