-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24484cc
commit 2408eb5
Showing
14 changed files
with
1,254 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php declare(strict_types=1); | ||
|
||
// Copyright 2021 The Stellar PHP SDK Authors. All rights reserved. | ||
// Use of this source code is governed by a license that can be | ||
// found in the LICENSE file. | ||
|
||
namespace Soneso\StellarSDK\SEP\Toml; | ||
|
||
class Currencies extends \IteratorIterator | ||
{ | ||
|
||
public function __construct(Currency ...$currencies) | ||
{ | ||
parent::__construct(new \ArrayIterator($currencies)); | ||
} | ||
|
||
public function current(): Currency | ||
{ | ||
return parent::current(); | ||
} | ||
|
||
public function add(Currency $currency) | ||
{ | ||
$this->getInnerIterator()->append($currency); | ||
} | ||
|
||
public function count(): int | ||
{ | ||
return $this->getInnerIterator()->count(); | ||
} | ||
|
||
public function toArray() : array { | ||
$result = array(); | ||
foreach($this as $value) { | ||
array_push($result, $value); | ||
} | ||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php declare(strict_types=1); | ||
|
||
// Copyright 2021 The Stellar PHP SDK Authors. All rights reserved. | ||
// Use of this source code is governed by a license that can be | ||
// found in the LICENSE file. | ||
|
||
namespace Soneso\StellarSDK\SEP\Toml; | ||
|
||
/// Currency Documentation. From the stellar.toml [[CURRENCIES]] list, one set of fields for each currency supported. Applicable fields should be completed and any that don't apply should be excluded. | ||
/// See <a href="https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md" target="_blank">Stellar Toml</a> | ||
class Currency | ||
{ | ||
/// Token code. | ||
public ?string $code = null; | ||
|
||
/// A pattern with ? as a single character wildcard. Allows a [[CURRENCIES]] entry to apply to multiple assets that share the same info. An example is futures, where the only difference between issues is the date of the contract. E.g. CORN???????? to match codes such as CORN20180604. | ||
public ?string $codeTemplate = null; | ||
|
||
/// Token issuer Stellar public key. | ||
public ?string $issuer = null; | ||
|
||
/// Status of token. One of live, dead, test, or private. Allows issuer to mark whether token is dead/for testing/for private use or is live and should be listed in live exchanges. | ||
public ?string $status = null; | ||
|
||
/// Preference for number of decimals to show when a client displays currency balance. | ||
public ?int $displayDecimals = null; | ||
|
||
/// A short name for the token. | ||
public ?string $name = null; | ||
|
||
/// Description of token and what it represents. | ||
public ?string $desc = null; | ||
|
||
/// Conditions on token. | ||
public ?string $conditions = null; | ||
|
||
/// URL to a PNG image on a transparent background representing token. | ||
public ?string $image = null; | ||
|
||
/// Fixed number of tokens, if the number of tokens issued will never change. | ||
public ?int $fixedNumber = null; | ||
|
||
/// Max number of tokens, if there will never be more than maxNumber tokens. | ||
public ?int $maxNumber = null; | ||
|
||
/// The number of tokens is dilutable at the issuer's discretion. | ||
public ?bool $isUnlimited = null; | ||
|
||
/// true if token can be redeemed for underlying asset, otherwise false. | ||
public ?bool $isAssetAnchored = null; | ||
|
||
/// Type of asset anchored. Can be fiat, crypto, stock, bond, commodity, realestate, or other. | ||
public ?string $anchorAssetType = null; | ||
|
||
/// If anchored token, code / symbol for asset that token is anchored to. E.g. USD, BTC, SBUX, Address of real-estate investment property. | ||
public ?string $anchorAsset = null; | ||
|
||
/// If anchored token, these are instructions to redeem the underlying asset from tokens. | ||
public ?string $redemptionInstructions = null; | ||
|
||
/// If this is an anchored crypto token, list of one or more public addresses that hold the assets for which you are issuing tokens. | ||
public ?array $collateralAddresses = null; // [string] | ||
|
||
/// Messages stating that funds in the collateralAddresses list are reserved to back the issued asset. | ||
public ?array $collateralAddressMessages = null; // [string] | ||
|
||
/// These prove you control the collateralAddresses. For each address you list, sign the entry in collateralAddressMessages with the address's private key and add the resulting string to this list as a base64-encoded raw signature. | ||
public ?array $collateralAddressSignatures = null; // [string] | ||
|
||
/// Indicates whether or not this is a sep0008 regulated asset. If missing, false is assumed. | ||
public ?bool $regulated = null; | ||
|
||
/// URL of a sep0008 compliant approval service that signs validated transactions. | ||
public ?string $approvalServer = null; | ||
|
||
/// A human readable string that explains the issuer's requirements for approving transactions. | ||
public ?string $approvalCriteria = null; | ||
|
||
/// Alternately, stellar.toml can link out to a separate TOML file for each currency by specifying toml="https://DOMAIN/.well-known/CURRENCY.toml" as the currency's only field. | ||
/// In this case only this field is filled. To load the currency data, you can use StellarToml.currencyFromUrl(String toml). | ||
public ?string $toml = null; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php declare(strict_types=1); | ||
|
||
// Copyright 2021 The Stellar PHP SDK Authors. All rights reserved. | ||
// Use of this source code is governed by a license that can be | ||
// found in the LICENSE file. | ||
|
||
namespace Soneso\StellarSDK\SEP\Toml; | ||
|
||
/// Organization Documentation. From the stellar.toml DOCUMENTATION table. | ||
/// See <a href="https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md" target="_blank">Stellar Toml</a> | ||
class Documentation | ||
{ | ||
/// Legal name of the organization. | ||
public ?string $orgName = null; | ||
|
||
/// (may not apply) DBA of the organization. | ||
public ?string $orgDBA = null; | ||
|
||
/// The organization's official URL. The stellar.toml must be hosted on the same domain. | ||
public ?string $orgUrl = null; | ||
|
||
/// An Url to a PNG image of the organization's logo on a transparent background. | ||
public ?string $orgLogo = null; | ||
|
||
/// Short description of the organization. | ||
public ?string $orgDescription = null; | ||
|
||
/// Physical address for the organization. | ||
public ?string $orgPhysicalAddress = null; | ||
|
||
/// URL on the same domain as the orgUrl that contains an image or pdf official document attesting to the physical address. It must list the orgName or orgDBA as the party at the address. Only documents from an official third party are acceptable. E.g. a utility bill, mail from a financial institution, or business license. | ||
public ?string $orgPhysicalAddressAttestation = null; | ||
|
||
/// The organization's phone number in E.164 format, e.g. +14155552671. | ||
public ?string $orgPhoneNumber = null; | ||
|
||
/// URL on the same domain as the orgUrl that contains an image or pdf of a phone bill showing both the phone number and the organization's name. | ||
public ?string $orgPhoneNumberAttestation = null; | ||
|
||
/// A Keybase account name for the organization. Should contain proof of ownership of any public online accounts you list here, including the organization's domain. | ||
public ?string $orgKeybase = null; | ||
|
||
/// The organization's Twitter account. | ||
public ?string $orgTwitter = null; | ||
|
||
/// The organization's Github account | ||
public ?string $orgGithub = null; | ||
|
||
/// An email where clients can contact the organization. Must be hosted at the orgUrl domain. | ||
public ?string $orgOfficialEmail = null; | ||
|
||
/// Name of the authority or agency that licensed the organization, if applicable. | ||
public ?string $orgLicensingAuthority = null; | ||
|
||
/// Type of financial or other license the organization holds, if applicable | ||
public ?string $orgLicenseType = null; | ||
|
||
/// Official license number of the organization, if applicable. | ||
public ?string $orgLicenseNumber = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php declare(strict_types=1); | ||
|
||
// Copyright 2021 The Stellar PHP SDK Authors. All rights reserved. | ||
// Use of this source code is governed by a license that can be | ||
// found in the LICENSE file. | ||
|
||
namespace Soneso\StellarSDK\SEP\Toml; | ||
|
||
/// General information from the stellar.toml file. | ||
/// See <a href="https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md" target="_blank">Stellar Toml</a> | ||
class GeneralInformation | ||
{ | ||
/// The version of SEP-1 your stellar.toml adheres to. This helps parsers know which fields to expect. | ||
public ?string $version = null; | ||
|
||
/// The passphrase for the specific Stellar network this infrastructure operates on. | ||
public ?string $networkPassphrase = null; | ||
|
||
/// The endpoint for clients to resolve stellar addresses for users on your domain via SEP-2 Federation Protocol. | ||
public ?string $federationServer = null; | ||
|
||
/// The endpoint used for SEP-3 Compliance Protocol. | ||
public ?string $authServer = null; | ||
|
||
/// The server used for SEP-6 Anchor/Client interoperability. | ||
public ?string $transferServer = null; | ||
|
||
/// The server used for SEP-24 Anchor/Client interoperability. | ||
public ?string $transferServerSep24 = null; | ||
|
||
/// The server used for SEP-12 Anchor/Client customer info transfer. | ||
public ?string $kYCServer = null; | ||
|
||
/// The endpoint used for SEP-10 Web Authentication. | ||
public ?string $webAuthEndpoint = null; | ||
|
||
/// The signing key is used for SEP-3 Compliance Protocol and SEP-10 Authentication Protocol. | ||
public ?string $signingKey = null; | ||
|
||
/// Location of public-facing Horizon instance (if one is offered). | ||
public ?string $horizonUrl = null; | ||
|
||
/// A list of Stellar accounts that are controlled by this domain | ||
public array $accounts = array(); | ||
|
||
/// The signing key is used for SEP-7 delegated signing. | ||
public ?string $uriRequestSigningKey = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php declare(strict_types=1); | ||
|
||
// Copyright 2021 The Stellar PHP SDK Authors. All rights reserved. | ||
// Use of this source code is governed by a license that can be | ||
// found in the LICENSE file. | ||
|
||
namespace Soneso\StellarSDK\SEP\Toml; | ||
|
||
/// Point of Contact Documentation. From the stellar.toml [[PRINCIPALS]] list. It contains identifying information for the primary point of contact or principal of the organization. | ||
/// See <a href="https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md" target="_blank">Stellar Toml</a> | ||
class PointOfContact | ||
{ | ||
/// Full legal name. | ||
public ?string $name = null; | ||
|
||
/// Business email address for the principal. | ||
public ?string $email = null; | ||
|
||
/// Personal Keybase account. Should include proof of ownership for other online accounts, as well as the organization's domain. | ||
public ?string $keybase = null; | ||
|
||
/// Personal Telegram account. | ||
public ?string $telegram = null; | ||
|
||
/// Personal Twitter account. | ||
public ?string $twitter = null; | ||
|
||
/// Personal Github account. | ||
public ?string $github = null; | ||
|
||
/// SHA-256 hash of a photo of the principal's government-issued photo ID. | ||
public ?string $idPhotoHash = null; | ||
|
||
/// SHA-256 hash of a verification photo of principal. Should be well-lit and contain: principal holding ID card and signed, dated, hand-written message stating I, $name, am a principal of $orgName, a Stellar token issuer with address $issuerAddress. | ||
public ?string $verificationPhotoHash = null; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php declare(strict_types=1); | ||
|
||
// Copyright 2021 The Stellar PHP SDK Authors. All rights reserved. | ||
// Use of this source code is governed by a license that can be | ||
// found in the LICENSE file. | ||
|
||
namespace Soneso\StellarSDK\SEP\Toml; | ||
|
||
class Principals extends \IteratorIterator | ||
{ | ||
|
||
public function __construct(PointOfContact ...$pointsOfContact) | ||
{ | ||
parent::__construct(new \ArrayIterator($pointsOfContact)); | ||
} | ||
|
||
public function current(): PointOfContact | ||
{ | ||
return parent::current(); | ||
} | ||
|
||
public function add(PointOfContact $pointOfContact) | ||
{ | ||
$this->getInnerIterator()->append($pointOfContact); | ||
} | ||
|
||
public function count(): int | ||
{ | ||
return $this->getInnerIterator()->count(); | ||
} | ||
|
||
public function toArray() : array { | ||
$result = array(); | ||
foreach($this as $value) { | ||
array_push($result, $value); | ||
} | ||
return $result; | ||
} | ||
} |
Oops, something went wrong.