当前位置:网站首页>OpenSea PHP开发包
OpenSea PHP开发包
2022-06-25 04:01:00 【新缸中之脑】
OpenSea PHP开发包是全球最大NFT集市OpenSea的官方API的面向对象的PHP封装。
用熟悉的语言学习 Web3 DApp开发 :Java | Php | Python | .Net / C# | Golang | Node.JS | Flutter / Dart
1、安装OpenSea PHP
OpenSea PHP开发包的前置安装要求如下:
- PHP >= 7.4
- PSR-17实现
- PSR-18实现
使用Composer安装:
composer require owenvoke/opensea guzzlehttp/guzzle:^7.0.1 http-interop/http-factory-guzzle:^1.0
2、快速上手OpenSea PHP
查询NFT资产:
// Include the Composer autoloader
require_once __DIR__ . '/vendor/autoload.php';
use OwenVoke\OpenSea\Client;
$client = new Client();
$assets = $client->assets()->all();
API令牌验证:
use OwenVoke\OpenSea\Client;
$client = new Client();
$client->authenticate($apiToken, null, Client::AUTH_ACCESS_TOKEN);
3、资产API
资产API提供了访问OpenSea资产API的PHP封装。
查询资产清单:
// Retrieve a standard list of assets with the default parameters
$response = $client->assets()->all();
// Retrieve a custom list of assets using parameters
$response = $client->assets()->all([
'owner' => 'owners_address_here',
]);
查询指定资产:
$response = $client->assets()->show($address, $tokenId);
4、资产包API
资产包API提供了访问OpenSea资产包API的PHP封装。
查询资产包清单:
// Retrieve a standard list of bundles with the default parameters
$response = $client->bundles()->all();
// Retrieve a custom list of bundles using parameters
$response = $client->bundles()->all([
'owner' => 'owners_address_here',
]);
5、藏品集API
藏品集API提供了访问OpenSea藏品集API的PHP封装。
查询藏品集清单:
// Retrieve a standard list of collections with the default parameters
$response = $client->collections()->all();
// Retrieve a custom list of collections using parameters
$response = $client->collections()->all([
'asset_owner' => 'owners_address_here',
]);
6、合约API
合约API提供了访问OpenSea合约API的PHP封装。
查询指定的合约:
$response = $client->contracts()->show($contractAddress);
7、事件API
事件API提供了访问OpenSea事件API的PHP封装。
查询事件清单:
// Retrieve a standard list of events with the default parameters
$response = $client->events()->all();
// Retrieve a custom list of events using parameters
$response = $client->events()->all([
'account_address' => 'accounts_wallet_address_here',
]);
原文链接: OpenSea PHP开发包 — 汇智网
边栏推荐
- 记录小知识点
- Package for gbase 8s
- Trigger for gbase 8s
- 515. find the maximum value / Sword finger offer II 095 in each tree row Longest common subsequence
- 什么是存储引擎以及MySQL常见的三种数据库存储引擎
- Immutable learning road -- farewell to traditional copy
- STM32的DMA双缓冲模式详解
- Upgrade PHP to php7 The impact of X (I). The problem of session retention. Keep login
- CTF_ Web:8-bit controllable character getshell
- What is data persistence?
猜你喜欢

Xiaobai learns MySQL - Statistical 'opportunism'

cnpm : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。

Gbase 8s overall architecture

Vscode 设置clang-format

The solution of wechat applet switchtab unable to take parameters

【无标题】

Code scanning payment flow chart of Alipay payment function developed by PHP

GBASE 8s 索引R树

Deep learning - several types of learning

Record small knowledge points
随机推荐
GBASE 8s存储过程语法结构
哪个编程语言实现hello world最烦琐?
30岁了开始自学编程,家里比较困难还来得及吗?
Immutable學習之路----告別傳統拷貝
Upgrade PHP to php7 X (III) failure of wechat payment callback
GBASE 8s的数据视图
OOP 向量加减(友元+拷贝构造)
mongodb集群
Unity Quad culls shaders with back faces and transparent parts
Record of the 25th week
我的IC之旅——资深芯片设计验证工程师成长——“胡”说IC工程师完美进阶
2.0springmvc uses restful
English Grammar - pronunciation rules
第九章 APP项目测试(2) 测试工具
php封装curl发送get、post请求方法,并使用
第二十五周记录
PHP encapsulates curl to send get and post request methods, and uses
GBASE 8s存儲過程語法結構
js中的concat()
CTF_ Web: deserialization learning notes (I) classes and objects in PHP